Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorJeff Johnston2017-02-09 23:43:05 +0000
committerJeff Johnston2017-10-22 09:38:51 +0000
commitc96d126b86382356caec9b8ee961e37b84313f6b (patch)
treef48f38e68d303c6d8c7d9f1b30d22f3c8ea3c59e /build
parent4c1a6e0ccd90da71cb6d2e7cacfc284a07b180b8 (diff)
downloadorg.eclipse.cdt-c96d126b86382356caec9b8ee961e37b84313f6b.tar.gz
org.eclipse.cdt-c96d126b86382356caec9b8ee961e37b84313f6b.tar.xz
org.eclipse.cdt-c96d126b86382356caec9b8ee961e37b84313f6b.zip
Bug 513589 - Add support to build CDT projects in a Docker Container
- add IOptionalBuildObjectPropertiesContainer interface to use for objects that supply optional build properties - add new IOptionalBuildProperties interface that defines optional build properties donated by external plug-ins - add new - change IConfiguration to an IOptionalBuildObjectPropertiesContainer - change IManagedProject to be an IOptionalBuildObjectPropertiesContainer - fix ProcessClosure to ensure that readers are not null before accessing them - fix Container launch delegate to look at project optional build properties for active configuration to fetch connection and image info and use said info to find a matching launch or create a new one - have Container launch delegate use the image name as part of the launch config name - have Container launch short-cut also use the project's optional build properties for the active config to get connection and image information before any defaulting - change AutotoolsNewMarkerGenerator to store the command launcher as an ICommandLauncher - add new CommandLauncherFactory extension to cdt.core that allows plug-ins to specify a CommandLauncherFactory that will return an ICommandLauncher based on the project - add macros for new extension to CCorePlugin - add new CommandLauncherManager class that loads CommandLauncherFactory extensions and is used to give an ICommandLauncher wrapper that will go through the list of CommandLauncherFactory extensions until one returns non-null ICommandLauncher - add code to RemoteCommandLauncher so it will use the CommandLauncherManager to get the local launcher - also change RemoteCommandLauncher to check at execution time whether the command is local and in that case use the local command launcher - add new ICommandLauncherFactory interface - add new ContainerCommandLauncher to launch - add new ContainerCommandLauncherFactory class for returning a ContainerCommandLauncher instance to launch commands in a Docker Container - change MakeBuilder to use CommandLauncherManager to get its ICommandLauncher - change CommandBuilder to use CommandLauncherManager too - ditto for Builder and AbstractBuiltinSpecsDetector and ExternalToolInvoker - change Configuration to load/store optional build properties as well as return the properties to get/set - ditto for MultiConfiguration - change ManagedProject to implement IOptionalBuildOptionProperties interface - ditto for ProjectType - create new OptionalBuildProperties class to store optional build properties for a configuration - bump cdt.docker.launcher to 1.1.0 - use CommandLauncherFactory extension to define ContainerCommandLauncherFactory - add optional ContainerPropertyTab which allows the end-user to optionally choose to build a C/C++ project in a Container and specify the connection/image to use - in LanguageSettingsSerializableSettings class, call the CommandLauncherManager getLanguageSettingEntries method to get the massaged language setting entries based on the current list - in LanguageSettingsProviderSerializer, try and get the pooled entries using the cfg description so that it will have the project and can use the CommandLauncherManager to get entries from image - in ContainerCommandLauncherFactory move cached headers under a HEADERS directory in the plug-in area - create a sub-directory for the connection and a sub-directory for the image based on cleansed names - store the real names of the connection and image to use later in the DockerHeaderPreferencePage - modify LanguageSettingsEntriesTab to force the horizontal scroll bar to appear (this is a bug in SWT SashForm support and the fix here isn't quite correct, but is better) - add new DockerHeaderPreferencePage that allows user to remove cached headers from images - change C/C++ Docker preferences to be titled: Docker Container - fix LanguageSettingsWorkspaceProvider.getSettingEntries method to use the CommandLauncherManager so entries will be transformed to use cached headers - add BaseDatabindingModel class - add DataVolumeModel class to model a volume mount - add ContainerPropertyVolumes model to model volume specification and selected volumes - add properties to ContainerCommandLauncher to represent volumes and selected volumes for a configuration - add ContainerDataVolumeDialog for specifying a volume mount by the end-user - add a null detector for cfgDescription in LanguageSettingsSerializableProvider - fix AutotoolsNewMakeGenerator.getWinOSType to not specify "." for working dir - fix GCCBuiltinSpecsDetectorCygwin to not map paths to Cygwin if the current configuration is enabled for container build - add logic to ContainerCommandLauncher to look for Windows file formats and change them to unix format and map any "." working dir to be /tmp - fix ContainerLauncherConfigurationDelegate similarly - fix AbstractBuiltinSpecsDetector to pass in the current configuration description when getting the CommandLauncher since the current configuration may not be the active configuration - change ContainerPropertyTab to add Elf and GNU Elf binary parsers when build in Container is chosen so that output executables are treated as Binaries by the CDT project - add documentationl for the ContainerPropertyTab in Build Settings and the Data Volume dialog pop-up it brings up - change CommandBuilder to accept a project as an argument to its constructor and to pass this as an argument to the CommandLauncherManager - have StepBuilder pass project when creating a CommandBuilder Change-Id: Ia78488b93056e6ec7ca83a6c87b3a9d2b9424943
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java6
-rw-r--r--build/org.eclipse.cdt.autotools.tests/src/org/eclipse/cdt/autotools/tests/ProjectTools.java5
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java4
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IOptionalBuildProperties.java30
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObjectPropertiesContainer.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedProject.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionalBuildObjectPropertiesContainer.java21
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IProjectType.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/StepBuilder.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java43
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java28
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java9
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionalBuildProperties.java104
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java24
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java16
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestConfiguration.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestProjectType.java3
23 files changed, 326 insertions, 23 deletions
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
index 813fd3b4b5..b94eab734e 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
@@ -893,7 +893,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
consoleOutStream.flush();
// Get a launcher for the config command
- RemoteCommandLauncher launcher = new RemoteCommandLauncher();
+ ICommandLauncher launcher = new RemoteCommandLauncher();
launcher.setProject(project);
// Set the environment
IEnvironmentVariable variables[] =
@@ -1042,7 +1042,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
new Path(SHELL_COMMAND), //$NON-NLS-1$
new String[] { "-c", "echo $OSTYPE" }, //$NON-NLS-1$ //$NON-NLS-2$
env,
- new Path("."), //$NON-NLS-1$
+ buildLocation,
SubMonitor.convert(monitor));
if (launcher.waitAndRead(out, out) == ICommandLauncher.OK)
winOSType = out.toString().trim();
@@ -1207,7 +1207,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
consoleOutStream.flush();
// Get a launcher for the config command
- RemoteCommandLauncher launcher = new RemoteCommandLauncher();
+ ICommandLauncher launcher = new RemoteCommandLauncher();
launcher.setProject(project);
// Set the environment
IEnvironmentVariable variables[] =
diff --git a/build/org.eclipse.cdt.autotools.tests/src/org/eclipse/cdt/autotools/tests/ProjectTools.java b/build/org.eclipse.cdt.autotools.tests/src/org/eclipse/cdt/autotools/tests/ProjectTools.java
index ad5aad0d3b..8cbe618ac7 100644
--- a/build/org.eclipse.cdt.autotools.tests/src/org/eclipse/cdt/autotools/tests/ProjectTools.java
+++ b/build/org.eclipse.cdt.autotools.tests/src/org/eclipse/cdt/autotools/tests/ProjectTools.java
@@ -18,6 +18,8 @@ import java.util.zip.ZipFile;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.cdt.core.CommandLauncherManager;
+import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfigurationManager;
import org.eclipse.cdt.internal.autotools.core.configure.IAConfiguration;
@@ -129,7 +131,8 @@ public class ProjectTools {
*/
public static boolean markExecutable(IProject project, String filePath) {
// Get a launcher for the config command
- CommandLauncher launcher = new CommandLauncher();
+ ICommandLauncher launcher = CommandLauncherManager.getInstance().getCommandLauncher();
+ launcher.setProject(project);
OutputStream stdout = new ByteArrayOutputStream();
OutputStream stderr = new ByteArrayOutputStream();
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java
index 4d9b9ad51c..50a9e61e5e 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java
@@ -23,7 +23,7 @@ import java.util.List;
import java.util.Map;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ErrorParserManager;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.IConsoleParser;
@@ -180,7 +180,7 @@ public class MakeBuilder extends ACBuilder {
console.start(project);
// Prepare launch parameters for BuildRunnerHelper
- ICommandLauncher launcher = new CommandLauncher();
+ ICommandLauncher launcher = CommandLauncherManager.getInstance().getCommandLauncher();
String[] targets = getTargets(kind, info);
if (targets.length != 0 && targets[targets.length - 1].equals(info.getCleanBuildTarget()))
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
index cd8b03563b..8a2c47fab1 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
@@ -19,7 +19,7 @@ import java.util.List;
import java.util.Properties;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ErrorParserManager;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.IConsoleParser;
@@ -120,7 +120,7 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
}
console.start(project);
- ICommandLauncher launcher = new CommandLauncher();
+ ICommandLauncher launcher = CommandLauncherManager.getInstance().getCommandLauncher();
launcher.setProject(project);
IPath program = getCommandToLaunch();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IOptionalBuildProperties.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IOptionalBuildProperties.java
new file mode 100644
index 0000000000..23043aed06
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IOptionalBuildProperties.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Red Hat Inc. 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:
+ * Red Hat Inc. - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.managedbuilder.buildproperties;
+
+/**
+ * @noextend This class is not intended to be subclassed by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @since 8.5
+ */
+public interface IOptionalBuildProperties extends Cloneable {
+ String[] getProperties();
+
+ String getProperty(String id);
+
+ void setProperty(String propertyId, String propertyValue);
+
+ void removeProperty(String id);
+
+ void clear();
+
+ Object clone();
+} \ No newline at end of file
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObjectPropertiesContainer.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObjectPropertiesContainer.java
index 3bc55876f6..a3704a24f0 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObjectPropertiesContainer.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObjectPropertiesContainer.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.core;
-
/**
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
index f04149faef..81d1f28bbb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
@@ -36,7 +36,7 @@ import org.eclipse.core.runtime.IPath;
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
-public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesContainer {
+public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesContainer, IOptionalBuildObjectPropertiesContainer {
public static final String ARTIFACT_NAME = "artifactName"; //$NON-NLS-1$
public static final String CLEAN_COMMAND = "cleanCommand"; //$NON-NLS-1$
public static final String PREBUILD_STEP = "prebuildStep"; //$NON-NLS-1$
@@ -54,6 +54,10 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
public static final String DESCRIPTION = "description"; //$NON-NLS-1$
public static final String BUILD_PROPERTIES = "buildProperties"; //$NON-NLS-1$
+ /**
+ * @since 8.5
+ */
+ public static final String OPTIONAL_BUILD_PROPERTIES = "optionalBuildProperties"; //$NON-NLS-1$
public static final String BUILD_ARTEFACT_TYPE = "buildArtefactType"; //$NON-NLS-1$
public static final String IS_SYSTEM = "isSystem"; //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedProject.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedProject.java
index e0d527e939..8e5a0d7857 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedProject.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedProject.java
@@ -38,10 +38,14 @@ import org.eclipse.core.resources.IResource;
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
-public interface IManagedProject extends IBuildObject, IBuildObjectPropertiesContainer {
+public interface IManagedProject extends IBuildObject, IBuildObjectPropertiesContainer, IOptionalBuildObjectPropertiesContainer {
public static final String MANAGED_PROJECT_ELEMENT_NAME = "project"; //$NON-NLS-1$
public static final String PROJECTTYPE = "projectType"; //$NON-NLS-1$
public static final String BUILD_PROPERTIES = "buildProperties"; //$NON-NLS-1$
+ /**
+ * @since 8.5
+ */
+ public static final String OPTIONAL_BUILD_PROPERTIES = "optionalBuildProperties"; //$NON-NLS-1$
public static final String BUILD_ARTEFACT_TYPE = "buildArtefactType"; //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionalBuildObjectPropertiesContainer.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionalBuildObjectPropertiesContainer.java
new file mode 100644
index 0000000000..68cfa186bc
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionalBuildObjectPropertiesContainer.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Red Hat Inc 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:
+ * Red Hat Inc. - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.managedbuilder.core;
+
+import org.eclipse.cdt.managedbuilder.buildproperties.IOptionalBuildProperties;
+
+/**
+ * @since 8.5
+ */
+public interface IOptionalBuildObjectPropertiesContainer {
+ IOptionalBuildProperties getOptionalBuildProperties();
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IProjectType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IProjectType.java
index 1eea850c35..6d810e7110 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IProjectType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IProjectType.java
@@ -44,7 +44,7 @@ import org.eclipse.cdt.managedbuilder.macros.IProjectBuildMacroSupplier;
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
-public interface IProjectType extends IBuildObject, IBuildObjectPropertiesContainer {
+public interface IProjectType extends IBuildObject, IBuildObjectPropertiesContainer, IOptionalBuildObjectPropertiesContainer {
public static final String PROJECTTYPE_ELEMENT_NAME = "projectType"; //$NON-NLS-1$
public static final String SUPERCLASS = "superClass"; //$NON-NLS-1$
public static final String IS_ABSTRACT = "isAbstract"; //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java
index 4fe8091783..9f7c979b64 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java
@@ -18,11 +18,12 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -47,6 +48,8 @@ public class CommandBuilder implements IBuildModelBuilder {
private Process fProcess;
private String fErrMsg;
+ private IProject fProject;
+
protected class OutputStreamWrapper extends OutputStream {
private OutputStream fOut;
@@ -80,8 +83,9 @@ public class CommandBuilder implements IBuildModelBuilder {
}
- public CommandBuilder(IBuildCommand cmd, IResourceRebuildStateContainer cr){
+ public CommandBuilder(IBuildCommand cmd, IResourceRebuildStateContainer cr, IProject project){
fCmd = cmd;
+ fProject = project;
}
protected OutputStream wrap(OutputStream out){
@@ -143,7 +147,7 @@ public class CommandBuilder implements IBuildModelBuilder {
}
protected ICommandLauncher createLauncher() {
- return new CommandLauncher();
+ return CommandLauncherManager.getInstance().getCommandLauncher(fProject);
}
public String getErrMsg() {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/StepBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/StepBuilder.java
index 9773bec0aa..b40ae1ccc6 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/StepBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/StepBuilder.java
@@ -17,7 +17,9 @@ import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildDescription;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildResource;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildStep;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -223,8 +225,10 @@ public class StepBuilder implements IBuildModelBuilder {
fCommandBuilders = new CommandBuilder[0];
else {
fCommandBuilders = new CommandBuilder[cmds.length];
+ IConfiguration cfg = fStep.getBuildDescription().getConfiguration();
+ IProject project = (IProject)cfg.getOwner();
for(int i = 0; i < cmds.length; i++){
- fCommandBuilders[i] = new CommandBuilder(cmds[i], fRebuildStateContainer);
+ fCommandBuilders[i] = new CommandBuilder(cmds[i], fRebuildStateContainer, project);
}
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java
index 2b61d3e6ca..aa3427dce5 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java
@@ -25,7 +25,7 @@ import java.util.SortedMap;
import java.util.StringTokenizer;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ErrorParserManager;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.cdtvariables.CdtVariableException;
@@ -2858,7 +2858,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
return getSuperClass().getCommandLauncher();
else if(fCommandLauncher == null) // catch all for backwards compatibility
- fCommandLauncher = new CommandLauncher();
+ fCommandLauncher = CommandLauncherManager.getInstance().getCommandLauncher();
return fCommandLauncher;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
index bba687d816..03f14a6256 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
@@ -45,6 +45,7 @@ import org.eclipse.cdt.internal.core.SafeStringInterner;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyType;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
+import org.eclipse.cdt.managedbuilder.buildproperties.IOptionalBuildProperties;
import org.eclipse.cdt.managedbuilder.core.BuildException;
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
import org.eclipse.cdt.managedbuilder.core.IBuildObjectProperties;
@@ -114,6 +115,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
private String description;
private ICSourceEntry[] sourceEntries;
private BuildObjectProperties buildProperties;
+ private OptionalBuildProperties optionalBuildProperties;
private boolean isTest;
private SupportedProperties supportedProperties;
@@ -261,6 +263,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(props != null)
buildProperties = new BuildObjectProperties(props, this, this);
+ String optionalProps = SafeStringInterner.safeIntern(element.getAttribute(OPTIONAL_BUILD_PROPERTIES));
+ if(optionalProps != null)
+ optionalBuildProperties = new OptionalBuildProperties(optionalProps);
+
String artType = SafeStringInterner.safeIntern(element.getAttribute(BUILD_ARTEFACT_TYPE));
if(artType != null){
if(buildProperties == null)
@@ -482,6 +488,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(baseCfg.buildProperties != null)
this.buildProperties = new BuildObjectProperties(baseCfg.buildProperties, this, this);
+ if (baseCfg.optionalBuildProperties != null)
+ this.optionalBuildProperties = new OptionalBuildProperties(baseCfg.optionalBuildProperties);
+
// set managedBuildRevision
setManagedBuildRevision(baseCfg.getManagedBuildRevision());
@@ -625,6 +634,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(cloneConfig.buildProperties != null) {
this.buildProperties = new BuildObjectProperties(cloneConfig.buildProperties, this, this);
}
+
+ if (cloneConfig.optionalBuildProperties != null) {
+ this.optionalBuildProperties = new OptionalBuildProperties(cloneConfig.optionalBuildProperties);
+ }
this.description = cloneConfig.getDescription();
@@ -819,6 +832,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(props != null)
buildProperties = new BuildObjectProperties(props, this, this);
+ String optionalProps = element.getAttribute(OPTIONAL_BUILD_PROPERTIES);
+ if (optionalProps != null)
+ optionalBuildProperties = new OptionalBuildProperties(optionalProps);
+
String artType = SafeStringInterner.safeIntern(element.getAttribute(BUILD_ARTEFACT_TYPE));
if(artType != null){
if(buildProperties == null)
@@ -908,6 +925,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
+ if(optionalBuildProperties != null){
+ element.setAttribute(OPTIONAL_BUILD_PROPERTIES, optionalBuildProperties.toString());
+ }
+
if (parent != null)
element.setAttribute(IConfiguration.PARENT, parent.getId());
@@ -2398,6 +2419,18 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return buildProperties;
}
+ @Override
+ public IOptionalBuildProperties getOptionalBuildProperties() {
+ if (optionalBuildProperties == null){
+ OptionalBuildProperties parentProps = findOptionalBuildProperties();
+ if(parentProps != null)
+ optionalBuildProperties = new OptionalBuildProperties(parentProps);
+ else
+ optionalBuildProperties = new OptionalBuildProperties();
+ }
+ return optionalBuildProperties;
+ }
+
private BuildObjectProperties findBuildProperties(){
if(buildProperties == null){
if(parent != null){
@@ -2407,6 +2440,16 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
return buildProperties;
}
+
+ private OptionalBuildProperties findOptionalBuildProperties(){
+ if (optionalBuildProperties == null){
+ if (parent != null){
+ return ((Configuration)parent).findOptionalBuildProperties();
+ }
+ return null;
+ }
+ return optionalBuildProperties;
+ }
public boolean supportsType(IBuildPropertyType type) {
return supportsType(type.getId());
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java
index 22bbaa7cde..68d59d2f27 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java
@@ -24,6 +24,7 @@ import org.eclipse.cdt.core.settings.model.ICStorageElement;
import org.eclipse.cdt.internal.core.cdtvariables.StorableCdtVariables;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyType;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
+import org.eclipse.cdt.managedbuilder.buildproperties.IOptionalBuildProperties;
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
import org.eclipse.cdt.managedbuilder.core.IBuildObjectProperties;
import org.eclipse.cdt.managedbuilder.core.IBuildPropertiesRestriction;
@@ -57,6 +58,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
// private StorableEnvironment userDefinedEnvironment;
private BuildObjectProperties buildProperties;
+ private OptionalBuildProperties optionalBuildProperties;
/*
* C O N S T R U C T O R S
@@ -191,6 +193,10 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
String props = element.getAttribute(BUILD_PROPERTIES);
if(props != null && props.length() != 0)
buildProperties = new BuildObjectProperties(props, this, this);
+
+ String optionalProps = element.getAttribute(OPTIONAL_BUILD_PROPERTIES);
+ if (optionalProps != null && optionalProps.length() != 0)
+ optionalBuildProperties = new OptionalBuildProperties(optionalProps);
String artType = element.getAttribute(BUILD_ARTEFACT_TYPE);
if(artType != null){
@@ -576,6 +582,18 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
return buildProperties;
}
+ @Override
+ public IOptionalBuildProperties getOptionalBuildProperties() {
+ if(optionalBuildProperties == null){
+ OptionalBuildProperties parentProps = findOptionalBuildProperties();
+ if(parentProps != null)
+ optionalBuildProperties = new OptionalBuildProperties(parentProps);
+ else
+ optionalBuildProperties = new OptionalBuildProperties();
+ }
+ return optionalBuildProperties;
+ }
+
private BuildObjectProperties findBuildProperties(){
if(buildProperties == null){
if(projectType != null){
@@ -586,6 +604,16 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
return buildProperties;
}
+ private OptionalBuildProperties findOptionalBuildProperties(){
+ if(optionalBuildProperties == null){
+ if(projectType != null){
+ return ((ProjectType)projectType).findOptionalBuildProperties();
+ }
+ return null;
+ }
+ return optionalBuildProperties;
+ }
+
@Override
public void propertiesChanged() {
IConfiguration cfgs[] = getConfigurations();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java
index f3e9bda6d7..0a7b5a0e4b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java
@@ -22,6 +22,7 @@ import org.eclipse.cdt.core.settings.model.extension.CBuildData;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
+import org.eclipse.cdt.managedbuilder.buildproperties.IOptionalBuildProperties;
import org.eclipse.cdt.managedbuilder.core.BuildException;
import org.eclipse.cdt.managedbuilder.core.IBuildObjectProperties;
import org.eclipse.cdt.managedbuilder.core.IBuilder;
@@ -1204,6 +1205,14 @@ public class MultiConfiguration extends MultiItemsHolder implements
return curr().getBuildProperties();
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IBuildObjectPropertiesContainer#getOptionalBuildProperties()
+ */
+ @Override
+ public IOptionalBuildProperties getOptionalBuildProperties() {
+ return curr().getOptionalBuildProperties();
+ }
+
@Override
public boolean getParallelDef() {
for (IConfiguration cfg : fCfgs) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionalBuildProperties.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionalBuildProperties.java
new file mode 100644
index 0000000000..8ec750feba
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionalBuildProperties.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Red Hat Inc. 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
+ *
+ * Red Hat Inc. - initial contribution
+ *******************************************************************************/
+package org.eclipse.cdt.managedbuilder.internal.core;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.eclipse.cdt.internal.core.SafeStringInterner;
+import org.eclipse.cdt.managedbuilder.buildproperties.IOptionalBuildProperties;
+
+public class OptionalBuildProperties implements IOptionalBuildProperties {
+
+ public static final String PROPERTY_VALUE_SEPARATOR = "="; //$NON-NLS-1$
+ public static final String PROPERTIES_SEPARATOR = ","; //$NON-NLS-1$
+
+ private Map<String, String> fProperties = new HashMap<>();
+
+ public OptionalBuildProperties() {
+ }
+
+ public OptionalBuildProperties(String properties) {
+ StringTokenizer t = new StringTokenizer(properties, PROPERTIES_SEPARATOR);
+ while(t.hasMoreTokens()){
+ String property = t.nextToken();
+ int index = property.indexOf(PROPERTY_VALUE_SEPARATOR);
+ String id, value;
+ if(index != -1){
+ id = SafeStringInterner.safeIntern(property.substring(0, index));
+ value = SafeStringInterner.safeIntern(property.substring(index + 1));
+ } else {
+ id = SafeStringInterner.safeIntern(property);
+ value = null;
+ }
+ fProperties.put(id, value);
+ }
+ }
+
+ public OptionalBuildProperties(OptionalBuildProperties properties) {
+ fProperties.putAll(properties.fProperties);
+ }
+
+ @Override
+ public String getProperty(String id) {
+ return fProperties.get(id);
+ }
+
+ @Override
+ public void setProperty(String id, String value) {
+ fProperties.put(id, value);
+ }
+
+ @Override
+ public String[] getProperties(){
+ return fProperties.values().toArray(new String[fProperties.size()]);
+ }
+
+ @Override
+ public void removeProperty(String id) {
+ fProperties.remove(id);
+ }
+
+ @Override
+ public String toString(){
+ int size = fProperties.size();
+ Set<Entry<String,String>> entries = fProperties.entrySet();
+ if(size == 0)
+ return ""; //$NON-NLS-1$
+
+ StringBuilder buf = new StringBuilder();
+ Iterator<Entry<String,String>> iterator = entries.iterator();
+ Entry<String,String> entry = iterator.next();
+ buf.append(entry.getKey() + PROPERTY_VALUE_SEPARATOR + entry.getValue());
+
+ while (iterator.hasNext()) {
+ buf.append(PROPERTIES_SEPARATOR);
+ entry = iterator.next();
+ buf.append(entry.getKey() + PROPERTY_VALUE_SEPARATOR + entry.getValue());
+ }
+ return buf.toString();
+ }
+
+ @Override
+ public Object clone() {
+ return new OptionalBuildProperties(this);
+ }
+
+ @Override
+ public void clear() {
+ fProperties.clear();
+ }
+
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java
index 780b7f374e..c95d833b50 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java
@@ -22,6 +22,7 @@ import org.eclipse.cdt.internal.core.SafeStringInterner;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyType;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
+import org.eclipse.cdt.managedbuilder.buildproperties.IOptionalBuildProperties;
import org.eclipse.cdt.managedbuilder.core.IBuildObjectProperties;
import org.eclipse.cdt.managedbuilder.core.IBuildPropertiesRestriction;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
@@ -66,6 +67,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
private IProjectBuildMacroSupplier buildMacroSupplier = null;
BuildObjectProperties buildProperties;
+ OptionalBuildProperties optionalBuildProperties;
// Miscellaneous
@@ -708,6 +710,28 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
}
@Override
+ public IOptionalBuildProperties getOptionalBuildProperties() {
+ if(optionalBuildProperties == null){
+ OptionalBuildProperties parentProps = findOptionalBuildProperties();
+ if(parentProps != null)
+ optionalBuildProperties = new OptionalBuildProperties(parentProps);
+ else
+ optionalBuildProperties = new OptionalBuildProperties();
+ }
+ return optionalBuildProperties;
+ }
+
+ OptionalBuildProperties findOptionalBuildProperties(){
+ if(optionalBuildProperties == null){
+ if(superClass != null){
+ return ((ProjectType)superClass).findOptionalBuildProperties();
+ }
+ return null;
+ }
+ return optionalBuildProperties;
+ }
+
+ @Override
public void propertiesChanged() {
List<Configuration> list = getConfigurationList();
for(int i = 0; i < list.size(); i++){
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java
index d2a4b86ed7..1c63fd73c8 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java
@@ -12,11 +12,17 @@
package org.eclipse.cdt.managedbuilder.internal.language.settings.providers;
import java.net.URI;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import org.eclipse.cdt.core.EFSExtensionProvider;
import org.eclipse.cdt.internal.core.Cygwin;
+import org.eclipse.cdt.managedbuilder.buildproperties.IOptionalBuildProperties;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector;
+import org.eclipse.core.runtime.Platform;
/**
* Class to detect built-in compiler settings for Cygwin toolchain.
@@ -26,6 +32,7 @@ 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 String ENV_PATH = "PATH"; //$NON-NLS-1$
+ public static final String CONTAINER_ENABLEMENT_PROPERTY = "org.eclipse.cdt.docker.launcher.containerbuild.property.enablement"; //$NON-NLS-1$
/**
* EFSExtensionProvider for Cygwin translations
@@ -46,7 +53,14 @@ public class GCCBuiltinSpecsDetectorCygwin extends GCCBuiltinSpecsDetector {
String windowsPath = null;
try {
String cygwinPath = getPathFromURI(locationURI);
- windowsPath = Cygwin.cygwinToWindowsPath(cygwinPath, envPathValue);
+ IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(currentCfgDescription);
+ if (cfg != null) {
+ IOptionalBuildProperties bp = cfg.getOptionalBuildProperties();
+ String ep = bp.getProperty(CONTAINER_ENABLEMENT_PROPERTY);
+ if (ep == null || !Boolean.parseBoolean(ep)) {
+ windowsPath = Cygwin.cygwinToWindowsPath(cygwinPath, envPathValue);
+ }
+ }
} catch (Exception e) {
ManagedBuilderCorePlugin.log(e);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java
index 3ed6c14997..ca31fcc4d6 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java
@@ -26,7 +26,7 @@ import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ErrorParserManager;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.IConsoleParser;
@@ -542,6 +542,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
boolean isChanged = false;
List<String> languageIds = getLanguageScope();
+
if (languageIds != null) {
monitor.beginTask(ManagedMakeMessages.getResourceString("AbstractBuiltinSpecsDetector.ScannerDiscoveryTaskTitle"), //$NON-NLS-1$
TICKS_REMOVE_MARKERS + languageIds.size()*TICKS_RUN_FOR_ONE_LANGUAGE + TICKS_SERIALIZATION);
@@ -656,7 +657,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
}
console.start(currentProject);
- ICommandLauncher launcher = new CommandLauncher();
+ ICommandLauncher launcher = CommandLauncherManager.getInstance().getCommandLauncher(currentCfgDescription);
launcher.setProject(currentProject);
IPath program = new Path(""); //$NON-NLS-1$
@@ -765,7 +766,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
// so collect them to save later when output finishes
if (entries != null) {
for (ICLanguageSettingEntry entry : entries) {
- if (!detectedSettingEntries.contains(entry)) {
+ if (detectedSettingEntries != null && !detectedSettingEntries.contains(entry)) {
detectedSettingEntries.add(entry);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java
index 163e22a088..d07d225b8c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java
@@ -74,7 +74,7 @@ public class GCCBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector imple
@Override
protected List<String> parseOptions(String line) {
line = line.trim();
-
+
// contribution of -dD option
if (line.startsWith("#define")) {
return makeList(line);
diff --git a/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestConfiguration.java b/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestConfiguration.java
index 6bb61e8299..d3c139e359 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestConfiguration.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestConfiguration.java
@@ -14,6 +14,7 @@ import org.eclipse.cdt.core.settings.model.ICSourceEntry;
import org.eclipse.cdt.core.settings.model.extension.CBuildData;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
+import org.eclipse.cdt.managedbuilder.buildproperties.IOptionalBuildProperties;
import org.eclipse.cdt.managedbuilder.core.BuildException;
import org.eclipse.cdt.managedbuilder.core.IBuildObjectProperties;
import org.eclipse.cdt.managedbuilder.core.IBuilder;
@@ -632,6 +633,13 @@ public class TestConfiguration implements IConfiguration {
// TODO Auto-generated method stub
return null;
}
+
+ @Override
+ public IOptionalBuildProperties getOptionalBuildProperties() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
@Override
public IResource getOwner() { return null; }
diff --git a/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestProjectType.java b/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestProjectType.java
index d22f0878a6..0727d3bdc7 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestProjectType.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestProjectType.java
@@ -11,6 +11,7 @@
package org.eclipse.cdt.managedbuilder.ui.tests.util;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
+import org.eclipse.cdt.managedbuilder.buildproperties.IOptionalBuildProperties;
import org.eclipse.cdt.managedbuilder.core.IBuildObjectProperties;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IConfigurationNameProvider;
@@ -76,6 +77,8 @@ public class TestProjectType implements IProjectType {
public void setVersion(Version version) {}
@Override
public IBuildObjectProperties getBuildProperties() { return null; }
+ @Override
+ public IOptionalBuildProperties getOptionalBuildProperties() { return null; }
@Override
public IBuildPropertyValue getBuildArtefactType() {

Back to the top