mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
bug 382422: [sd90] Add MinGW specs detector
This commit is contained in:
parent
3f3026481c
commit
2df46fd99f
11 changed files with 178 additions and 52 deletions
|
@ -621,6 +621,14 @@
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
</provider>
|
</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
|
<provider
|
||||||
class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser"
|
class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser"
|
||||||
id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"
|
id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"
|
||||||
|
|
|
@ -18,11 +18,13 @@ import org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpec
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to detect built-in compiler settings.
|
* Class to detect built-in compiler settings for Cygwin toolchain.
|
||||||
* The paths are converted to cygwin "file-system" representation.
|
* The paths are converted to cygwin "file-system" representation.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class GCCBuiltinSpecsDetectorCygwin extends GCCBuiltinSpecsDetector {
|
public class GCCBuiltinSpecsDetectorCygwin 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_CYGWIN = "cdt.managedbuild.toolchain.gnu.cygwin.base"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final URI CYGWIN_ROOT;
|
private static final URI CYGWIN_ROOT;
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
|
@ -33,6 +35,11 @@ public class GCCBuiltinSpecsDetectorCygwin extends GCCBuiltinSpecsDetector {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getToolchainId() {
|
||||||
|
return GCC_TOOLCHAIN_ID_CYGWIN;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected URI getMappedRootURI(IResource sourceFile, String parsedResourceName) {
|
protected URI getMappedRootURI(IResource sourceFile, String parsedResourceName) {
|
||||||
if (mappedRootURI == null) {
|
if (mappedRootURI == null) {
|
||||||
|
|
|
@ -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.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.CommandLauncher;
|
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.IConsoleParser;
|
||||||
import org.eclipse.cdt.core.IMarkerGenerator;
|
import org.eclipse.cdt.core.IMarkerGenerator;
|
||||||
import org.eclipse.cdt.core.ProblemMarkerInfo;
|
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.ICBuildOutputParser;
|
||||||
import org.eclipse.cdt.core.language.settings.providers.ICListenerAgent;
|
import org.eclipse.cdt.core.language.settings.providers.ICListenerAgent;
|
||||||
import org.eclipse.cdt.core.language.settings.providers.IWorkingDirectoryTracker;
|
import org.eclipse.cdt.core.language.settings.providers.IWorkingDirectoryTracker;
|
||||||
|
@ -43,6 +47,7 @@ import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSetting
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages;
|
import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages;
|
||||||
import org.eclipse.cdt.utils.CommandLineUtil;
|
import org.eclipse.cdt.utils.CommandLineUtil;
|
||||||
|
import org.eclipse.cdt.utils.envvar.EnvironmentCollector;
|
||||||
import org.eclipse.core.resources.IMarker;
|
import org.eclipse.core.resources.IMarker;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||||
|
@ -149,7 +154,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
} 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 {
|
try {
|
||||||
|
@ -166,7 +171,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
|
||||||
marker.setAttribute(IMarker.LOCATION, msgProperties);
|
marker.setAttribute(IMarker.LOCATION, msgProperties);
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
} 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;
|
return Status.OK_STATUS;
|
||||||
|
@ -192,7 +197,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
} 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$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -596,26 +601,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)
|
// On POSIX (Linux, UNIX) systems reset language variables to default (English)
|
||||||
// with UTF-8 encoding since GNU compilers can handle only UTF-8 characters.
|
// with UTF-8 encoding since GNU compilers can handle only UTF-8 characters.
|
||||||
// Include paths with locale characters will be handled properly regardless
|
// Include paths with locale characters will be handled properly regardless
|
||||||
// of the language as long as the encoding is set to UTF-8.
|
// 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
|
// English language is set for parser because it relies on English messages
|
||||||
// in the output of the 'gcc -v' command.
|
// 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)));
|
return vars;
|
||||||
for (Iterator<String> iterator = envp.iterator(); iterator.hasNext();) {
|
|
||||||
String var = iterator.next();
|
|
||||||
if (var.startsWith(ENV_LANGUAGE + '=') || var.startsWith(ENV_LC_ALL + '=')) {
|
|
||||||
iterator.remove();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
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$
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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());
|
||||||
|
}
|
||||||
return envp.toArray(new String[envp.size()]);
|
return envp.toArray(new String[envp.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class GCCBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector imple
|
||||||
};
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getToolchainId() {
|
public String getToolchainId() {
|
||||||
return GCC_TOOLCHAIN_ID;
|
return GCC_TOOLCHAIN_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,14 +11,22 @@
|
||||||
|
|
||||||
package org.eclipse.cdt.managedbuilder.language.settings.providers;
|
package org.eclipse.cdt.managedbuilder.language.settings.providers;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
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.IInputType;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
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
|
* 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
|
* Tool-chain id must be supplied for global providers where we don't
|
||||||
* have configuration description to figure that out programmatically.
|
* 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.
|
* 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;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1842,7 +1842,7 @@
|
||||||
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwEnvironmentVariableSupplier"
|
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwEnvironmentVariableSupplier"
|
||||||
id="cdt.managedbuild.toolchain.gnu.mingw.base"
|
id="cdt.managedbuild.toolchain.gnu.mingw.base"
|
||||||
isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwIsToolChainSupported"
|
isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwIsToolChainSupported"
|
||||||
languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
|
languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW"
|
||||||
name="%ToolChainName.MinGW"
|
name="%ToolChainName.MinGW"
|
||||||
osList="win32"
|
osList="win32"
|
||||||
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base;cdt.managedbuild.tool.gnu.c.linker.mingw.base;cdt.managedbuild.tool.gnu.archiver">
|
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;
|
package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
|
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.internal.ui.Messages;
|
||||||
import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector;
|
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.ui.language.settings.providers.AbstractLanguageSettingProviderOptionPage;
|
||||||
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.jface.dialogs.Dialog;
|
import org.eclipse.jface.dialogs.Dialog;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.ModifyEvent;
|
import org.eclipse.swt.events.ModifyEvent;
|
||||||
|
@ -43,6 +50,8 @@ public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettin
|
||||||
private Text inputCommand;
|
private Text inputCommand;
|
||||||
private Button allocateConsoleCheckBox;
|
private Button allocateConsoleCheckBox;
|
||||||
|
|
||||||
|
private StatusMessageLine fStatusLine;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createControl(Composite parent) {
|
public void createControl(Composite parent) {
|
||||||
fEditable = parent.isEnabled();
|
fEditable = parent.isEnabled();
|
||||||
|
@ -52,6 +61,7 @@ public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettin
|
||||||
createCompilerCommandInputControl(composite, provider);
|
createCompilerCommandInputControl(composite, provider);
|
||||||
createBrowseButton(composite);
|
createBrowseButton(composite);
|
||||||
createConsoleCheckbox(composite, provider);
|
createConsoleCheckbox(composite, provider);
|
||||||
|
createStatusLine(composite, provider);
|
||||||
|
|
||||||
setControl(composite);
|
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
|
@Override
|
||||||
public void performApply(IProgressMonitor monitor) throws CoreException {
|
public void performApply(IProgressMonitor monitor) throws CoreException {
|
||||||
ILanguageSettingsProvider provider = providerTab.getProvider(providerId);
|
ILanguageSettingsProvider provider = providerTab.getProvider(providerId);
|
||||||
|
|
|
@ -176,7 +176,7 @@ public class EnvVarOperationProcessor {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* removes duplicates
|
* removes duplicates
|
||||||
*/
|
*/
|
||||||
static public List<String> removeDuplicates(List<String> value, List<String> duplicates){
|
static public List<String> removeDuplicates(List<String> value, List<String> duplicates){
|
||||||
|
@ -220,7 +220,7 @@ public class EnvVarOperationProcessor {
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* normalizes the variable name. That is: removes prepended and appended spaces
|
* normalizes the variable name. That is: removes prepended and appended spaces
|
||||||
* and converts the name to upper-case for Win32 systems
|
* 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
|
* @return the normalized name or <code>null</code> in case the name is not valid
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class XlcBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector imple
|
||||||
};
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getToolchainId() {
|
public String getToolchainId() {
|
||||||
return XLC_TOOLCHAIN_ID;
|
return XLC_TOOLCHAIN_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue