mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
bug 382422: [sd90] Add MinGW specs detector
This commit is contained in:
parent
bac3846b32
commit
9de02335d9
10 changed files with 169 additions and 49 deletions
|
@ -613,6 +613,14 @@
|
|||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
<provider
|
||||
class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.GCCBuiltinSpecsDetectorMinGW"
|
||||
id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW"
|
||||
name="CDT GCC Builtin Compiler Settings MinGW"
|
||||
parameter="${COMMAND} -E -P -v -dD ${INPUTS}">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
<provider
|
||||
class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser"
|
||||
id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012, 2012 Andrew Gvozdev and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Andrew Gvozdev - initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.managedbuilder.internal.language.settings.providers;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector;
|
||||
|
||||
/**
|
||||
* Class to detect built-in compiler settings for MinGW toolchain.
|
||||
*/
|
||||
public class GCCBuiltinSpecsDetectorMinGW extends GCCBuiltinSpecsDetector {
|
||||
// ID must match the tool-chain definition in org.eclipse.cdt.managedbuilder.core.buildDefinitions extension point
|
||||
private static final String GCC_TOOLCHAIN_ID_MINGW = "cdt.managedbuild.toolchain.gnu.mingw.base"; //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
public String getToolchainId() {
|
||||
return GCC_TOOLCHAIN_ID_MINGW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GCCBuiltinSpecsDetectorMinGW cloneShallow() throws CloneNotSupportedException {
|
||||
return (GCCBuiltinSpecsDetectorMinGW) super.cloneShallow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public GCCBuiltinSpecsDetectorMinGW clone() throws CloneNotSupportedException {
|
||||
return (GCCBuiltinSpecsDetectorMinGW) super.clone();
|
||||
}
|
||||
|
||||
}
|
|
@ -17,8 +17,9 @@ import java.net.URI;
|
|||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.CommandLauncher;
|
||||
|
@ -27,6 +28,9 @@ import org.eclipse.cdt.core.ICommandLauncher;
|
|||
import org.eclipse.cdt.core.IConsoleParser;
|
||||
import org.eclipse.cdt.core.IMarkerGenerator;
|
||||
import org.eclipse.cdt.core.ProblemMarkerInfo;
|
||||
import org.eclipse.cdt.core.envvar.EnvironmentVariable;
|
||||
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
|
||||
import org.eclipse.cdt.core.envvar.IEnvironmentVariableManager;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ICBuildOutputParser;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ICListenerAgent;
|
||||
import org.eclipse.cdt.core.language.settings.providers.IWorkingDirectoryTracker;
|
||||
|
@ -42,6 +46,7 @@ import org.eclipse.cdt.internal.core.XmlUtil;
|
|||
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages;
|
||||
import org.eclipse.cdt.utils.CommandLineUtil;
|
||||
import org.eclipse.cdt.utils.envvar.EnvironmentCollector;
|
||||
import org.eclipse.core.resources.IMarker;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||
|
@ -148,7 +153,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
|
|||
}
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
return new Status(Status.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error checking markers.", e); //$NON-NLS-1$
|
||||
return new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error checking markers.", e); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -165,7 +170,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
|
|||
marker.setAttribute(IMarker.LOCATION, msgProperties);
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
return new Status(Status.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error adding markers.", e); //$NON-NLS-1$
|
||||
return new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error adding markers.", e); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return Status.OK_STATUS;
|
||||
|
@ -191,7 +196,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
|
|||
}
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
ManagedBuilderCorePlugin.log(new Status(Status.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error deleting markers.", e)); //$NON-NLS-1$
|
||||
ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error deleting markers.", e)); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -580,26 +585,39 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
|
|||
}
|
||||
|
||||
/**
|
||||
* Get array of environment variables in format "var=value".
|
||||
* Returns list of environment variables to be used during execution of provider's command.
|
||||
* Implementers are expected to add their variables to the end of the list.
|
||||
*
|
||||
* @return list of environment variables.
|
||||
*/
|
||||
private String[] getEnvp() {
|
||||
protected List<IEnvironmentVariable> getEnvironmentVariables() {
|
||||
IEnvironmentVariableManager mngr = CCorePlugin.getDefault().getBuildEnvironmentManager();
|
||||
List<IEnvironmentVariable> vars = new ArrayList<IEnvironmentVariable>(Arrays.asList(mngr.getVariables(currentCfgDescription, true)));
|
||||
|
||||
// On POSIX (Linux, UNIX) systems reset language variables to default (English)
|
||||
// with UTF-8 encoding since GNU compilers can handle only UTF-8 characters.
|
||||
// Include paths with locale characters will be handled properly regardless
|
||||
// of the language as long as the encoding is set to UTF-8.
|
||||
// English language is set for parser because it relies on English messages
|
||||
// in the output of the 'gcc -v' command.
|
||||
vars.add(new EnvironmentVariable(ENV_LANGUAGE, "en")); //$NON-NLS-1$
|
||||
vars.add(new EnvironmentVariable(ENV_LC_ALL, "C.UTF-8")); //$NON-NLS-1$
|
||||
|
||||
List<String> envp = new ArrayList<String>(Arrays.asList(BuildRunnerHelper.getEnvp(currentCfgDescription)));
|
||||
for (Iterator<String> iterator = envp.iterator(); iterator.hasNext();) {
|
||||
String var = iterator.next();
|
||||
if (var.startsWith(ENV_LANGUAGE + '=') || var.startsWith(ENV_LC_ALL + '=')) {
|
||||
iterator.remove();
|
||||
}
|
||||
return vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get array of environment variables in format "var=value".
|
||||
*/
|
||||
private String[] getEnvp() {
|
||||
EnvironmentCollector collector = new EnvironmentCollector();
|
||||
List<IEnvironmentVariable> vars = getEnvironmentVariables();
|
||||
collector.addVariables(vars.toArray(new IEnvironmentVariable[vars.size()]));
|
||||
|
||||
Set<String> envp = new HashSet<String>();
|
||||
for (IEnvironmentVariable var : collector.getVariables()) {
|
||||
envp.add(var.getName() + '=' + var.getValue());
|
||||
}
|
||||
envp.add(ENV_LANGUAGE + "=en"); // override for GNU gettext //$NON-NLS-1$
|
||||
envp.add(ENV_LC_ALL + "=C.UTF-8"); // for other parts of the system libraries //$NON-NLS-1$
|
||||
|
||||
return envp.toArray(new String[envp.size()]);
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public class GCCBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector imple
|
|||
};
|
||||
|
||||
@Override
|
||||
protected String getToolchainId() {
|
||||
public String getToolchainId() {
|
||||
return GCC_TOOLCHAIN_ID;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,14 +11,22 @@
|
|||
|
||||
package org.eclipse.cdt.managedbuilder.language.settings.providers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IInputType;
|
||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
||||
import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
|
||||
import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier;
|
||||
import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
|
||||
|
||||
/**
|
||||
* Abstract parser capable to execute compiler command printing built-in compiler
|
||||
|
@ -43,7 +51,7 @@ public abstract class ToolchainBuiltinSpecsDetector extends AbstractBuiltinSpecs
|
|||
* Tool-chain id must be supplied for global providers where we don't
|
||||
* have configuration description to figure that out programmatically.
|
||||
*/
|
||||
protected abstract String getToolchainId();
|
||||
public abstract String getToolchainId();
|
||||
|
||||
/**
|
||||
* Finds a tool handling given language in the tool-chain of the provider.
|
||||
|
@ -109,4 +117,22 @@ public abstract class ToolchainBuiltinSpecsDetector extends AbstractBuiltinSpecs
|
|||
return ext;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<IEnvironmentVariable> getEnvironmentVariables() {
|
||||
List<IEnvironmentVariable> vars = new ArrayList<IEnvironmentVariable>(super.getEnvironmentVariables());
|
||||
|
||||
String toolchainId = getToolchainId();
|
||||
for (IToolChain toolchain = ManagedBuildManager.getExtensionToolChain(toolchainId); toolchain != null; toolchain = toolchain.getSuperClass()) {
|
||||
IConfigurationEnvironmentVariableSupplier envSupplier = toolchain.getEnvironmentVariableSupplier();
|
||||
if (envSupplier != null) {
|
||||
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(currentCfgDescription);
|
||||
IEnvironmentVariableProvider provider = ManagedBuildManager.getEnvironmentVariableProvider();
|
||||
IBuildEnvironmentVariable[] added = envSupplier.getVariables(cfg, provider);
|
||||
vars.addAll(Arrays.asList(added));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return vars;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1841,6 +1841,7 @@
|
|||
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwEnvironmentVariableSupplier"
|
||||
id="cdt.managedbuild.toolchain.gnu.mingw.base"
|
||||
isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwIsToolChainSupported"
|
||||
languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW"
|
||||
name="%ToolChainName.MinGW"
|
||||
osList="win32"
|
||||
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base;cdt.managedbuild.tool.gnu.c.linker.mingw.base;cdt.managedbuild.tool.gnu.archiver">
|
||||
|
|
|
@ -11,14 +11,21 @@
|
|||
package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
|
||||
|
||||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
|
||||
import org.eclipse.cdt.internal.ui.newui.StatusMessageLine;
|
||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||
import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector;
|
||||
import org.eclipse.cdt.managedbuilder.language.settings.providers.ToolchainBuiltinSpecsDetector;
|
||||
import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
|
||||
import org.eclipse.cdt.ui.language.settings.providers.AbstractLanguageSettingProviderOptionPage;
|
||||
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
|
@ -43,6 +50,8 @@ public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettin
|
|||
private Text inputCommand;
|
||||
private Button allocateConsoleCheckBox;
|
||||
|
||||
private StatusMessageLine fStatusLine;
|
||||
|
||||
@Override
|
||||
public void createControl(Composite parent) {
|
||||
fEditable = parent.isEnabled();
|
||||
|
@ -52,6 +61,7 @@ public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettin
|
|||
createCompilerCommandInputControl(composite, provider);
|
||||
createBrowseButton(composite);
|
||||
createConsoleCheckbox(composite, provider);
|
||||
createStatusLine(composite, provider);
|
||||
|
||||
setControl(composite);
|
||||
}
|
||||
|
@ -157,6 +167,25 @@ public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettin
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create status line to display messages for user.
|
||||
*/
|
||||
private void createStatusLine(Composite composite, AbstractBuiltinSpecsDetector provider) {
|
||||
fStatusLine = new StatusMessageLine(composite, SWT.LEFT, 2);
|
||||
|
||||
if (provider instanceof ToolchainBuiltinSpecsDetector) {
|
||||
String toolchainId = ((ToolchainBuiltinSpecsDetector) provider).getToolchainId();
|
||||
IToolChain toolchain = ManagedBuildManager.getExtensionToolChain(toolchainId);
|
||||
if (toolchain == null) {
|
||||
fStatusLine.setErrorStatus(new Status(IStatus.ERROR, ManagedBuilderUIPlugin.getUniqueIdentifier(),
|
||||
IStatus.ERROR, "Toolchain support for CDT is not installed. Toolchain id=[" + toolchainId + "].", null));
|
||||
} else if (!toolchain.isSupported()) {
|
||||
fStatusLine.setErrorStatus(new Status(IStatus.INFO, ManagedBuilderUIPlugin.getUniqueIdentifier(), IStatus.INFO,
|
||||
"Toolchain " + toolchain.getName() + " is not detected on this system.", null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performApply(IProgressMonitor monitor) throws CoreException {
|
||||
ILanguageSettingsProvider provider = providerTab.getProvider(providerId);
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin {
|
|||
// super();
|
||||
plugin = this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return
|
||||
|
@ -100,7 +100,7 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin {
|
|||
message = null;
|
||||
}
|
||||
} else {
|
||||
status = new Status(IStatus.ERROR, ManagedBuilderUIPlugin.getUniqueIdentifier(), -1, "Internal Error: ", t); //$NON-NLS-1$
|
||||
status = new Status(IStatus.ERROR, ManagedBuilderUIPlugin.getUniqueIdentifier(), -1, "Internal Error: ", t); //$NON-NLS-1$
|
||||
}
|
||||
ErrorDialog.openError(shell, title, message, status);
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin {
|
|||
}
|
||||
|
||||
/**
|
||||
* Answers the <code>Shell</code> associated with the active workbench, or
|
||||
* Answers the <code>Shell</code> associated with the active workbench, or
|
||||
* one of the windows associated with the workbench.
|
||||
* @return
|
||||
*/
|
||||
|
@ -126,6 +126,6 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin {
|
|||
return windows[0].getShell();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -20,21 +20,21 @@ import org.eclipse.cdt.internal.core.envvar.EnvironmentVariableManager;
|
|||
|
||||
|
||||
/**
|
||||
* This is an utility class that implements environment variable operations
|
||||
* This is an utility class that implements environment variable operations
|
||||
* functionality: append, prepend, replace and remove
|
||||
*
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public class EnvVarOperationProcessor {
|
||||
/**
|
||||
* performs the environment variable operation given an initial variable and
|
||||
* a variable representing an operation to be performed
|
||||
* Returns a new variable the represents the result of a performed operation
|
||||
*
|
||||
* Returns a new variable the represents the result of a performed operation
|
||||
*
|
||||
* @param initial the initial variable
|
||||
* @param added the variable that specifies an operation to be performed on the
|
||||
* initial variable value
|
||||
* @return the new variable the represents the result of a performed operation
|
||||
* initial variable value
|
||||
* @return the new variable the represents the result of a performed operation
|
||||
*/
|
||||
static public IEnvironmentVariable performOperation(IEnvironmentVariable initial, IEnvironmentVariable added){
|
||||
if(initial == null){
|
||||
|
@ -42,9 +42,9 @@ public class EnvVarOperationProcessor {
|
|||
}
|
||||
if(added == null)
|
||||
return initial;
|
||||
|
||||
|
||||
String name = added.getName();
|
||||
|
||||
|
||||
switch(added.getOperation()){
|
||||
case IEnvironmentVariable.ENVVAR_REMOVE:
|
||||
return new EnvironmentVariable(name,null,IEnvironmentVariable.ENVVAR_REMOVE,null);
|
||||
|
@ -82,24 +82,24 @@ public class EnvVarOperationProcessor {
|
|||
return addValue;
|
||||
if(addValue == null)
|
||||
return initialValue;
|
||||
|
||||
|
||||
if(delimiter == null || "".equals(delimiter)){ //$NON-NLS-1$
|
||||
return prepend ? addValue + initialValue : initialValue + addValue;
|
||||
}
|
||||
|
||||
|
||||
List<String> value = convertToList(initialValue, delimiter);
|
||||
List<String> added = convertToList(addValue, delimiter);
|
||||
|
||||
value = removeDuplicates(value, added);
|
||||
|
||||
|
||||
if(prepend)
|
||||
value.addAll(0,added);
|
||||
else
|
||||
value.addAll(added);
|
||||
|
||||
|
||||
return convertToString(value, delimiter);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* performs append given an initial String, a string to be appended and a delimiter
|
||||
* Returns a String representing the result of the operation
|
||||
|
@ -111,7 +111,7 @@ public class EnvVarOperationProcessor {
|
|||
static public String performAppend(String initialValue, String addValue, String delimiter){
|
||||
return performAppendPrepend(initialValue,addValue,delimiter,false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* performs prepend given an initial String, a string to be prepended and a delimiter
|
||||
* Returns a String representing the result of the operation
|
||||
|
@ -123,7 +123,7 @@ public class EnvVarOperationProcessor {
|
|||
static public String performPrepend(String initialValue, String addValue, String delimiter){
|
||||
return performAppendPrepend(initialValue,addValue,delimiter,true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* performs an environment variable operation
|
||||
* Returns String representing the result of the operation
|
||||
|
@ -141,7 +141,7 @@ public class EnvVarOperationProcessor {
|
|||
return performPrepend(initialValue,newValue,delimiter);
|
||||
case IEnvironmentVariable.ENVVAR_APPEND:
|
||||
return performAppend(initialValue,newValue,delimiter);
|
||||
case IEnvironmentVariable.ENVVAR_REPLACE:
|
||||
case IEnvironmentVariable.ENVVAR_REPLACE:
|
||||
default:
|
||||
return initialValue;
|
||||
}
|
||||
|
@ -175,8 +175,8 @@ public class EnvVarOperationProcessor {
|
|||
|
||||
return list;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
/**
|
||||
* removes duplicates
|
||||
*/
|
||||
static public List<String> removeDuplicates(List<String> value, List<String> duplicates){
|
||||
|
@ -198,7 +198,7 @@ public class EnvVarOperationProcessor {
|
|||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts list to a single String using a given delimiter to separate
|
||||
* the list value in the resulting String
|
||||
|
@ -209,18 +209,18 @@ public class EnvVarOperationProcessor {
|
|||
static public String convertToString(List<String> list, String delimiter){
|
||||
Iterator<String> iter = list.iterator();
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
|
||||
|
||||
while(iter.hasNext()){
|
||||
buffer.append(iter.next());
|
||||
|
||||
|
||||
if(iter.hasNext())
|
||||
buffer.append(delimiter);
|
||||
}
|
||||
|
||||
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
/**
|
||||
* normalizes the variable name. That is: removes prepended and appended spaces
|
||||
* and converts the name to upper-case for Win32 systems
|
||||
* @return the normalized name or <code>null</code> in case the name is not valid
|
||||
|
@ -234,12 +234,12 @@ public class EnvVarOperationProcessor {
|
|||
name = name.toUpperCase();
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
static public IEnvironmentVariable[] filterVariables(IEnvironmentVariable variables[], String remove[]){
|
||||
|
||||
|
||||
if(variables == null || variables.length == 0)
|
||||
return variables;
|
||||
|
||||
|
||||
IEnvironmentVariable filtered[] = new IEnvironmentVariable[variables.length];
|
||||
int filteredNum = 0;
|
||||
for (IEnvironmentVariable var : variables) {
|
||||
|
|
|
@ -51,7 +51,7 @@ public class XlcBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector imple
|
|||
};
|
||||
|
||||
@Override
|
||||
protected String getToolchainId() {
|
||||
public String getToolchainId() {
|
||||
return XLC_TOOLCHAIN_ID;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue