parserList){
IScannerConfigBuilderInfo2 info = map.get(context);
InfoContext ic = context.toInfoContext();
boolean added = false;
- if (info != null &&
- info.isAutoDiscoveryEnabled() &&
- info.isBuildOutputParserEnabled()) {
+ if (info != null) {
+ boolean autodiscoveryEnabled2 = info.isAutoDiscoveryEnabled();
+ if (autodiscoveryEnabled2) {
+ IConfiguration cfg = context.getConfiguration();
+ ICConfigurationDescription cfgDescription = ManagedBuildManager.getDescriptionForConfiguration(cfg);
+ autodiscoveryEnabled2 = ScannerDiscoveryLegacySupport.isMbsLanguageSettingsProviderOn(cfgDescription);
+ }
+ if (autodiscoveryEnabled2 && info.isBuildOutputParserEnabled()) {
- String id = info.getSelectedProfileId();
- ScannerConfigProfile profile = ScannerConfigProfileManager.getInstance().getSCProfileConfiguration(id);
- if(profile.getBuildOutputProviderElement() != null){
- // get the make builder console parser
- SCProfileInstance profileInstance = ScannerConfigProfileManager.getInstance().
- getSCProfileInstance(project, ic, id);
+ String id = info.getSelectedProfileId();
+ ScannerConfigProfile profile = ScannerConfigProfileManager.getInstance().getSCProfileConfiguration(id);
+ if(profile.getBuildOutputProviderElement() != null){
+ // get the make builder console parser
+ SCProfileInstance profileInstance = ScannerConfigProfileManager.getInstance().
+ getSCProfileInstance(project, ic, id);
- IScannerInfoConsoleParser clParser = profileInstance.createBuildOutputParser();
- if (collector == null) {
- collector = profileInstance.getScannerInfoCollector();
- }
- if(clParser != null){
- clParser.startup(project, workingDirectory, collector,
- info.isProblemReportingEnabled() ? markerGenerator : null);
- parserList.add(clParser);
- added = true;
- }
+ IScannerInfoConsoleParser clParser = profileInstance.createBuildOutputParser();
+ if (collector == null) {
+ collector = profileInstance.getScannerInfoCollector();
+ }
+ if(clParser != null){
+ clParser.startup(project, workingDirectory, collector,
+ info.isProblemReportingEnabled() ? markerGenerator : null);
+ parserList.add(clParser);
+ added = true;
+ }
+ }
}
}
return added;
}
-
}
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 8b7f0499dce..8aba30dbfe9 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
@@ -24,14 +24,14 @@ import org.eclipse.core.runtime.IPath;
/**
* A tool-integrator defines default configurations as children of the project type.
- * These provide a template for the configurations added to the user's project,
- * which are stored in the project's .cproject file.
+ * These provide a template for the configurations added to the user's project,
+ * which are stored in the project's .cproject file.
*
- * The configuration contains one child of type tool-chain. This describes how the
+ * The configuration contains one child of type tool-chain. This describes how the
* project's resources are transformed into the build artifact. The configuration can
* contain one or more children of type resourceConfiguration. These describe build
* settings of individual resources that are different from the configuration as a whole.
- *
+ *
* @since 2.1
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
@@ -39,33 +39,35 @@ import org.eclipse.core.runtime.IPath;
public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesContainer {
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$
- public static final String POSTBUILD_STEP = "postbuildStep"; //$NON-NLS-1$
- public static final String PREANNOUNCEBUILD_STEP = "preannouncebuildStep"; //$NON-NLS-1$
- public static final String POSTANNOUNCEBUILD_STEP = "postannouncebuildStep"; //$NON-NLS-1$
+ public static final String PREBUILD_STEP = "prebuildStep"; //$NON-NLS-1$
+ public static final String POSTBUILD_STEP = "postbuildStep"; //$NON-NLS-1$
+ public static final String PREANNOUNCEBUILD_STEP = "preannouncebuildStep"; //$NON-NLS-1$
+ public static final String POSTANNOUNCEBUILD_STEP = "postannouncebuildStep"; //$NON-NLS-1$
// Schema element names
public static final String CONFIGURATION_ELEMENT_NAME = "configuration"; //$NON-NLS-1$
public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$
+ /** @since 8.1 */
+ public static final String LANGUAGE_SETTINGS_PROVIDERS = "languageSettingsProviders";
public static final String EXTENSION = "artifactExtension"; //$NON-NLS-1$
public static final String PARENT = "parent"; //$NON-NLS-1$
-
+
public static final String DESCRIPTION = "description"; //$NON-NLS-1$
-
+
public static final String BUILD_PROPERTIES = "buildProperties"; //$NON-NLS-1$
public static final String BUILD_ARTEFACT_TYPE = "buildArtefactType"; //$NON-NLS-1$
public static final String IS_SYSTEM = "isSystem"; //$NON-NLS-1$
public static final String SOURCE_ENTRIES = "sourceEntries"; //$NON-NLS-1$
-
-
+
+
/**
* Returns the description of the configuration.
- *
+ *
* @return String
*/
public String getDescription();
-
+
/**
* Sets the description of the receiver to the value specified in the argument
*/
@@ -84,204 +86,212 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
* @param name - The name for the new tool chain
* @param isExtensionElement - set {@code true} if the toolchain being created
* represents extension point toolchain
- *
+ *
* @return IToolChain
*/
public IToolChain createToolChain(IToolChain superClass, String Id, String name, boolean isExtensionElement);
-
+
/**
- * Returns the extension that should be applied to build artifacts created by
+ * Returns the extension that should be applied to build artifacts created by
* this configuration.
- *
+ *
* @return String
*/
- public String getArtifactExtension();
+ public String getArtifactExtension();
/**
* Returns the name of the final build artifact.
- *
+ *
* @return String
*/
public String getArtifactName();
/**
- * Returns the build arguments from this configuration's builder
- *
+ * Returns the build arguments from this configuration's builder
+ *
* @return String
*/
public String getBuildArguments();
/**
- * Returns the build command from this configuration's builder
- *
+ * Returns the build command from this configuration's builder
+ *
* @return String
*/
public String getBuildCommand();
-
+
/**
* Returns the prebuild step command
- *
- * @return String
- */
- public String getPrebuildStep();
-
- /**
- * Returns the postbuild step command
- *
- * @return String
- */
- public String getPostbuildStep();
-
- /**
- * Returns the display string associated with the prebuild step
- *
- * @return String
- */
- public String getPreannouncebuildStep();
-
- /**
- * Returns the display string associated with the postbuild step
- *
- * @return String
- */
- public String getPostannouncebuildStep();
-
- /**
+ *
+ * @return String
+ */
+ public String getPrebuildStep();
+
+ /**
+ * Returns the postbuild step command
+ *
+ * @return String
+ */
+ public String getPostbuildStep();
+
+ /**
+ * Returns the display string associated with the prebuild step
+ *
+ * @return String
+ */
+ public String getPreannouncebuildStep();
+
+ /**
+ * Returns the display string associated with the postbuild step
+ *
+ * @return String
+ */
+ public String getPostannouncebuildStep();
+
+ /**
* Answers the OS-specific command to remove files created by the build
* of this configuration.
- *
+ *
* @return String
*/
public String getCleanCommand();
/**
- * Answers the semicolon separated list of unique IDs of the error parsers associated
+ * Answers the semicolon separated list of unique IDs of the error parsers associated
* with this configuration.
- *
+ *
* @return String
*/
public String getErrorParserIds();
/**
- * Answers the ordered list of unique IDs of the error parsers associated
+ * Answers the ordered list of unique IDs of the error parsers associated
* with this configuration.
- *
+ *
* @return String[]
*/
public String[] getErrorParserList();
-
+
/**
- * Projects have C or CC natures. Tools can specify a filter so they are not
- * misapplied to a project. This method allows the caller to retrieve a list
- * of tools from a project that are correct for a project's nature.
- *
- * @return an array of ITools
that have compatible filters
+ * Returns default language settings providers IDs specified for the configuration.
+ * @return default language settings providers IDs.
+ *
+ * @since 8.1
+ */
+ public String[] getDefaultLanguageSettingsProvidersIds();
+
+ /**
+ * Projects have C or CC natures. Tools can specify a filter so they are not
+ * misapplied to a project. This method allows the caller to retrieve a list
+ * of tools from a project that are correct for a project's nature.
+ *
+ * @return an array of ITools
that have compatible filters
* for this configuration.
*/
ITool[] getFilteredTools();
-
+
/**
* Returns the managed-project parent of this configuration, if this is a
* project configuration. Otherwise, returns null
.
- *
+ *
* @return IManagedProject
*/
public IManagedProject getManagedProject();
-
+
/**
* Returns the Eclipse project that owns the configuration.
- *
+ *
* @return IResource
*/
public IResource getOwner();
-
+
/**
- * Returns the configuration that this configuration is based on.
- *
+ * Returns the configuration that this configuration is based on.
+ *
* @return IConfiguration
*/
public IConfiguration getParent();
-
+
/**
* Returns the project-type parent of this configuration, if this is an
* extension configuration. Otherwise, returns null
.
- *
+ *
* @return IProjectType
*/
public IProjectType getProjectType();
-
+
/**
* @param path - path of the resource
- *
+ *
* @return the resource configuration child of this configuration
* that is associated with the project resource, or null
if none.
*/
public IResourceConfiguration getResourceConfiguration(String path);
-
+
/**
* Returns the resource configuration children of this configuration.
- *
+ *
* @return IResourceConfigurations[]
*/
public IResourceConfiguration[] getResourceConfigurations();
-
+
/**
* Returns the ITool
in this configuration's tool-chain with
- * the same id as the argument, or null
.
- *
+ * the same id as the argument, or null
.
+ *
* @param id unique identifier to search for
* @return ITool
*/
public ITool getTool(String id);
/**
- * Returns the ITool
in this configuration's tool-chain with
- * the specified ID, or the tool(s) with a superclass with this id.
- *
- *
If the tool-chain does not have a tool with that ID, the method
- * returns an empty array. It is the responsibility of the caller to
- * verify the return value.
- *
+ * Returns the ITool
in this configuration's tool-chain with
+ * the specified ID, or the tool(s) with a superclass with this id.
+ *
+ *
If the tool-chain does not have a tool with that ID, the method
+ * returns an empty array. It is the responsibility of the caller to
+ * verify the return value.
+ *
* @param id unique identifier of the tool to search for
* @return ITool[]
* @since 3.0.2
*/
public ITool[] getToolsBySuperClassId(String id);
-
+
/**
* Returns the IToolChain
child of this configuration.
- *
+ *
* @return IToolChain
*/
public IToolChain getToolChain();
-
+
/**
* Returns the command-line invocation command for the specified tool.
- *
+ *
* @param tool The tool that will have its command retrieved.
* @return String The command
*/
public String getToolCommand(ITool tool);
-
+
/**
* Returns the tools that are used in this configuration's tool-chain.
- *
+ *
* @return ITool[]
*/
public ITool[] getTools();
/**
- * Returns the tool in this configuration specified with
+ * Returns the tool in this configuration specified with
* the toolChain#targetTool attribute that creates the build artifact
- *
- * NOTE: This method returns null in case the toolChain definition
+ *
+ * NOTE: This method returns null in case the toolChain definition
* does not have the targetTool attribute or if the attribute does not
* refer to the appropriate tool.
* For the target tool calculation the IConfiguration#calculateTargetTool()
* method should be used
- *
+ *
* @see IConfiguration#calculateTargetTool()
- *
+ *
* @return ITool
*/
public ITool getTargetTool();
@@ -289,42 +299,42 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
/**
* Returns true
if this configuration has overridden the default build
* build command in this configuration, otherwise false
.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean hasOverriddenBuildCommand();
-
+
/**
- * Returns true
if the extension matches one of the special
- * file extensions the tools for the configuration consider to be a header file.
- *
+ * Returns true
if the extension matches one of the special
+ * file extensions the tools for the configuration consider to be a header file.
+ *
* @param ext the file extension of the resource
* @return boolean
*/
public boolean isHeaderFile(String ext);
-
+
/**
- * Returns true
if this configuration has changes that need to
- * be saved in the project file, else false
.
+ * Returns true
if this configuration has changes that need to
+ * be saved in the project file, else false
.
* Should not be called for an extension configuration.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isDirty();
-
+
/**
* Returns true
if this configuration was loaded from a manifest file,
* and false
if it was loaded from a project (.cdtbuild) file.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isExtensionElement();
/**
- * Returns whether this configuration has been changed and requires the
+ * Returns whether this configuration has been changed and requires the
* project to be rebuilt.
- *
- * @return true
if the configuration contains a change
+ *
+ * @return true
if the configuration contains a change
* that needs the project to be rebuilt.
* Should not be called for an extension configuration.
*/
@@ -332,13 +342,13 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
/**
* Removes a resource configuration from the configuration's list.
- *
+ *
* @param resConfig - resource configuration to remove
*/
public void removeResourceConfiguration(IResourceInfo resConfig);
-
+
public void removeResourceInfo(IPath path);
-
+
/**
* Set (override) the extension that should be appended to the build artifact
* for the receiver.
@@ -352,7 +362,7 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
public void setArtifactName(String name);
/**
- * Sets the arguments to be passed to the build utility used by the
+ * Sets the arguments to be passed to the build utility used by the
* receiver to produce a build goal.
*/
public void setBuildArguments(String makeArgs);
@@ -363,26 +373,26 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
public void setBuildCommand(String command);
/**
- * Sets the prebuild step for the receiver to the value in the argument.
- */
- public void setPrebuildStep(String step);
-
- /**
- * Sets the postbuild step for the receiver to the value in the argument.
- */
- public void setPostbuildStep(String step);
-
- /**
- * Sets the prebuild step display string for the receiver to the value in the argument.
- */
- public void setPreannouncebuildStep(String announceStep);
-
- /**
- * Sets the postbuild step display string for the receiver to the value in the argument.
- */
- public void setPostannouncebuildStep(String announceStep);
-
- /**
+ * Sets the prebuild step for the receiver to the value in the argument.
+ */
+ public void setPrebuildStep(String step);
+
+ /**
+ * Sets the postbuild step for the receiver to the value in the argument.
+ */
+ public void setPostbuildStep(String step);
+
+ /**
+ * Sets the prebuild step display string for the receiver to the value in the argument.
+ */
+ public void setPreannouncebuildStep(String announceStep);
+
+ /**
+ * Sets the postbuild step display string for the receiver to the value in the argument.
+ */
+ public void setPostannouncebuildStep(String announceStep);
+
+ /**
* Sets the command used to clean the outputs of this configuration.
* @param command - the command to clean outputs
*/
@@ -404,46 +414,46 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
* Sets the name of the receiver to the value specified in the argument
*/
public void setName(String name);
-
+
/**
* Sets the value of a boolean option for this configuration.
- *
+ *
* @param parent The holder/parent of the option.
* @param option The option to change.
* @param value The value to apply to the option.
- *
+ *
* @return IOption The modified option. This can be the same option or a newly created option.
- *
+ *
* @since 3.0 - The type of parent has changed from ITool to IHoldsOptions.
* Code assuming ITool as type, will continue to work unchanged.
*/
- public IOption setOption(IHoldsOptions parent, IOption option, boolean value)
- throws BuildException;
+ public IOption setOption(IHoldsOptions parent, IOption option, boolean value)
+ throws BuildException;
/**
* Sets the value of a string option for this configuration.
- *
+ *
* @param parent The holder/parent of the option.
* @param option The option that will be effected by change.
* @param value The value to apply to the option.
- *
+ *
* @return IOption The modified option. This can be the same option or a newly created option.
- *
+ *
* @since 3.0 - The type of parent has changed from ITool to IHoldsOptions.
* Code assuming ITool as type, will continue to work unchanged.
*/
public IOption setOption(IHoldsOptions parent, IOption option, String value)
throws BuildException;
-
+
/**
* Sets the value of a list option for this configuration.
- *
+ *
* @param parent The holder/parent of the option.
* @param option The option to change.
* @param value The values to apply to the option.
- *
+ *
* @return IOption The modified option. This can be the same option or a newly created option.
- *
+ *
* @since 3.0 - The type of parent has changed from ITool to IHoldsOptions.
* Code assuming ITool as type, will continue to work unchanged.
*/
@@ -452,7 +462,7 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
/**
* Sets the rebuild state in this configuration.
- *
+ *
* @param rebuild true
will force a rebuild the next time the project builds
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setRebuildState(boolean)
*/
@@ -460,93 +470,93 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
/**
* Overrides the tool command for a tool defined in this configuration's tool-chain.
- *
+ *
* @param tool The tool that will have its command modified.
* @param command The command
*/
public void setToolCommand(ITool tool, String command);
-
+
/**
* Returns true
if the configuration's tool-chain is supported on the system
* otherwise returns false
- *
- * @return boolean
- */
+ *
+ * @return boolean
+ */
public boolean isSupported();
-
+
/**
* Returns the implementation of the IConfigurationEnvironmentVariableSupplier provided
* by the tool-integrator or null
if none.
- *
- * @return IConfigurationEnvironmentVariableSupplier
- */
+ *
+ * @return IConfigurationEnvironmentVariableSupplier
+ */
public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier();
-
+
/**
* Returns the tool-integrator provided implementation of the configuration build macro supplier
- * or null
if none.
- *
+ * or null
if none.
+ *
* @return IConfigurationBuildMacroSupplier
*/
public IConfigurationBuildMacroSupplier getBuildMacroSupplier();
-
+
/**
* answers true if the configuration is temporary, otherwise - false
* @return boolean
*/
public boolean isTemporary();
-
+
/**
* Returns whether this configuration requires a full rebuild
- *
+ *
* @return boolean
*/
public boolean needsFullRebuild();
/**
* Calculates the configuration target tool.
- *
+ *
* @return ITool or null if not found
- *
+ *
* @since 3.1
*/
public ITool calculateTargetTool();
-
+
/**
- * Returns a ITool
for the tool associated with the
+ * Returns a ITool
for the tool associated with the
* output extension.
- *
+ *
* @param extension the file extension of the output file
* @return ITool
- *
+ *
* @since 3.1
*/
public ITool getToolFromOutputExtension(String extension);
-
+
/**
- * Returns a ITool
for the tool associated with the
+ * Returns a ITool
for the tool associated with the
* input extension.
- *
+ *
* @param sourceExtension the file extension of the input file
* @return ITool
- *
+ *
* @since 3.1
*/
public ITool getToolFromInputExtension(String sourceExtension);
-
+
IResourceInfo getResourceInfo(IPath path, boolean exactPath);
-
+
IResourceInfo[] getResourceInfos();
-
+
IResourceInfo getResourceInfoById(String id);
-
- IFolderInfo getRootFolderInfo();
-
+
+ IFolderInfo getRootFolderInfo();
+
IFileInfo createFileInfo(IPath path);
IFileInfo createFileInfo(IPath path, String id, String name);
-
+
IFileInfo createFileInfo(IPath path, IFolderInfo base, ITool baseTool, String id, String name);
IFileInfo createFileInfo(IPath path, IFileInfo base, String id, String name);
@@ -554,49 +564,49 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
IFolderInfo createFolderInfo(IPath path);
IFolderInfo createFolderInfo(IPath path, String id, String name);
-
+
IFolderInfo createFolderInfo(IPath path, IFolderInfo base, String id, String name);
-
+
CConfigurationData getConfigurationData();
-
+
ICSourceEntry[] getSourceEntries();
void setSourceEntries(ICSourceEntry[] entries);
-
+
CBuildData getBuildData();
-
+
IBuilder getBuilder();
-
+
IBuilder getEditableBuilder();
-
+
String getOutputPrefix(String outputExtension);
-
+
boolean isSystemObject();
-
+
String getOutputExtension(String resourceExtension);
-
+
String getOutputFlag(String outputExt);
-
- IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
+
+ IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation, IPath outputLocation );
-
+
String[] getUserObjects(String extension);
-
+
String[] getLibs(String extension);
-
+
boolean buildsFileType(String srcExt);
-
+
boolean supportsBuild(boolean managed);
-
+
boolean isManagedBuildOn();
void setManagedBuildOn(boolean on) throws BuildException;
-
+
boolean isBuilderCompatible(IBuilder builder);
-
+
void changeBuilder(IBuilder newBuilder, String id, String name);
-
+
IBuildPropertyValue getBuildArtefactType();
-
+
void setBuildArtefactType(String id) throws BuildException;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolChain.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolChain.java
index 57cba447fca..2757a06b134 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolChain.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolChain.java
@@ -16,19 +16,19 @@ import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier;
/**
- * This interface represents a tool-integrator-defined, ordered set of tools
- * that transform the project's input into the project's outputs. A
- * tool-chain can be defined as part of a configuration, or as an
+ * This interface represents a tool-integrator-defined, ordered set of tools
+ * that transform the project's input into the project's outputs. A
+ * tool-chain can be defined as part of a configuration, or as an
* independent specification that is referenced in a separate configuration
* via the toolChain superclass attribute.
*
* The toolChain contains one or more children of type tool. These define
- * the tools used in the tool-chain. The toolChain contains one child of
+ * the tools used in the tool-chain. The toolChain contains one child of
* type targetPlatform. This defines the architecture/os combination where
- * the outputs of the project can be deployed. The toolChain contains one
+ * the outputs of the project can be deployed. The toolChain contains one
* child of type builder. This defines the "build" or "make" utility that
* is used to drive the transformation of the inputs into outputs.
- *
+ *
* @since 2.1
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
@@ -49,13 +49,16 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
public static final String IS_SYSTEM= "isSystem"; //$NON-NLS-1$
public static final String NON_INTERNAL_BUILDER_ID = "nonInternalBuilderId"; //$NON-NLS-1$
public static final String RESOURCE_TYPE_BASED_DISCOVERY = "resourceTypeBasedDiscovery"; //$NON-NLS-1$
-
+
// The attribute name for the scanner info collector
public static final String SCANNER_CONFIG_PROFILE_ID = "scannerConfigDiscoveryProfileId"; //$NON-NLS-1$
+ /** @since 8.1 */
+ public static final String LANGUAGE_SETTINGS_PROVIDERS = "languageSettingsProviders";
+
/**
* Returns the configuration that is the parent of this tool-chain.
- *
+ *
* @return IConfiguration
*/
public IConfiguration getParent();
@@ -67,14 +70,14 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
* @param Id The id for the new tool chain
* @param name The name for the new tool chain
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
- *
+ *
* @return ITargetPlatform
*/
public ITargetPlatform createTargetPlatform(ITargetPlatform superClass, String Id, String name, boolean isExtensionElement);
/**
* Returns the target-platform child of this tool-chain
- *
+ *
* @return ITargetPlatform
*/
public ITargetPlatform getTargetPlatform();
@@ -87,30 +90,30 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
/**
* Returns the 'versionsSupported' of this tool-chain
- *
+ *
* @return String
*/
public String getVersionsSupported();
/**
* Returns the 'convertToId' of this tool-chain
- *
+ *
* @return String
*/
public String getConvertToId();
-
+
/**
- * Sets the 'versionsSupported' attribute of the tool-chain.
+ * Sets the 'versionsSupported' attribute of the tool-chain.
*/
-
+
public void setVersionsSupported(String versionsSupported);
-
+
/**
- * Sets the 'convertToId' attribute of the tool-chain.
+ * Sets the 'convertToId' attribute of the tool-chain.
*/
public void setConvertToId(String convertToId);
-
+
/**
* Creates the Builder
child of this tool-chain.
*
@@ -118,7 +121,7 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
* @param Id The id for the new tool chain
* @param name The name for the new tool chain
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
- *
+ *
* @return IBuilder
*/
public IBuilder createBuilder(IBuilder superClass, String Id, String name, boolean isExtensionElement);
@@ -131,7 +134,7 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
/**
* Returns the builder child of this tool-chain.
- *
+ *
* @return IBuilder
*/
public IBuilder getBuilder();
@@ -143,35 +146,35 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
* @param Id The id for the new tool chain
* @param name The name for the new tool chain
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
- *
+ *
* @return ITool
*/
public ITool createTool(ITool superClass, String Id, String name, boolean isExtensionElement);
/**
* Returns an array of tool children of this tool-chain
- *
+ *
* @return ITool[]
*/
public ITool[] getTools();
/**
- * Returns the tool in this tool-chain with the ID specified in the argument,
- * or null
- *
+ * Returns the tool in this tool-chain with the ID specified in the argument,
+ * or null
+ *
* @param id The ID of the requested tool
* @return ITool
*/
public ITool getTool(String id);
/**
- * Returns the ITool
in the tool-chain with the specified
- * ID, or the tool(s) with a superclass with this id.
- *
- *
If the tool-chain does not have a tool with that ID, the method
- * returns an empty array. It is the responsibility of the caller to
- * verify the return value.
- *
+ * Returns the ITool
in the tool-chain with the specified
+ * ID, or the tool(s) with a superclass with this id.
+ *
+ *
If the tool-chain does not have a tool with that ID, the method
+ * returns an empty array. It is the responsibility of the caller to
+ * verify the return value.
+ *
* @param id unique identifier of the tool to search for
* @return ITool[]
* @since 3.0.2
@@ -181,55 +184,55 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
/**
* Returns the IToolChain
that is the superclass of this
* tool-chain, or null
if the attribute was not specified.
- *
+ *
* @return IToolChain
*/
public IToolChain getSuperClass();
-
+
/**
* Returns whether this element is abstract. Returns false
* if the attribute was not specified.
- * @return boolean
+ * @return boolean
*/
public boolean isAbstract();
/**
- * Sets the isAbstract attribute of the tool-chain.
+ * Sets the isAbstract attribute of the tool-chain.
*/
public void setIsAbstract(boolean b);
-
+
/**
* Returns a semi-colon delimited list of child Ids of the superclass'
* children that should not be automatically inherited by this element.
- * Returns an empty string if the attribute was not specified.
- * @return String
+ * Returns an empty string if the attribute was not specified.
+ * @return String
*/
public String getUnusedChildren();
-
+
/**
* Returns an array of operating systems the tool-chain outputs can run on.
- *
+ *
* @return String[]
*/
public String[] getOSList();
/**
* Sets the OS list.
- *
+ *
* @param OSs The list of OS names
*/
public void setOSList(String[] OSs);
-
+
/**
* Returns an array of architectures the tool-chain outputs can run on.
- *
+ *
* @return String[]
*/
public String[] getArchList();
-
+
/**
* Sets the architecture list.
- *
+ *
* @param archs The list of architecture names
*/
public void setArchList(String[] archs);
@@ -237,7 +240,7 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
/**
* Returns the semicolon separated list of unique IDs of the error parsers associated
* with the tool-chain.
- *
+ *
* @return String
*/
public String getErrorParserIds();
@@ -249,9 +252,9 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
public String getErrorParserIds(IConfiguration config);
/**
- * Returns the ordered list of unique IDs of the error parsers associated with the
+ * Returns the ordered list of unique IDs of the error parsers associated with the
* tool-chain.
- *
+ *
* @return String[]
*/
public String[] getErrorParserList();
@@ -262,8 +265,17 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
public void setErrorParserIds(String ids);
/**
- * Returns the scanner config discovery profile id or null
if none.
- *
+ * Returns the default language settings providers IDs.
+ *
+ * @return the default language settings providers IDs separated by semicolon or {@code null} if none.
+ *
+ * @since 8.1
+ */
+ public String getDefaultLanguageSettingsProvidersIds();
+
+ /**
+ * Returns the scanner config discovery profile id or null
if none.
+ *
* @return String
*/
public String getScannerConfigDiscoveryProfileId();
@@ -274,93 +286,93 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
public void setScannerConfigDiscoveryProfileId(String profileId);
/**
- * Returns the sem-colon separated list of Tool ids containing each
- * tool that can create the final build artifact (the end target of
- * the build). MBS will use the first ID in the list that matches
- * a Tool in the ToolChain. One reason for specifying a list, is
- * that different versions of a tool can be selected based upon the
+ * Returns the sem-colon separated list of Tool ids containing each
+ * tool that can create the final build artifact (the end target of
+ * the build). MBS will use the first ID in the list that matches
+ * a Tool in the ToolChain. One reason for specifying a list, is
+ * that different versions of a tool can be selected based upon the
* project nature (e.g. different tool definitions for a linker for C vs. C++).
- *
+ *
* @return String
*/
public String getTargetToolIds();
/**
- * Sets the sem-colon separated list of Tool ids containing each
- * tool that can create the final build artifact (the end target of
- * the build).
+ * Sets the sem-colon separated list of Tool ids containing each
+ * tool that can create the final build artifact (the end target of
+ * the build).
*/
public void setTargetToolIds(String targetToolIds);
/**
- * Returns the list of Tool ids containing each
- * tool that can create the final build artifact (the end target of
- * the build). MBS will use the first ID in the list that matches
- * a Tool in the ToolChain. One reason for specifying a list, is
- * that different versions of a tool can be selected based upon the
+ * Returns the list of Tool ids containing each
+ * tool that can create the final build artifact (the end target of
+ * the build). MBS will use the first ID in the list that matches
+ * a Tool in the ToolChain. One reason for specifying a list, is
+ * that different versions of a tool can be selected based upon the
* project nature (e.g. different tool definitions for a linker for C vs. C++).
- *
+ *
* @return String[]
*/
public String[] getTargetToolList();
-
+
/**
- * Returns the OutputTypes in this tool-chain, besides the primary
- * output of the targetTool, that are also considered to be build
- * artifacts.
- *
+ * Returns the OutputTypes in this tool-chain, besides the primary
+ * output of the targetTool, that are also considered to be build
+ * artifacts.
+ *
* @return IOutputType[]
*/
public IOutputType[] getSecondaryOutputs();
-
+
/**
- * Sets the semicolon separated list of OutputType identifiers in
+ * Sets the semicolon separated list of OutputType identifiers in
* this tool-chain, besides the primary output of the targetTool,
- * that are also considered to be build artifacts.
+ * that are also considered to be build artifacts.
*/
public void setSecondaryOutputs(String ids);
/**
- * Returns true
if this tool-chain has changes that need to
+ * Returns true
if this tool-chain has changes that need to
* be saved in the project file, else false
.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isDirty();
-
+
/**
* Sets the element's "dirty" (have I been modified?) flag.
*/
public void setDirty(boolean isDirty);
-
+
/**
* Returns true
if this tool-chain was loaded from a manifest file,
* and false
if it was loaded from a project (.cdtbuild) file.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isExtensionElement();
-
+
/**
* Returns true
if the tool-chain support is installed on the system
* otherwise returns false
- *
- * @return boolean
- */
+ *
+ * @return boolean
+ */
public boolean isSupported();
-
+
/**
* Returns the tool-integrator provided implementation of the configuration environment variable supplier
- * or null
if none.
- *
+ * or null
if none.
+ *
* @return IConfigurationEnvironmentVariableSupplier
*/
public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier();
-
+
/**
* Returns the tool-integrator provided implementation of the configuration build macro supplier
- * or null
if none.
- *
+ * or null
if none.
+ *
* @return IConfigurationBuildMacroSupplier
*/
public IConfigurationBuildMacroSupplier getBuildMacroSupplier();
@@ -370,16 +382,16 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
* or null, if no conversion is required
*/
public IOptionPathConverter getOptionPathConverter() ;
-
+
IFolderInfo getParentFolderInfo();
-
+
CTargetPlatformData getTargetPlatformData();
-
+
boolean supportsBuild(boolean managed);
-
+
boolean isSystemObject();
-
+
boolean matches(IToolChain tc);
-
+
String getUniqueRealName();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java
index f50ce9993aa..84c0d9c7d2b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java
@@ -13,14 +13,23 @@ package org.eclipse.cdt.managedbuilder.core;
import java.io.IOException;
import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
import org.eclipse.cdt.core.ConsoleOutputStream;
import org.eclipse.cdt.core.ErrorParserManager;
import org.eclipse.cdt.core.IMarkerGenerator;
+import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
+import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
import org.eclipse.cdt.core.model.ICModelMarker;
import org.eclipse.cdt.core.resources.IConsole;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.make.core.scannerconfig.AbstractBuildCommandParser;
import org.eclipse.cdt.managedbuilder.buildmodel.BuildDescriptionManager;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildDescription;
+import org.eclipse.cdt.managedbuilder.internal.buildmodel.BuildDescription;
import org.eclipse.cdt.managedbuilder.internal.buildmodel.BuildStateManager;
import org.eclipse.cdt.managedbuilder.internal.buildmodel.DescriptionBuilder;
import org.eclipse.cdt.managedbuilder.internal.buildmodel.IBuildModelBuilder;
@@ -35,12 +44,13 @@ import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
/**
* The build runner for the internal builder.
- *
+ *
* @author dschaefer
* @since 8.0
*/
@@ -61,6 +71,21 @@ public class InternalBuildRunner extends AbstractBuildRunner {
private static final String NOTHING_BUILT = "ManagedMakeBuilder.message.no.build"; //$NON-NLS-1$
private static final String BUILD_ERROR = "ManagedMakeBuilder.message.error"; //$NON-NLS-1$
+
+ // TODO: same function is present in CommandBuilder and BuildProcessManager
+ private String[] mapToStringArray(Map map){
+ if(map == null)
+ return null;
+
+ List list = new ArrayList();
+
+ for (Entry entry : map.entrySet()) {
+ list.add(entry.getKey() + '=' + entry.getValue());
+ }
+
+ return list.toArray(new String[list.size()]);
+ }
+
@Override
public boolean invokeBuild(int kind, IProject project, IConfiguration configuration,
IBuilder builder, IConsole console, IMarkerGenerator markerGenerator,
@@ -96,6 +121,16 @@ public class InternalBuildRunner extends AbstractBuildRunner {
// Get a build console for the project
StringBuffer buf = new StringBuffer();
+
+ IBuildDescription des = BuildDescriptionManager.createBuildDescription(configuration, cBS, delta, flags);
+
+ IPath workingDirectory = des.getDefaultBuildDirLocation();
+ String[] env = null;
+ if (des instanceof BuildDescription) {
+ Map envMap = ((BuildDescription)des).getEnvironment();
+ env = mapToStringArray(envMap);
+ }
+
consoleOutStream = console.getOutputStream();
String[] consoleHeader = new String[3];
if(buildIncrementaly)
@@ -119,11 +154,29 @@ public class InternalBuildRunner extends AbstractBuildRunner {
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
}
+
+ if (kind!=IncrementalProjectBuilder.CLEAN_BUILD) {
+ // TODO - AG - sanity check? elaborate
+ ICConfigurationDescription cfgDescription = ManagedBuildManager.getDescriptionForConfiguration(configuration);
+ if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
+ List providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ for (ILanguageSettingsProvider provider : providers) {
+ if (provider instanceof AbstractBuildCommandParser) {
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ String msg = ManagedMakeMessages.getFormattedString("BOP Language Settings Provider [{0}] is not supported by Internal Builder.", provider.getName());
+ buf.append("**** "+msg+" ****");
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ ManagedBuilderCorePlugin.error(msg);
+ }
+ }
+ }
+ }
+
consoleOutStream.write(buf.toString().getBytes());
consoleOutStream.flush();
- IBuildDescription des = BuildDescriptionManager.createBuildDescription(configuration, cBS, delta, flags);
-
DescriptionBuilder dBuilder = null;
if (!isParallel)
dBuilder = new DescriptionBuilder(des, buildIncrementaly, resumeOnErr, cBS);
@@ -192,6 +245,7 @@ public class InternalBuildRunner extends AbstractBuildRunner {
consoleOutStream.flush();
epmOutputStream.close();
epmOutputStream = null;
+
// Generate any error markers that the build has discovered
monitor.subTask(ManagedMakeMessages.getResourceString(MARKERS));
@@ -238,5 +292,4 @@ public class InternalBuildRunner extends AbstractBuildRunner {
}
return false;
}
-
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
index 7c3d89a5367..12ad3f2750a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
@@ -148,7 +148,6 @@ import org.w3c.dom.ProcessingInstruction;
* @noinstantiate This class is not intended to be instantiated by clients.
*/
public class ManagedBuildManager extends AbstractCExtension {
-
// private static final QualifiedName buildInfoProperty = new QualifiedName(ManagedBuilderCorePlugin.PLUGIN_ID, "managedBuildInfo"); //$NON-NLS-1$
private static final String ROOT_NODE_NAME = "ManagedProjectBuildInfo"; //$NON-NLS-1$
public static final String SETTINGS_FILE_NAME = ".cdtbuild"; //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java
index e1f9d58adae..df8e4642d52 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java
@@ -145,6 +145,7 @@ public class CommonBuilder extends ACBuilder {
private final IConfiguration fCfg;
private final IBuilder fBuilder;
private IConsole fConsole;
+
CfgBuildInfo(IBuilder builder, boolean isForegound){
this.fBuilder = builder;
this.fCfg = builder.getParent().getParent();
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 102a944c669..7c2bb2ef3e0 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2011 IBM Corporation and others.
+ * Copyright (c) 2003, 2012 IBM Corporation 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
@@ -26,6 +26,7 @@ import java.util.Vector;
import org.eclipse.cdt.build.core.scannerconfig.ICfgScannerConfigBuilderInfo2Set;
import org.eclipse.cdt.build.internal.core.scannerconfig.CfgDiscoveredPathManager.PathInfoCache;
+import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.ErrorParserManager;
import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
import org.eclipse.cdt.core.settings.model.CLibraryFileEntry;
@@ -86,16 +87,19 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.Version;
public class Configuration extends BuildObject implements IConfiguration, IBuildPropertiesRestriction, IBuildPropertyChangeListener, IRealBuildObjectAssociation {
-
+
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
private static final String EMPTY_CFG_ID = "org.eclipse.cdt.build.core.emptycfg"; //$NON-NLS-1$
-
+ private static final String LANGUAGE_SETTINGS_PROVIDER_DELIMITER = ";"; //$NON-NLS-1$
+
// Parent and children
private String parentId;
private IConfiguration parent;
@@ -105,10 +109,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
private String cleanCommand;
private String artifactExtension;
private String errorParserIds;
- private String prebuildStep;
- private String postbuildStep;
- private String preannouncebuildStep;
- private String postannouncebuildStep;
+ private String defaultLanguageSettingsProvidersAttribute;
+ private String[] defaultLanguageSettingsProvidersIds;
+ private String prebuildStep;
+ private String postbuildStep;
+ private String preannouncebuildStep;
+ private String postannouncebuildStep;
private String description;
private ICSourceEntry[] sourceEntries;
private BuildObjectProperties buildProperties;
@@ -135,10 +141,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
private ICfgScannerConfigBuilderInfo2Set cfgScannerInfo;
private boolean isPreferenceConfig;
private List excludeList;
-
+
//property name for holding the rebuild state
private static final String REBUILD_STATE = "rebuildState"; //$NON-NLS-1$
-
+
//The resource delta passed to the builder is not always up-to-date
//for the given configuration because between two builds of the same configuration
//any number of other configuration builds may occur
@@ -146,7 +152,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
//with the resource tree between the two configuration builds
//
//The trivial approach implemented currently is to hold
- //the general information of whether some resources were
+ //the general information of whether some resources were
//removed,changed,etc. and detect whether the rebuild is needed
//based upon this information
//
@@ -165,7 +171,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
//builder enabling/disabling as the Builder substitution functionality
//
// private static final String INTERNAL_BUILDER = "internalBuilder"; //$NON-NLS-1$
- //preference key that holds the Internal Builder enable state
+ //preference key that holds the Internal Builder enable state
// private static final String INTERNAL_BUILDER_ENABLED = "enabled"; //$NON-NLS-1$
//preference key that holds the internal builder mode
// private static final String INTERNAL_BUILDER_IGNORE_ERR = "ignoreErr"; //$NON-NLS-1$
@@ -191,35 +197,35 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/**
* Create an extension configuration from the project manifest file element.
- *
- * @param projectType The ProjectType
the configuration will be added to.
+ *
+ * @param projectType The ProjectType
the configuration will be added to.
* @param element The element from the manifest that contains the configuration information.
*/
public Configuration(ProjectType projectType, IManagedConfigElement element, String managedBuildRevision) {
this.projectType = projectType;
isExtensionConfig = true;
-
+
// setup for resolving
resolved = false;
-
+
setManagedBuildRevision(managedBuildRevision);
-
+
// Initialize from the XML attributes
loadFromManifest(element);
-
+
// Hook me up to the Managed Build Manager
ManagedBuildManager.addExtensionConfiguration(this);
-
+
// Hook me up to the ProjectType
if (projectType != null) {
projectType.addConfiguration(this);
}
-
+
IManagedConfigElement enablements[] = element.getChildren(OptionEnablementExpression.NAME);
if(enablements.length > 0)
booleanExpressionCalculator = new BooleanExpressionApplicabilityCalculator(enablements);
-
+
// Load the children
IManagedConfigElement[] configElements = element.getChildren();
List srcPathList = new ArrayList();
@@ -247,23 +253,23 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
sourceEntries = seList.toArray(new ICSourceEntry[seList.size()]);
}
}
-
+
sourceEntries = createSourceEntries(sourceEntries, srcPathList, excludeList);
-
+
excludeList = null;
-
+
if(rootFolderInfo == null)
createRootFolderInfo();
-
+
String props = SafeStringInterner.safeIntern(element.getAttribute(BUILD_PROPERTIES));
if(props != null)
buildProperties = new BuildObjectProperties(props, this, this);
-
+
String artType = SafeStringInterner.safeIntern(element.getAttribute(BUILD_ARTEFACT_TYPE));
if(artType != null){
if(buildProperties == null)
buildProperties = new BuildObjectProperties(this, this);
-
+
try {
buildProperties.setProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID, artType, true);
} catch (CoreException e) {
@@ -288,7 +294,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
setDirty(false);
}
-
+
private static ICSourceEntry[] createSourceEntries(ICSourceEntry[] curEntries, List pathList, List excludeList){
for(int i = 0; i < excludeList.size(); i++){
IPath path = excludeList.get(i);
@@ -297,12 +303,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
if(pathList.size() == 0)
pathList.add(Path.EMPTY);
-
+
if(pathList.size() == 1
&& pathList.get(0).equals(Path.EMPTY)
&& excludeList.size() == 0)
return curEntries;
-
+
int pathSize = pathList.size();
Map map = new LinkedHashMap();
@@ -311,19 +317,19 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
ICSourceEntry entry = map.get(path);
if(entry == null)
entry = new CSourceEntry(path, null, ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED);
-
+
entry = CDataUtil.addExcludePaths(entry, excludeList, true);
if(entry != null)
map.put(path, entry);
}
-
+
return map.values().toArray(new ICSourceEntry[map.size()]);
}
/**
* Create a new extension configuration based on one already defined.
- *
- * @param projectType The ProjectType
the configuration will be added to.
+ *
+ * @param projectType The ProjectType
the configuration will be added to.
* @param parentConfig The IConfiguration
that is the parent configuration of this configuration
* @param id A unique ID for the new configuration.
*/
@@ -331,25 +337,25 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
setId(id);
this.projectType = projectType;
isExtensionConfig = true;
-
+
// setup for resolving
resolved = false;
if (parentConfig != null) {
name = parentConfig.getName();
- // If this constructor is called to clone an existing
- // configuration, the parent of the parent should be stored.
+ // If this constructor is called to clone an existing
+ // configuration, the parent of the parent should be stored.
// As of 2.1, there is still one single level of inheritance to
// worry about
parent = parentConfig.getParent() == null ? parentConfig : parentConfig.getParent();
}
-
+
// Hook me up to the Managed Build Manager
ManagedBuildManager.addExtensionConfiguration(this);
-
+
// Hook me up to the ProjectType
if (projectType != null) {
- projectType.addConfiguration(this);
+ projectType.addConfiguration(this);
// set managedBuildRevision
setManagedBuildRevision(projectType.getManagedBuildRevision());
}
@@ -357,8 +363,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/**
* Create a new extension configuration and fill in the attributes and childen later.
- *
- * @param projectType The ProjectType
the configuration will be added to.
+ *
+ * @param projectType The ProjectType
the configuration will be added to.
* @param parentConfig The IConfiguration
that is the parent configuration of this configuration
* @param id A unique ID for the new configuration.
* @param name A name for the new configuration.
@@ -369,10 +375,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
this.projectType = projectType;
parent = parentConfig;
isExtensionConfig = true;
-
+
// Hook me up to the Managed Build Manager
ManagedBuildManager.addExtensionConfiguration(this);
-
+
// Hook me up to the ProjectType
if (projectType != null) {
projectType.addConfiguration(this);
@@ -381,21 +387,21 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
/**
- * Create a Configuration
based on the specification stored in the
+ * Create a Configuration
based on the specification stored in the
* project file (.cdtbuild).
- *
- * @param managedProject The ManagedProject
the configuration will be added to.
+ *
+ * @param managedProject The ManagedProject
the configuration will be added to.
* @param element The XML element that contains the configuration settings.
- *
+ *
*/
public Configuration(ManagedProject managedProject, ICStorageElement element, String managedBuildRevision, boolean isPreference) {
this.managedProject = managedProject;
this.isPreferenceConfig = isPreference;
isExtensionConfig = false;
fCfgData = new BuildConfigurationData(this);
-
+
setManagedBuildRevision(managedBuildRevision);
-
+
// Initialize from the XML attributes
loadFromProject(element);
@@ -427,18 +433,18 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
sourceEntries = seList.toArray(new ICSourceEntry[seList.size()]);
}
}
-
+
resolveProjectReferences(true);
-
+
sourceEntries = createSourceEntries(sourceEntries, srcPathList, excludeList);
excludeList = null;
-
+
PropertyManager mngr = PropertyManager.getInstance();
String rebuild = mngr.getProperty(this, REBUILD_STATE);
if(rebuild == null || Boolean.valueOf(rebuild).booleanValue())
rebuildNeeded = true;
-
+
String rcChangeState = mngr.getProperty(this, RC_CHANGE_STATE);
if(rcChangeState == null)
resourceChangeState = ~0;
@@ -449,11 +455,11 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
resourceChangeState = ~0;
}
}
-
+
setDirty(false);
-
+
// Preferences prefs = getPreferences(INTERNAL_BUILDER);
-//
+//
// internalBuilderEnabled = prefs != null ?
// prefs.getBoolean(INTERNAL_BUILDER_ENABLED, false) : false;
// internalBuilderIgnoreErr = prefs != null ?
@@ -463,7 +469,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public Configuration(ManagedProject managedProject, ToolChain tCh, String id, String name) {
setId(id);
setName(name);
-
+
// this.description = cloneConfig.getDescription();
this.managedProject = managedProject;
isExtensionConfig = false;
@@ -479,38 +485,38 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
fCfgData = new BuildConfigurationData(this);
if(baseCfg.buildProperties != null)
this.buildProperties = new BuildObjectProperties(baseCfg.buildProperties, this, this);
-
+
// set managedBuildRevision
setManagedBuildRevision(baseCfg.getManagedBuildRevision());
-
+
// if(!baseCfg.isExtensionConfig)
// cloneChildren = true;
- // If this constructor is called to clone an existing
- // configuration, the parent of the cloning config should be stored.
+ // If this constructor is called to clone an existing
+ // configuration, the parent of the cloning config should be stored.
parent = baseCfg.isExtensionConfig || baseCfg.getParent() == null ? baseCfg : baseCfg.getParent();
-
+
// Copy the remaining attributes
projectType = baseCfg.projectType;
-
+
artifactName = baseCfg.artifactName;
-
+
cleanCommand = baseCfg.cleanCommand;
-
+
artifactExtension = baseCfg.artifactExtension;
-
+
errorParserIds = baseCfg.errorParserIds;
-
+
prebuildStep = baseCfg.prebuildStep;
-
+
postbuildStep = baseCfg.postbuildStep;
-
+
preannouncebuildStep = baseCfg.preannouncebuildStep;
-
+
postannouncebuildStep = baseCfg.postannouncebuildStep;
-
+
if(baseCfg.sourceEntries != null)
sourceEntries = baseCfg.sourceEntries.clone();
-
+
// enableInternalBuilder(baseCfg.isInternalBuilderEnabled());
// setInternalBuilderIgnoreErr(baseCfg.getInternalBuilderIgnoreErr());
// setInternalBuilderParallel(baseCfg.getInternalBuilderParallel());
@@ -518,23 +524,23 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// setParallelNumber(baseCfg.getParallelNumber());
// internalBuilderEnabled = cloneConfig.internalBuilderEnabled;
// internalBuilderIgnoreErr = cloneConfig.internalBuilderIgnoreErr;
-
+
// Clone the configuration's children
// Tool Chain
-
+
String tcId = ManagedBuildManager.calculateChildId(tCh.getId(), null);
-
+
IToolChain newChain = createToolChain(tCh, tcId, tCh.getId(), false);
-
+
// For each option/option category child of the tool-chain that is
// the child of the selected configuration element, create an option/
// option category child of the cloned configuration's tool-chain element
// that specifies the original tool element as its superClass.
newChain.createOptions(tCh);
- // For each tool element child of the tool-chain that is the child of
- // the selected configuration element, create a tool element child of
- // the cloned configuration's tool-chain element that specifies the
+ // For each tool element child of the tool-chain that is the child of
+ // the selected configuration element, create a tool element child of
+ // the cloned configuration's tool-chain element that specifies the
// original tool element as its superClass.
String subId;
ITool[] tools = tCh.getTools();
@@ -543,11 +549,11 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
subId = ManagedBuildManager.calculateChildId(toolChild.getId(),null);
newChain.createTool(toolChild, subId, toolChild.getName(), false);
}
-
+
ITargetPlatform tpBase = tCh.getTargetPlatform();
ITargetPlatform extTp = tpBase;
for(;extTp != null && !extTp.isExtensionElement();extTp = extTp.getSuperClass()) {}
-
+
TargetPlatform tp;
if(extTp != null){
int nnn = ManagedBuildManager.getRandomNumber();
@@ -562,36 +568,36 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
((ToolChain)newChain).setTargetPlatform(tp);
-
+
// if(cloneChildren){
//copy expand build macros setting
// BuildMacroProvider macroProvider = (BuildMacroProvider)ManagedBuildManager.getBuildMacroProvider();
// macroProvider.expandMacrosInBuildfile(this,
// macroProvider.areMacrosExpandedInBuildfile(baseCfg));
-
+
//copy user-defined build macros
/* UserDefinedMacroSupplier userMacros = BuildMacroProvider.fUserDefinedMacroSupplier;
userMacros.setMacros(
userMacros.getMacros(BuildMacroProvider.CONTEXT_CONFIGURATION,cloneConfig),
BuildMacroProvider.CONTEXT_CONFIGURATION,
this);
- */
+ */
//copy user-defined environment
// UserDefinedEnvironmentSupplier userEnv = EnvironmentVariableProvider.fUserSupplier;
// userEnv.setVariables(
// userEnv.getVariables(cloneConfig), this);
-
+
// }
-
+
// Hook me up
managedProject.addConfiguration(this);
-
+
IBuilder builder = getEditableBuilder();
try {
builder.setManagedBuildOn(false);
} catch (CoreException e) {
}
-
+
propertiesChanged();
}
setDirty(true);
@@ -601,14 +607,14 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public Configuration(ManagedProject managedProject, Configuration cloneConfig, String id, boolean cloneChildren, boolean temporary) {
this(managedProject, cloneConfig, id, cloneChildren, temporary, false);
}
-
+
/**
* Create a new project, non-extension, configuration based on one already defined.
- *
- * @param managedProject The ManagedProject
the configuration will be added to.
+ *
+ * @param managedProject The ManagedProject
the configuration will be added to.
* @param cloneConfig The IConfiguration
to copy the settings from.
* @param id A unique ID for the new configuration.
- * @param cloneChildren If true
, the configuration's tools are cloned
+ * @param cloneChildren If true
, the configuration's tools are cloned
*/
public Configuration(ManagedProject managedProject, Configuration cloneConfig, String id, boolean cloneChildren, boolean temporary, boolean isPreferenceConfig) {
setId(id);
@@ -617,10 +623,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
this.managedProject = managedProject;
isExtensionConfig = false;
this.isTemporary = temporary;
-
+
copySettingsFrom(cloneConfig, cloneChildren);
}
-
+
private void copySettingsFrom(Configuration cloneConfig, boolean cloneChildren){
fCfgData = new BuildConfigurationData(this);
if(cloneConfig.buildProperties != null)
@@ -633,11 +639,11 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(!cloneConfig.isExtensionConfig)
cloneChildren = true;
- // If this constructor is called to clone an existing
- // configuration, the parent of the cloning config should be stored.
+ // If this constructor is called to clone an existing
+ // configuration, the parent of the cloning config should be stored.
parent = cloneConfig.isExtensionConfig || cloneConfig.getParent() == null ? cloneConfig : cloneConfig.getParent();
parentId = parent.getId();
-
+
// Copy the remaining attributes
projectType = cloneConfig.projectType;
if (cloneConfig.artifactName != null) {
@@ -663,10 +669,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
if (cloneConfig.postannouncebuildStep != null) {
postannouncebuildStep = new String(cloneConfig.postannouncebuildStep);
- }
+ }
if(cloneConfig.sourceEntries != null)
sourceEntries = cloneConfig.sourceEntries.clone();
-
+
// enableInternalBuilder(cloneConfig.isInternalBuilderEnabled());
// setInternalBuilderIgnoreErr(cloneConfig.getInternalBuilderIgnoreErr());
// setInternalBuilderParallel(cloneConfig.getInternalBuilderParallel());
@@ -674,7 +680,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// setParallelNumber(cloneConfig.getParallelNumber());
// internalBuilderEnabled = cloneConfig.internalBuilderEnabled;
// internalBuilderIgnoreErr = cloneConfig.internalBuilderIgnoreErr;
-
+
// Clone the configuration's children
// Tool Chain
boolean copyIds = cloneConfig.getId().equals(id);
@@ -693,12 +699,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
subId = copyIds ? fileInfo.getId() : ManagedBuildManager.calculateChildId(getId(), fileInfo.getPath().toString());
ResourceConfiguration newResConfig = new ResourceConfiguration(this, fileInfo, subId, toolIdMap, cloneChildren);
addResourceConfiguration(newResConfig);
-
+
}
}
-
+
resolveProjectReferences(false);
-
+
if(cloneChildren){
//copy expand build macros setting
BuildMacroProvider macroProvider = (BuildMacroProvider)ManagedBuildManager.getBuildMacroProvider();
@@ -711,23 +717,23 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
userMacros.getMacros(BuildMacroProvider.CONTEXT_CONFIGURATION,cloneConfig),
BuildMacroProvider.CONTEXT_CONFIGURATION,
this);
-*/
+*/
//copy user-defined environment
// UserDefinedEnvironmentSupplier userEnv = EnvironmentVariableProvider.fUserSupplier;
// userEnv.setVariables(
// userEnv.getVariables(cloneConfig), this);
}
-
+
// Hook me up
if(managedProject != null){
managedProject.addConfiguration(this);
}
-
+
if(cloneConfig.isExtensionConfig){
propertiesChanged();
}
-
+
if(copyIds){
rebuildNeeded = cloneConfig.rebuildNeeded;
resourceChangeState = cloneConfig.resourceChangeState;
@@ -740,7 +746,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
-
+
public void applyToManagedProject(ManagedProject mProj){
managedProject = mProj;
isPreferenceConfig = false;
@@ -751,28 +757,28 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/*
* E L E M E N T A T T R I B U T E R E A D E R S A N D W R I T E R S
*/
-
+
/**
- * Initialize the configuration information from an element in the
+ * Initialize the configuration information from an element in the
* manifest file or provided by a dynamicElementProvider
- *
- * @param element An obejct implementing IManagedConfigElement
+ *
+ * @param element An obejct implementing IManagedConfigElement
*/
protected void loadFromManifest(IManagedConfigElement element) {
ManagedBuildManager.putConfigElement(this, element);
-
+
// id
setId(SafeStringInterner.safeIntern(element.getAttribute(IConfiguration.ID)));
// name
name = SafeStringInterner.safeIntern(element.getAttribute(IConfiguration.NAME));
-
+
// description
description = SafeStringInterner.safeIntern(element.getAttribute(IConfiguration.DESCRIPTION));
-
+
// parent
parentId = SafeStringInterner.safeIntern(element.getAttribute(IConfiguration.PARENT));
-
+
// if (parentID != null) {
// // Lookup the parent configuration by ID
// parent = ManagedBuildManager.getExtensionConfiguration(parentID);
@@ -780,37 +786,40 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// Get the name of the build artifact associated with configuration
artifactName = SafeStringInterner.safeIntern(element.getAttribute(ARTIFACT_NAME));
-
+
// Get the semicolon separated list of IDs of the error parsers
errorParserIds = SafeStringInterner.safeIntern(element.getAttribute(ERROR_PARSERS));
+ // Get the initial/default language setttings providers IDs
+ defaultLanguageSettingsProvidersAttribute = SafeStringInterner.safeIntern(element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS));
+
// Get the artifact extension
artifactExtension = SafeStringInterner.safeIntern(element.getAttribute(EXTENSION));
-
+
// Get the clean command
cleanCommand = SafeStringInterner.safeIntern(element.getAttribute(CLEAN_COMMAND));
-
- // Get the pre-build and post-build commands
- prebuildStep = SafeStringInterner.safeIntern(element.getAttribute(PREBUILD_STEP));
- postbuildStep = SafeStringInterner.safeIntern(element.getAttribute(POSTBUILD_STEP));
-
- // Get the pre-build and post-build announcements
- preannouncebuildStep = SafeStringInterner.safeIntern(element.getAttribute(PREANNOUNCEBUILD_STEP));
+
+ // Get the pre-build and post-build commands
+ prebuildStep = SafeStringInterner.safeIntern(element.getAttribute(PREBUILD_STEP));
+ postbuildStep = SafeStringInterner.safeIntern(element.getAttribute(POSTBUILD_STEP));
+
+ // Get the pre-build and post-build announcements
+ preannouncebuildStep = SafeStringInterner.safeIntern(element.getAttribute(PREANNOUNCEBUILD_STEP));
postannouncebuildStep = SafeStringInterner.safeIntern(element.getAttribute(POSTANNOUNCEBUILD_STEP));
-
+
String tmp = element.getAttribute(IS_SYSTEM);
if(tmp != null)
isTest = Boolean.valueOf(tmp).booleanValue();
}
-
+
/**
- * Initialize the configuration information from the XML element
+ * Initialize the configuration information from the XML element
* specified in the argument
- *
- * @param element An XML element containing the configuration information
+ *
+ * @param element An XML element containing the configuration information
*/
protected void loadFromProject(ICStorageElement element) {
-
+
// id
// note: IDs are unique so no benefit to intern them
setId(element.getAttribute(IConfiguration.ID));
@@ -818,20 +827,20 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// name
if (element.getAttribute(IConfiguration.NAME) != null)
setName(SafeStringInterner.safeIntern(element.getAttribute(IConfiguration.NAME)));
-
+
// description
if (element.getAttribute(IConfiguration.DESCRIPTION) != null)
description = SafeStringInterner.safeIntern(element.getAttribute(IConfiguration.DESCRIPTION));
-
+
String props = element.getAttribute(BUILD_PROPERTIES);
if(props != null)
buildProperties = new BuildObjectProperties(props, this, this);
-
+
String artType = SafeStringInterner.safeIntern(element.getAttribute(BUILD_ARTEFACT_TYPE));
if(artType != null){
if(buildProperties == null)
buildProperties = new BuildObjectProperties(this, this);
-
+
try {
buildProperties.setProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID, artType, true);
} catch (CoreException e) {
@@ -854,12 +863,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
- // Get the name of the build artifact associated with target (usually
+ // Get the name of the build artifact associated with target (usually
// in the plugin specification).
if (element.getAttribute(ARTIFACT_NAME) != null) {
artifactName = SafeStringInterner.safeIntern(element.getAttribute(ARTIFACT_NAME));
}
-
+
// Get the semicolon separated list of IDs of the error parsers
if (element.getAttribute(ERROR_PARSERS) != null) {
errorParserIds = SafeStringInterner.safeIntern(element.getAttribute(ERROR_PARSERS));
@@ -869,7 +878,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if (element.getAttribute(EXTENSION) != null) {
artifactExtension = SafeStringInterner.safeIntern(element.getAttribute(EXTENSION));
}
-
+
// Get the clean command
if (element.getAttribute(CLEAN_COMMAND) != null) {
cleanCommand = SafeStringInterner.safeIntern(element.getAttribute(CLEAN_COMMAND));
@@ -899,13 +908,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
*/
public void serialize(ICStorageElement element) {
element.setAttribute(IConfiguration.ID, id);
-
+
if (name != null)
element.setAttribute(IConfiguration.NAME, name);
-
+
if (description != null)
element.setAttribute(IConfiguration.DESCRIPTION, description);
-
+
if(buildProperties != null){
element.setAttribute(BUILD_PROPERTIES, buildProperties.toString());
@@ -915,13 +924,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
element.setAttribute(BUILD_ARTEFACT_TYPE, val.getId());
}
}
-
+
if (parent != null)
element.setAttribute(IConfiguration.PARENT, parent.getId());
-
+
if (artifactName != null)
element.setAttribute(ARTIFACT_NAME, artifactName);
-
+
if (errorParserIds != null)
element.setAttribute(ERROR_PARSERS, errorParserIds);
@@ -948,13 +957,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
for(int i = 0; i < infos.length; i++){
String elementName = infos[i].getKind() == ICSettingBase.SETTING_FILE ? IFileInfo.FILE_INFO_ELEMENT_NAME :
IFolderInfo.FOLDER_INFO_ELEMENT_NAME;
-
+
ICStorageElement resElement = element.createChild(elementName);
((ResourceInfo)infos[i]).serialize(resElement);
}
PropertyManager.getInstance().serialize(this);
-
+
if(sourceEntries != null && sourceEntries.length > 0){
ICStorageElement el = element.createChild(SOURCE_ENTRIES);
LanguageSettingEntriesSerializer.serializeEntries(sourceEntries, el);
@@ -966,7 +975,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/*
* P A R E N T A N D C H I L D H A N D L I N G
*/
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getParent()
*/
@@ -986,7 +995,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return null; // Extension configurations don't have an "owner"
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getProjectType()
*/
@@ -994,7 +1003,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public IProjectType getProjectType() {
return projectType;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getManagedProject()
*/
@@ -1002,7 +1011,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public IManagedProject getManagedProject() {
return managedProject;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getToolChain(IToolChain, String, String, boolean)
*/
@@ -1011,25 +1020,25 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(rootFolderInfo == null){
createRootFolderInfo();
}
-
+
return rootFolderInfo.createToolChain(superClass, Id, name, isExtensionElement);
}
-
+
private IFolderInfo createRootFolderInfo(){
String id = ManagedBuildManager.calculateChildId(this.id, null);
String name = "/"; //$NON-NLS-1$
-
+
rootFolderInfo = new FolderInfo(this, new Path(name), id, name, isExtensionConfig);
addResourceConfiguration(rootFolderInfo);
return rootFolderInfo;
}
-/*
+/*
public IFolderInfo createFolderInfo(IPath path, IToolChain superClass, String Id, String name){
-
+
}
public IFolderInfo createFolderInfo(IPath path, IFolderInfo baseFolderInfo, String Id, String name){
-
+
}
*/
/* (non-Javadoc)
@@ -1039,7 +1048,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public IToolChain getToolChain() {
return rootFolderInfo.getToolChain();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getResourceConfigurations()
*/
@@ -1081,7 +1090,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
/* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolsBySuperClassId(java.lang.String)
+ * @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolsBySuperClassId(java.lang.String)
*/
@Override
public ITool[] getToolsBySuperClassId(String id) {
@@ -1095,7 +1104,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public ITool getTargetTool() {
String[] targetToolIds = rootFolderInfo.getToolChain().getTargetToolList();
if (targetToolIds == null || targetToolIds.length == 0) return null;
-
+
// For each target tool id, in list order,
// look for a tool with this ID, or a tool with a superclass with this id.
// Stop when we find a match
@@ -1108,7 +1117,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
do {
if (targetToolId.equals(tool.getId())) {
return targetTool;
- }
+ }
tool = tool.getSuperClass();
} while (tool != null);
}
@@ -1157,10 +1166,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public IOption setOption(IHoldsOptions holder, IOption option, String[] value) throws BuildException {
return getRootFolderInfo().setOption(holder, option, value);
}
-
+
/* (non-Javadoc)
* Adds the Resource Configuration to the Resource Configuration list and map
- *
+ *
* @param resConfig
*/
void addResourceConfiguration(IResourceInfo resConfig) {
@@ -1173,7 +1182,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public void removeResourceConfiguration(IResourceInfo resConfig) {
- ManagedBuildManager.performValueHandlerEvent(resConfig,
+ ManagedBuildManager.performValueHandlerEvent(resConfig,
IManagedOptionValueHandler.EVENT_CLOSE);
ITool tools[] = resConfig.getTools();
rcInfos.removeResourceInfo(resConfig.getPath());
@@ -1208,9 +1217,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// Ask my parent first
if (parent != null) {
return parent.getArtifactExtension();
- }
- return null;
- }
+ }
+ return null;
+ }
return artifactExtension;
}
@@ -1253,14 +1262,14 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
IToolChain tc = getToolChain();
IBuilder builder = tc.getBuilder();
if (builder != null) {
- return builder.getCommand();
+ return builder.getCommand();
}
return new String("make"); //$NON-NLS-1$
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPrebuildStep()
*/
@Override
@@ -1280,7 +1289,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPostbuildStep()
*/
@Override
@@ -1300,7 +1309,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPreannouncebuildStep()
*/
@Override
@@ -1320,7 +1329,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPostannouncebuildStep()
*/
@Override
@@ -1340,7 +1349,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getCleanCommand()
*/
@Override
@@ -1362,7 +1371,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return cleanCommand;
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getDescription()
*/
@@ -1383,14 +1392,14 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getErrorParserIds()
*/
@Override
public String getErrorParserIds() {
if (errorParserIds != null) {
return errorParserIds;
- }
+ }
// If I have a parent, ask it
String errorParsers = null;
if (parent != null) {
@@ -1409,13 +1418,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public String getErrorParserIdsAttribute() {
if (errorParserIds != null) {
return errorParserIds;
- }
+ }
// If I have a parent, ask it
String errorParsers = null;
if (parent != null) {
errorParsers = ((Configuration)parent).getErrorParserIdsAttribute();
}
-
+
return errorParsers;
}
@@ -1445,7 +1454,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
}
-
+
if(includeChildren){
IResourceInfo[] rcInfos = getResourceInfos();
for(int i = 0; i < rcInfos.length; i++){
@@ -1455,7 +1464,56 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
return set;
}
-
+
+ private String getDefaultLanguageSettingsProvidersAttribute() {
+ if (defaultLanguageSettingsProvidersAttribute == null && parent instanceof Configuration) {
+ defaultLanguageSettingsProvidersAttribute = ((Configuration) parent).getDefaultLanguageSettingsProvidersAttribute();
+ }
+
+ return defaultLanguageSettingsProvidersAttribute;
+ }
+
+ @Override
+ public String[] getDefaultLanguageSettingsProvidersIds() {
+ defaultLanguageSettingsProvidersIds = null;
+ if (defaultLanguageSettingsProvidersIds == null) {
+ getDefaultLanguageSettingsProvidersAttribute();
+ if (defaultLanguageSettingsProvidersAttribute != null) {
+ List ids = new ArrayList();
+ String[] defaultIds = defaultLanguageSettingsProvidersAttribute.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER);
+ for (String id : defaultIds) {
+ if (id != null && !id.isEmpty()) {
+ if (id.startsWith("-")) {
+ id = id.substring(1);
+ ids.remove(id);
+ } else if (!ids.contains(id)){
+ if (id.contains("${Toolchain}")) {
+ IToolChain toolchain = getToolChain();
+ if (toolchain != null) {
+ String toolchainProvidersIds = toolchain.getDefaultLanguageSettingsProvidersIds();
+ if (toolchainProvidersIds != null) {
+ ids.addAll(Arrays.asList(toolchainProvidersIds.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER)));
+ } else {
+ String message = "Invalid use of ${Toolchain} tag, toolchain does not specify language settings providers. cfg=" + getId();
+ ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, IStatus.ERROR, message, new Exception()));
+ }
+ }
+ } else {
+ ids.add(id);
+ }
+ }
+ }
+
+ }
+ defaultLanguageSettingsProvidersIds = ids.toArray(new String[ids.size()]);
+ } else if (parent != null) {
+ defaultLanguageSettingsProvidersIds = parent.getDefaultLanguageSettingsProvidersIds();
+ }
+ }
+
+ return defaultLanguageSettingsProvidersIds;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setArtifactExtension(java.lang.String)
*/
@@ -1497,7 +1555,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if (entries.contains(lib)) {
entries.remove(lib);
des.removeExternalSetting(setting);
- des.createExternalSetting(setting.getCompatibleLanguageIds(), setting.getCompatibleContentTypeIds(),
+ des.createExternalSetting(setting.getCompatibleLanguageIds(), setting.getCompatibleContentTypeIds(),
setting.getCompatibleExtensions(), entries.toArray(new ICSettingEntry[entries.size()]));
}
}
@@ -1544,17 +1602,17 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
isDirty = true;
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setDescription(java.lang.String)
*/
@Override
public void setDescription(String description) {
- if (description == null && this.description == null) return;
- if (this.description == null || description == null || !description.equals(this.description)) {
- this.description = description;
- isDirty = true;
- }
+ if (description == null && this.description == null) return;
+ if (this.description == null || description == null || !description.equals(this.description)) {
+ this.description = description;
+ isDirty = true;
+ }
}
/* (non-Javadoc)
@@ -1602,60 +1660,60 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// rebuildNeeded = true;
}
}
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.build.managed.IConfiguration#setPrebuildStep(java.lang.String)
- */
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IConfiguration#setPrebuildStep(java.lang.String)
+ */
@Override
- public void setPrebuildStep(String step) {
- if (step == null && prebuildStep == null) return;
- if (prebuildStep == null || step == null || !prebuildStep.equals(step)) {
- prebuildStep = step;
+ public void setPrebuildStep(String step) {
+ if (step == null && prebuildStep == null) return;
+ if (prebuildStep == null || step == null || !prebuildStep.equals(step)) {
+ prebuildStep = step;
// rebuildNeeded = true;
- isDirty = true;
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.build.managed.IConfiguration#setPostbuildStep(java.lang.String)
- */
+ isDirty = true;
+ }
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IConfiguration#setPostbuildStep(java.lang.String)
+ */
@Override
- public void setPostbuildStep(String step) {
- if (step == null && postbuildStep == null) return;
- if (postbuildStep == null || step == null || !postbuildStep.equals(step)) {
- postbuildStep = step;
+ public void setPostbuildStep(String step) {
+ if (step == null && postbuildStep == null) return;
+ if (postbuildStep == null || step == null || !postbuildStep.equals(step)) {
+ postbuildStep = step;
// rebuildNeeded = true;
- isDirty = true;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.build.managed.IConfiguration#setPreannouncebuildStep(java.lang.String)
- */
+ isDirty = true;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IConfiguration#setPreannouncebuildStep(java.lang.String)
+ */
@Override
- public void setPreannouncebuildStep(String announceStep) {
- if (announceStep == null && preannouncebuildStep == null) return;
+ public void setPreannouncebuildStep(String announceStep) {
+ if (announceStep == null && preannouncebuildStep == null) return;
if (preannouncebuildStep == null || announceStep == null || !preannouncebuildStep.equals(announceStep)) {
- preannouncebuildStep = announceStep;
+ preannouncebuildStep = announceStep;
// rebuildNeeded = true;
- isDirty = true;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.build.managed.IConfiguration#setPostannouncebuildStep(java.lang.String)
- */
+ isDirty = true;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IConfiguration#setPostannouncebuildStep(java.lang.String)
+ */
@Override
- public void setPostannouncebuildStep(String announceStep) {
- if (announceStep == null && postannouncebuildStep == null) return;
+ public void setPostannouncebuildStep(String announceStep) {
+ if (announceStep == null && postannouncebuildStep == null) return;
if (postannouncebuildStep == null || announceStep == null || !postannouncebuildStep.equals(announceStep)) {
- postannouncebuildStep = announceStep;
+ postannouncebuildStep = announceStep;
// rebuildNeeded = true;
- isDirty = true;
- }
- }
-
+ isDirty = true;
+ }
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isSupported()
*/
@@ -1666,7 +1724,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return foInfo.isSupported();
return false;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isHeaderFile(java.lang.String)
*/
@@ -1678,7 +1736,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/*
* O B J E C T S T A T E M A I N T E N A N C E
*/
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isExtensionElement()
*/
@@ -1694,13 +1752,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public boolean isDirty() {
// This shouldn't be called for an extension configuration
if (isExtensionConfig) return false;
-
+
// If I need saving, just say yes
if (isDirty) return true;
-
+
// Otherwise see if any children need saving
IResourceInfo infos[] = rcInfos.getResourceInfos();
-
+
for(int i = 0; i < infos.length; i++){
if(infos[i].isDirty())
return true;
@@ -1715,18 +1773,18 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public boolean needsRebuild() {
return needsRebuild(true);
}
-
+
@Override
public boolean needsFullRebuild() {
return needsRebuild(false);
}
-
+
public boolean needsRebuild(boolean checkChildren) {
- boolean needRebuild = rebuildNeeded || resourceChangesRequireRebuild();
-
+ boolean needRebuild = rebuildNeeded || resourceChangesRequireRebuild();
+
if(needRebuild || !checkChildren)
return needRebuild;
-
+
IResourceInfo infos[] = rcInfos.getResourceInfos();
for(int i = 0; i < infos.length; i++){
@@ -1736,7 +1794,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return false;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setDirty(boolean)
*/
@@ -1761,15 +1819,15 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public void setRebuildState(boolean rebuild) {
if(isExtensionElement() && rebuild)
return;
-
+
if(rebuildNeeded != rebuild){
rebuildNeeded = rebuild;
saveRebuildState();
}
-
+
if(!rebuildNeeded){
setResourceChangeState(0);
-
+
IResourceInfo infos[] = rcInfos.getResourceInfos();
for(int i = 0; i < infos.length; i++){
@@ -1795,7 +1853,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return true;
}
}
- }
+ }
String args = builder.getArguments();
if (args != null) {
String superA = superB.getArguments();
@@ -1804,23 +1862,23 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return true;
}
}
- }
+ }
}
}
return false;
}
-
+
public void resolveReferences() {
if (!resolved) {
resolved = true;
-
+
// call resolve references on any children
ResourceInfo infos[] = (ResourceInfo[])rcInfos.getResourceInfos(ResourceInfo.class);
for(int i = 0; i < infos.length; i++){
infos[i].resolveReferences();
}
-
+
if (parentId != null) {
// Lookup the parent configuration by ID
parent = ManagedBuildManager.getExtensionConfiguration(parentId);
@@ -1828,7 +1886,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
-
+
/**
* Reset the configuration's, tools', options
*/
@@ -1843,7 +1901,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public IResourceConfiguration createResourceConfiguration(IFile file)
{
return createFileInfo(file.getFullPath().removeFirstSegments(1));
-
+
}
@Override
@@ -1865,12 +1923,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
return fileInfo;
}
-
+
@Override
public IFileInfo createFileInfo(IPath path, IFolderInfo base, ITool baseTool, String id, String name){
if(base.getPath().equals(path))
return null;
-
+
IFileInfo fileInfo = new ResourceConfiguration((FolderInfo)base, baseTool, id, name, path);
addResourceConfiguration(fileInfo);
ManagedBuildManager.performValueHandlerEvent(fileInfo, IManagedOptionValueHandler.EVENT_OPEN);
@@ -1882,7 +1940,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public IFileInfo createFileInfo(IPath path, IFileInfo base, String id, String name){
if(base.getPath().equals(path))
return null;
-
+
IFileInfo fileInfo = new ResourceConfiguration((ResourceConfiguration)base, path, id, name);
addResourceConfiguration(fileInfo);
ManagedBuildManager.performValueHandlerEvent(fileInfo, IManagedOptionValueHandler.EVENT_OPEN);
@@ -1913,12 +1971,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
return version;
}
-
+
@Override
public void setVersion(Version version) {
// Do nothing
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuildMacroSupplier()
*/
@@ -1928,9 +1986,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(toolChain != null)
return toolChain.getBuildMacroSupplier();
return null;
-
+
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isTemporary()
*/
@@ -1938,41 +1996,41 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public boolean isTemporary(){
return isTemporary;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.internal.core.BuildObject#updateManagedBuildRevision(java.lang.String)
*/
@Override
public void updateManagedBuildRevision(String revision){
super.updateManagedBuildRevision(revision);
-
+
ResourceInfo infos[] = (ResourceInfo[])rcInfos.getResourceInfos(ResourceInfo.class);
for(int i = 0; i < infos.length; i++){
infos[i].updateManagedBuildRevision(revision);
}
}
-
+
public void setParent(IConfiguration parent) {
if ( this.parent != parent) {
this.parent = parent;
if (!isExtensionElement())
setDirty(true);
- }
+ }
}
-
+
@Override
public ITool calculateTargetTool(){
ITool tool = getTargetTool();
-
+
if(tool == null){
tool = getToolFromOutputExtension(getArtifactExtension());
}
-
+
if(tool == null){
IConfiguration extCfg;
- for(extCfg = this;
- extCfg != null && !extCfg.isExtensionElement();
+ for(extCfg = this;
+ extCfg != null && !extCfg.isExtensionElement();
extCfg = extCfg.getParent()){
}
@@ -1980,15 +2038,15 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
tool = getToolFromOutputExtension(extCfg.getArtifactExtension());
}
}
-
+
return tool;
}
-
+
@Override
public ITool getToolFromOutputExtension(String extension) {
return getRootFolderInfo().getToolFromOutputExtension(extension);
}
-
+
@Override
public ITool getToolFromInputExtension(String sourceExtension) {
return getRootFolderInfo().getToolFromInputExtension(sourceExtension);
@@ -2002,19 +2060,19 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* with the resource tree between the two configuration builds
*
* The trivial approach implemented currently is to hold
- * the general information of whether some resources were
+ * the general information of whether some resources were
* removed,changed,etc. and detect whether the rebuild is needed
* based upon this information
- *
+ *
* This method adds the resource change state for the configuration
* specifying the resource change type performed on the project
* reported while building another configuration
* The method is not exported to the public API since delta handling
- * mechanism will likely to be changed in the future
+ * mechanism will likely to be changed in the future
*
* In the future we might implement some more smart mechanism
* for tracking delta, e.g calculate the pre-cinfiguration resource delta, etc.
- *
+ *
*/
public void addResourceChangeState(int state){
setResourceChangeState(state | resourceChangeState);
@@ -2026,13 +2084,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
saveResourceChangeState();
}
}
-
+
private boolean resourceChangesRequireRebuild(){
return isInternalBuilderEnabled() ?
resourceChangeState != 0 :
(resourceChangeState & IResourceDelta.REMOVED) == IResourceDelta.REMOVED;
}
-
+
private void saveRebuildState(){
PropertyManager.getInstance().setProperty(this, REBUILD_STATE, Boolean.toString(rebuildNeeded));
}
@@ -2040,16 +2098,16 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
private void saveResourceChangeState(){
PropertyManager.getInstance().setProperty(this, RC_CHANGE_STATE, Integer.toString(resourceChangeState));
}
-
+
/*
* Internal Builder state API
* NOTE: this is a temporary API
* In the future we are going present the Internal Builder
* as a special Builder object of the tool-chain and implement the internal
* builder enabling/disabling as the Builder substitution functionality
- *
+ *
*/
-
+
/* public void setInternalBuilderBoolean(boolean value, String pref) {
Preferences prefs = getPreferences(INTERNAL_BUILDER);
if(prefs != null){
@@ -2059,17 +2117,17 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
} catch (BackingStoreException e) {}
}
}
-*/
+*/
/* public boolean getInternalBuilderBoolean(String pref, boolean defaultValue) {
Preferences prefs = getPreferences(INTERNAL_BUILDER);
return prefs != null ?
prefs.getBoolean(pref, false) : defaultValue;
}
-*/
+*/
/**
* this method is used for enabling/disabling the internal builder
* for the given configuration
- *
+ *
* @param enable boolean
*/
public void enableInternalBuilder(boolean enable){
@@ -2081,12 +2139,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(enable){
savePrevBuilderId(getBuilder());
}
-
- changeBuilder(builder,
+
+ changeBuilder(builder,
ManagedBuildManager.calculateChildId(builder.getId(), null),
- builder.getName(),
+ builder.getName(),
true);
-
+
if(enable){
try {
setManagedBuildOn(true);
@@ -2095,11 +2153,11 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
}
-
+
public boolean canEnableInternalBuilder(boolean enable){
return getBuilderForInternalBuilderEnablement(enable, true) != null;
}
-
+
private IBuilder getBuilderForInternalBuilderEnablement(boolean enable, boolean checkCompatibility){
IBuilder newBuilder = null;
if(enable){
@@ -2124,9 +2182,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
IBuilder b = tc.getBuilder();
if(b.isInternalBuilder())
continue;
-
+
for(;b != null && !b.isExtensionElement(); b = b.getSuperClass()) {}
-
+
if(b != null){
if(!checkCompatibility || isBuilderCompatible(b)){
newBuilder = b;
@@ -2135,7 +2193,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
}
-
+
// if(newBuilder == null){
// IBuilder builders[] = ManagedBuildManager.getRealBuilders();
// IBuilder tmpB = null;
@@ -2144,7 +2202,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// if(b.isInternalBuilder())
// continue;
//
-//
+//
// if(isBuilderCompatible(b)){
// newBuilder = b;
// break;
@@ -2152,7 +2210,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// tmpB = b;
// }
// }
-//
+//
// if(newBuilder == null){
// if(tmpB != null)
// newBuilder = tmpB;
@@ -2163,14 +2221,14 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return newBuilder;
}
-
+
private void savePrevBuilderId(IBuilder builder){
IBuilder b = builder;
for(;b != null && !b.isExtensionElement(); b = b.getSuperClass()) {}
-
+
if(b == null)
b = builder;
-
+
ToolChain tc = (ToolChain)getToolChain();
if(tc != null)
tc.setNonInternalBuilderId(b.getId());
@@ -2188,14 +2246,14 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* @return boolean
*/
public boolean isInternalBuilderEnabled(){
- return getBuilder().isInternalBuilder();
+ return getBuilder().isInternalBuilder();
}
-
+
/**
- *
+ *
* sets the Internal Builder mode
- *
- * @param ignore if true, internal builder will ignore
+ *
+ * @param ignore if true, internal builder will ignore
* build errors while building,
* otherwise it will stop at the first build error
*/
@@ -2210,54 +2268,54 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* returns the Internal Builder mode
* if true, internal builder will ignore build errors while building,
* otherwise it will stop at the first build error
- *
+ *
* @return boolean
*/
public boolean getInternalBuilderIgnoreErr(){
return !getBuilder().isStopOnError();
}
-
+
/**
* sets the Internal Builder Parallel mode
- * @param parallel if true, internal builder will use parallel mode
- *
+ * @param parallel if true, internal builder will use parallel mode
+ *
* @deprecated since CDT 9.0. Use {@link #setParallelDef(boolean)}
*/
@Deprecated
public void setInternalBuilderParallel(boolean parallel){
setParallelDef(parallel);
}
-
+
/**
* returns the Internal Builder parallel mode
- * if true, internal builder will work in parallel mode
+ * if true, internal builder will work in parallel mode
* otherwise it will use only one thread
* @return boolean
- *
+ *
* @deprecated since CDT 9.0. Use {@link #getParallelDef()}
*/
@Deprecated
public boolean getInternalBuilderParallel(){
return getParallelDef();
}
-
+
/**
* Set parallel execution mode for the configuration's builder.
* @see Builder#setParallelBuildOn(boolean)
- *
+ *
* @param parallel - the flag to enable or disable parallel mode.
*/
public void setParallelDef(boolean parallel){
if(getParallelDef() == parallel)
return;
-
+
try {
getEditableBuilder().setParallelBuildOn(parallel);
} catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
}
}
-
+
/**
* Check if the configuration's builder is operating in parallel mode.
* @return {@code true} if parallel mode is enabled, {@code false} otherwise.
@@ -2265,10 +2323,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public boolean getParallelDef(){
return getBuilder().isParallelBuildOn();
}
-
+
/**
* Sets maximum number of parallel threads/jobs to be used by builder.
- *
+ *
* @param jobs - maximum number of jobs or threads. For details how
* the number is interpreted see {@link Builder#setParallelizationNum(int)}.
*/
@@ -2279,23 +2337,23 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
ManagedBuilderCorePlugin.log(e);
}
}
-
+
/**
* Returns maximum number of parallel threads/jobs used by the configuration's builder.
* @see #setParallelDef(boolean)
- *
+ *
* @return - maximum number of parallel threads or jobs used by the builder.
*/
public int getParallelNumber(){
return getBuilder().getParallelizationNum();
}
-
+
// private Preferences getPreferences(String name){
// if(isTemporary)
// return null;
-//
+//
// IProject project = (IProject)getOwner();
-//
+//
// if(project == null || !project.exists() || !project.isOpen())
// return null;
//
@@ -2332,12 +2390,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public IFolderInfo getRootFolderInfo() {
return rootFolderInfo;
}
-
+
ResourceInfoContainer getRcInfoContainer(IResourceInfo rcInfo){
PathSettingsContainer cr = pathSettings.getChildContainer(rcInfo.getPath(), true, true);
return new ResourceInfoContainer(cr, false);
}
-
+
@Override
public CConfigurationData getConfigurationData(){
return fCfgData;
@@ -2374,7 +2432,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public IFolderInfo createFolderInfo(IPath path, IFolderInfo base, String id, String name) {
if(base.getPath().equals(path))
return null;
-
+
FolderInfo folderInfo = new FolderInfo((FolderInfo)base, id, name, path);
addResourceConfiguration(folderInfo);
folderInfo.propertiesChanged();
@@ -2389,7 +2447,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(parent != null && sourceEntries == null)
return parent.getSourceEntries();
return new ICSourceEntry[]{new CSourceEntry(Path.EMPTY, null, ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED)};
-
+
}
return sourceEntries.clone();
}
@@ -2437,13 +2495,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
resetErrorParsers();
Set oldSet = contributeErrorParsers(null, true);
if(oldSet != null) {
- oldSet.removeAll(Arrays.asList(ids));
+ oldSet.removeAll(Arrays.asList(ids));
removeErrorParsers(oldSet);
- }
+ }
setErrorParserAttribute(ids);
}
}
-
+
public void resetErrorParsers(){
errorParserIds = null;
IResourceInfo rcInfos[] = getResourceInfos();
@@ -2452,15 +2510,15 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
rcInfo.resetErrorParsers();
}
}
-
+
void removeErrorParsers(Set set){
Set oldSet = contributeErrorParsers(null, false);
if(oldSet == null)
oldSet = new LinkedHashSet();
-
+
oldSet.removeAll(set);
setErrorParserAttribute(oldSet.toArray(new String[oldSet.size()]));
-
+
IResourceInfo rcInfos[] = getResourceInfos();
for(int i = 0; i < rcInfos.length; i++){
ResourceInfo rcInfo = (ResourceInfo)rcInfos[i];
@@ -2472,7 +2530,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public CBuildData getBuildData() {
return getEditableBuilder().getBuildData();
}
-
+
@Override
public IBuilder getEditableBuilder(){
IToolChain tc = getToolChain();
@@ -2484,17 +2542,17 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
return builder;
}
-
+
@Override
public IBuilder getBuilder(){
return getToolChain().getBuilder();
}
-
+
@Override
public String getOutputPrefix(String outputExtension) {
// Treat null extensions as empty string
String ext = outputExtension == null ? new String() : outputExtension;
-
+
// Get all the tools for the current config
String flags = new String();
ITool[] tools = getFilteredTools();
@@ -2506,11 +2564,11 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
return flags;
}
-
+
public ICConfigurationDescription getConfigurationDescription(){
return fCfgDes;
}
-
+
public void setConfigurationDescription(ICConfigurationDescription cfgDes){
fCfgDes = cfgDes;
}
@@ -2526,7 +2584,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
return buildProperties;
}
-
+
private BuildObjectProperties findBuildProperties(){
if(buildProperties == null){
if(parent != null){
@@ -2550,7 +2608,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public void propertiesChanged() {
if(isExtensionConfig)
return;
-
+
BooleanExpressionApplicabilityCalculator calculator = getBooleanExpressionCalculator();
if(calculator != null)
calculator.adjustConfiguration(this, false);
@@ -2560,7 +2618,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
((ResourceInfo)infos[i]).propertiesChanged();
}
}
-
+
public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator(){
if(booleanExpressionCalculator == null){
if(parent != null){
@@ -2574,10 +2632,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public boolean isSystemObject() {
if(isTest)
return true;
-
+
if(getProjectType() != null)
return getProjectType().isSystemObject();
-
+
return false;
}
@@ -2590,7 +2648,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public String getOutputFlag(String outputExt) {
// Treat null extension as an empty string
String ext = outputExt == null ? new String() : outputExt;
-
+
// Get all the tools for the current config
String flags = new String();
ITool[] tools = getFilteredTools();
@@ -2603,9 +2661,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
return flags;
}
-
+
@Override
- public IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
+ public IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation, IPath outputLocation ){
ITool[] tools = getFilteredTools();
for (int index = 0; index < tools.length; index++) {
@@ -2615,7 +2673,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
//try to resolve the build macros in the tool command
try{
String resolvedCommand = null;
-
+
if ((inputLocation != null && inputLocation.toString().indexOf(" ") != -1) || //$NON-NLS-1$
(outputLocation != null && outputLocation.toString().indexOf(" ") != -1) ) //$NON-NLS-1$
{
@@ -2644,26 +2702,26 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
if((resolvedCommand = resolvedCommand.trim()).length() > 0)
cmd = resolvedCommand;
-
+
} catch (BuildMacroException e){
}
IManagedCommandLineGenerator gen = tool.getCommandLineGenerator();
- return gen.generateCommandLineInfo( tool, cmd,
- flags, outputFlag, outputPrefix, outputName, inputResources,
+ return gen.generateCommandLineInfo( tool, cmd,
+ flags, outputFlag, outputPrefix, outputName, inputResources,
tool.getCommandLinePattern() );
}
}
return null;
}
-
+
@Override
public String[] getUserObjects(String extension) {
Vector objs = new Vector();
ITool tool = calculateTargetTool();
if(tool == null)
tool = getToolFromOutputExtension(extension);
-
+
if(tool != null){
IOption[] opts = tool.getOptions();
// Look for the user object option type
@@ -2698,14 +2756,14 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
return objs.toArray(new String[objs.size()]);
}
-
+
@Override
public String[] getLibs(String extension) {
Vector libs = new Vector();
ITool tool = calculateTargetTool();
if(tool == null)
tool = getToolFromOutputExtension(extension);
-
+
if(tool != null){
IOption[] opts = tool.getOptions();
// Look for the lib option type
@@ -2713,10 +2771,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
IOption option = opts[i];
try {
if (option.getValueType() == IOption.LIBRARIES) {
-
+
// check to see if the option has an applicability calculator
IOptionApplicability applicabilitytCalculator = option.getApplicabilityCalculator();
-
+
if (applicabilitytCalculator == null
|| applicabilitytCalculator.isOptionUsedInCommandLine(this, tool, option)) {
String command = option.getCommand();
@@ -2741,7 +2799,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// TODO: report error
continue;
}
-
+
}
}
}
@@ -2781,7 +2839,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/**
* Responsible for contributing 'external' settings back to the core for use
* by referenced projects.
- *
+ *
* In this case it returns Include, Library path & Library File settings
* to be used be references for linking the output of this library project
*/
@@ -2833,13 +2891,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(!rcs[i].supportsBuild(managed))
return false;
}
-
+
if(checkBuilder){
IBuilder builder = getBuilder();
if(builder != null && !builder.supportsBuild(managed))
return false;
}
-
+
return true;
}
@@ -2850,10 +2908,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(props != null){
supports = props.supportsType(typeId);
}
-
+
if(!supports)
supports = ((ToolChain)getToolChain()).supportsType(typeId);
-
+
return supports;
}
@@ -2864,13 +2922,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(props != null){
supports = props.supportsValue(typeId, valueId);
}
-
+
if(!supports)
supports = ((ToolChain)getToolChain()).supportsValue(typeId, valueId);
-
+
return supports;
}
-
+
private SupportedProperties findSupportedProperties(){
if(supportedProperties == null){
if(parent != null){
@@ -2879,7 +2937,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
return supportedProperties;
}
-
+
private void loadProperties(IManagedConfigElement el){
supportedProperties = new SupportedProperties(el);
}
@@ -2891,9 +2949,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(props != null){
list.addAll(Arrays.asList(props.getRequiredTypeIds()));
}
-
+
list.addAll(Arrays.asList(((ToolChain)getToolChain()).getRequiredTypeIds()));
-
+
return list.toArray(new String[list.size()]);
}
@@ -2904,9 +2962,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(props != null){
list.addAll(Arrays.asList(props.getSupportedTypeIds()));
}
-
+
list.addAll(Arrays.asList(((ToolChain)getToolChain()).getSupportedTypeIds()));
-
+
return list.toArray(new String[list.size()]);
}
@@ -2917,9 +2975,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(props != null){
list.addAll(Arrays.asList(props.getSupportedValueIds(typeId)));
}
-
+
list.addAll(Arrays.asList(((ToolChain)getToolChain()).getSupportedValueIds(typeId)));
-
+
return list.toArray(new String[list.size()]);
}
@@ -2930,10 +2988,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if(props != null){
requires = props.requiresType(typeId);
}
-
+
if(!requires)
requires = ((ToolChain)getToolChain()).requiresType(typeId);
-
+
return requires;
}
@@ -2970,22 +3028,22 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
for(;extBuilder != null && !extBuilder.isExtensionElement(); extBuilder = extBuilder.getSuperClass()) {}
if(extBuilder == null)
extBuilder = newBuilder;
-
+
newCfgBuilder = new Builder(tc, extBuilder, id, name, false);
newCfgBuilder.copySettings(cur, allBuildSettings);
}
}
-
+
if(newCfgBuilder != null){
tc.setBuilder(newCfgBuilder);
}
}
-
+
@Override
public boolean isBuilderCompatible(IBuilder builder){
return builder.supportsBuild(isManagedBuildOn());
}
-
+
ITool findToolById(String id){
IResourceInfo[] rcInfos = getResourceInfos();
ITool tool = null;
@@ -2997,7 +3055,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
return tool;
}
-
+
void resolveProjectReferences(boolean onLoad){
IResourceInfo[] rcInfos = getResourceInfos();
for(int i = 0; i < rcInfos.length; i++){
@@ -3005,7 +3063,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
info.resolveProjectReferences(onLoad);
}
}
-
+
public boolean isPerRcTypeDiscovery(){
ToolChain tc = (ToolChain)getRootFolderInfo().getToolChain();
return tc.isPerRcTypeDiscovery();
@@ -3035,33 +3093,33 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
ToolChain tc = (ToolChain)getRootFolderInfo().getToolChain();
return tc.getDiscoveredPathInfo();
}
-
+
public String getDiscoveryProfileId(){
ToolChain tc = (ToolChain)getRootFolderInfo().getToolChain();
return tc.getScannerConfigDiscoveryProfileId();
}
-
+
public PathInfoCache clearDiscoveredPathInfo(){
ToolChain tc = (ToolChain)getRootFolderInfo().getToolChain();
return tc.clearDiscoveredPathInfo();
}
-
+
public ICfgScannerConfigBuilderInfo2Set getCfgScannerConfigInfo(){
return cfgScannerInfo;
}
-
+
public void setCfgScannerConfigInfo(ICfgScannerConfigBuilderInfo2Set info){
cfgScannerInfo = info;
}
-
+
public void clearCachedData(){
cfgScannerInfo = null;
}
-
+
public boolean isPreference(){
return isPreferenceConfig;
}
-
+
@Override
public IBuildPropertyValue getBuildArtefactType() {
IBuildObjectProperties props = findBuildProperties();
@@ -3072,7 +3130,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
return null;
}
-
+
@Override
public void setBuildArtefactType(String id) throws BuildException {
IBuildObjectProperties props = getBuildProperties();
@@ -3082,7 +3140,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
throw new BuildException(e.getLocalizedMessage());
}
// May need to update the exports paths & symbols after artifact type change
- exportArtifactInfo();
+ exportArtifactInfo();
}
boolean isExcluded(IPath path){
@@ -3091,7 +3149,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
ICSourceEntry[] entries = getSourceEntries();
return CDataUtil.isExcluded(path, entries);
}
-
+
void setExcluded(IPath path, boolean isFolder, boolean excluded){
// if(path.segmentCount() == 0)
// return;
@@ -3104,7 +3162,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
excludeList.add(path);
}
}
-
+
private ICSourceEntry[] getUpdatedEntries(IPath path, boolean isFolder, boolean excluded){
try {
ICSourceEntry[] entries = getSourceEntries();
@@ -3114,7 +3172,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
return null;
}
-
+
boolean canExclude(IPath path, boolean isFolder, boolean excluded){
if(excludeList == null) {
ICSourceEntry[] newEntries = getUpdatedEntries(path, isFolder, excluded);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java
index 7932e7b2f39..a706a2d0b00 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java
@@ -17,6 +17,7 @@ import java.util.List;
import java.util.StringTokenizer;
import java.util.Vector;
+import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.model.LanguageManager;
import org.eclipse.cdt.core.settings.model.ICStorageElement;
@@ -24,6 +25,7 @@ import org.eclipse.cdt.core.settings.model.util.CDataUtil;
import org.eclipse.cdt.internal.core.SafeStringInterner;
import org.eclipse.cdt.managedbuilder.core.IAdditionalInput;
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IFileInfo;
import org.eclipse.cdt.managedbuilder.core.IInputOrder;
import org.eclipse.cdt.managedbuilder.core.IInputType;
@@ -37,6 +39,7 @@ import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.internal.enablement.OptionEnablementExpression;
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IPath;
@@ -1838,9 +1841,56 @@ public class InputType extends BuildObject implements IInputType {
return id;
}
+ /**
+ * Temporary method to support compatibility during SD transition.
+ */
+ private boolean isLanguageSettingsProvidersFunctionalityEnabled() {
+ boolean isLanguageSettingsProvidersEnabled = false;
+ ITool tool = getParent();
+ if (tool!=null) {
+ IBuildObject bo = tool.getParent();
+ if (bo instanceof IToolChain) {
+ IConfiguration cfg = ((IToolChain) bo).getParent();
+ if (cfg!=null) {
+ IResource rc = cfg.getOwner();
+ if (rc!=null) {
+ IProject project = rc.getProject();
+ isLanguageSettingsProvidersEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
+ }
+ }
+ }
+ }
+ return isLanguageSettingsProvidersEnabled;
+ }
+
+ /**
+ * Temporary method to support compatibility during SD transition.
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public String getLegacyDiscoveryProfileIdAttribute(){
+ String profileId = buildInfoDicsoveryProfileId;
+ if (profileId == null) {
+ profileId = ScannerDiscoveryLegacySupport.getDeprecatedLegacyProfiles(id);
+ if (profileId == null && superClass instanceof InputType) {
+ profileId = ((InputType)superClass).getLegacyDiscoveryProfileIdAttribute();
+ }
+ }
+ return profileId;
+ }
+
public String getDiscoveryProfileIdAttribute(){
- if(buildInfoDicsoveryProfileId == null && superClass != null)
- return ((InputType)superClass).getDiscoveryProfileIdAttribute();
+ if (!isLanguageSettingsProvidersFunctionalityEnabled())
+ return getLegacyDiscoveryProfileIdAttribute();
+
+ return getDiscoveryProfileIdAttributeInternal();
+ }
+
+ /**
+ * Method extracted temporarily to support compatibility during SD transition.
+ */
+ private String getDiscoveryProfileIdAttributeInternal(){
+ if(buildInfoDicsoveryProfileId == null && superClass instanceof InputType)
+ return ((InputType)superClass).getDiscoveryProfileIdAttributeInternal();
return buildInfoDicsoveryProfileId;
}
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 0b1f6c233e5..3ce6f992212 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
@@ -50,16 +50,16 @@ import org.eclipse.core.runtime.IPath;
import org.osgi.framework.Version;
/**
- * This class represents a set of configurations
+ * This class represents a set of configurations
* to be edited simultaneously on property pages.
*/
public class MultiConfiguration extends MultiItemsHolder implements
IMultiConfiguration {
private static final String[] EMPTY_STR_ARRAY = new String[0];
-
+
protected IConfiguration[] fCfgs = null;
private int curr = 0;
-
+
public MultiConfiguration(IConfiguration[] cfs) {
fCfgs = cfs;
for (int i=0; i getDefaultLanguageSettingsProviders(IConfiguration cfg) {
+ List providers = new ArrayList();
+ String[] ids = cfg.getDefaultLanguageSettingsProvidersIds();
+ if (ids != null) {
+ for (String id : ids) {
+ ILanguageSettingsProvider provider = null;
+ if (!LanguageSettingsManager.isPreferShared(id)) {
+ provider = LanguageSettingsManager.getExtensionProviderCopy(id, false);
+ }
+ if (provider == null) {
+ provider = LanguageSettingsManager.getWorkspaceProvider(id);
+ }
+ providers.add(provider);
+ }
+ }
+
+ if (providers.isEmpty()) {
+ // Add MBS and User provider for unsuspecting toolchains (backward compatibility)
+ ILanguageSettingsProvider userProvider = LanguageSettingsManager.getExtensionProviderCopy(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, true);
+ ILanguageSettingsProvider mbsProvider = LanguageSettingsManager.getWorkspaceProvider(ScannerDiscoveryLegacySupport.MBS_LANGUAGE_SETTINGS_PROVIDER_ID);
+ providers.add(userProvider);
+ providers.add(mbsProvider);
+ }
+
+ return providers;
+ }
+
+ private static void setDefaultLanguageSettingsProvidersIds(IConfiguration cfg, ICConfigurationDescription cfgDescription) {
+ if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
+ List providers = getDefaultLanguageSettingsProviders(cfg);
+ String[] ids = new String[providers.size()];
+ for (int i = 0; i < ids.length; i++) {
+ ILanguageSettingsProvider provider = providers.get(i);
+ ids[i] = provider.getId();
+ }
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setDefaultLanguageSettingsProvidersIds(ids);
+ }
+
+ }
+
+ public static void setDefaultLanguageSettingsProviders(IConfiguration cfg, ICConfigurationDescription cfgDescription) {
+ setDefaultLanguageSettingsProvidersIds(cfg, cfgDescription);
+ List providers = getDefaultLanguageSettingsProviders(cfg);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+ }
+
+
private boolean isPersistedCfg(ICConfigurationDescription cfgDes){
return cfgDes.getSessionProperty(CFG_PERSISTED_PROPERTY) != null;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/GCCBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/GCCBuiltinSpecsDetector.java
new file mode 100644
index 00000000000..dc21039200f
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/GCCBuiltinSpecsDetector.java
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2011 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.scannerconfig;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsEditableProvider;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICSettingEntry;
+import org.eclipse.cdt.managedbuilder.scannerconfig.ToolchainBuiltinSpecsDetector;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * Language settings provider to detect built-in compiler settings for GCC compiler.
+ */
+public class GCCBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector implements ILanguageSettingsEditableProvider {
+ // ID must match the toolchain definition in org.eclipse.cdt.managedbuilder.core.buildDefinitions extension point
+ private static final String GCC_TOOLCHAIN_ID = "cdt.managedbuild.toolchain.gnu.base"; //$NON-NLS-1$
+
+ private enum State {NONE, EXPECTING_LOCAL_INCLUDE, EXPECTING_SYSTEM_INCLUDE, EXPECTING_FRAMEWORKS}
+ private State state = State.NONE;
+
+ @SuppressWarnings("nls")
+ private static final AbstractOptionParser[] optionParsers = {
+ new IncludePathOptionParser("#include \"(\\S.*)\"", "$1", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY | ICSettingEntry.LOCAL),
+ new IncludePathOptionParser("#include <(\\S.*)>", "$1", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY),
+ new IncludePathOptionParser("#framework <(\\S.*)>", "$1", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY | ICSettingEntry.FRAMEWORKS_MAC),
+ new MacroOptionParser("#define\\s+(\\S*\\(.*?\\))\\s*(.*)", "$1", "$2", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY),
+ new MacroOptionParser("#define\\s+(\\S*)\\s*(\\S*)", "$1", "$2", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY),
+ };
+
+ @Override
+ protected String getToolchainId() {
+ return GCC_TOOLCHAIN_ID;
+ }
+
+ @Override
+ protected AbstractOptionParser[] getOptionParsers() {
+ return optionParsers;
+ }
+
+ private List makeList(final String line) {
+ return new ArrayList() {{ add(line); }};
+ }
+
+ @Override
+ protected List parseForOptions(String line) {
+ line = line.trim();
+
+ // contribution of -dD option
+ if (line.startsWith("#define")) {
+ return makeList(line);
+ }
+
+ // contribution of includes
+ if (line.equals("#include \"...\" search starts here:")) {
+ state = State.EXPECTING_LOCAL_INCLUDE;
+ } else if (line.equals("#include <...> search starts here:")) {
+ state = State.EXPECTING_SYSTEM_INCLUDE;
+ } else if (line.startsWith("End of search list.")) {
+ state = State.NONE;
+ } else if (line.equals("Framework search starts here:")) {
+ state = State.EXPECTING_FRAMEWORKS;
+ } else if (line.startsWith("End of framework search list.")) {
+ state = State.NONE;
+ } else if (state==State.EXPECTING_LOCAL_INCLUDE) {
+ // making that up for the parser to figure out
+ line = "#include \""+line+"\"";
+ return makeList(line);
+ } else {
+ String frameworkIndicator = "(framework directory)";
+ if (state==State.EXPECTING_SYSTEM_INCLUDE) {
+ // making that up for the parser to figure out
+ if (line.contains(frameworkIndicator)) {
+ line = "#framework <"+line.replace(frameworkIndicator, "").trim()+">";
+ } else {
+ line = "#include <"+line+">";
+ }
+ return makeList(line);
+ } else if (state==State.EXPECTING_FRAMEWORKS) {
+ // making that up for the parser to figure out
+ line = "#framework <"+line.replace(frameworkIndicator, "").trim()+">";
+ return makeList(line);
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ public void startup(ICConfigurationDescription cfgDescription) throws CoreException {
+ super.startup(cfgDescription);
+
+ state = State.NONE;
+ }
+
+ @Override
+ public void shutdown() {
+ state = State.NONE;
+
+ super.shutdown();
+ }
+
+ @Override
+ public GCCBuiltinSpecsDetector cloneShallow() throws CloneNotSupportedException {
+ return (GCCBuiltinSpecsDetector) super.cloneShallow();
+ }
+
+ @Override
+ public GCCBuiltinSpecsDetector clone() throws CloneNotSupportedException {
+ return (GCCBuiltinSpecsDetector) super.clone();
+ }
+
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/GCCBuiltinSpecsDetectorCygwin.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/GCCBuiltinSpecsDetectorCygwin.java
new file mode 100644
index 00000000000..64389f7a5b3
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/GCCBuiltinSpecsDetectorCygwin.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2011 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.scannerconfig;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.eclipse.cdt.core.settings.model.ICSettingEntry;
+import org.eclipse.core.resources.IResource;
+
+/**
+ * Class to detect built-in compiler settings.
+ * The paths are converted to cygwin "filesystem" representation. Then
+ *
+ */
+public class GCCBuiltinSpecsDetectorCygwin extends GCCBuiltinSpecsDetector {
+ private static final URI CYGWIN_ROOT;
+ static {
+ try {
+ CYGWIN_ROOT = new URI("cygwin:/"); //$NON-NLS-1$
+ } catch (URISyntaxException e) {
+ // hey we know this works
+ throw new IllegalStateException(e);
+ }
+ }
+
+ @SuppressWarnings("nls")
+ private static final AbstractOptionParser[] optionParsers = {
+ new IncludePathOptionParser("#include \"(\\S.*)\"", "$1", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY | ICSettingEntry.LOCAL),
+ new IncludePathOptionParser("#include <(\\S.*)>", "$1", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY),
+ new MacroOptionParser("#define (\\S*\\(.*?\\)) *(.*)", "$1", "$2", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY),
+ new MacroOptionParser("#define (\\S*) *(.*)", "$1", "$2", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY),
+ };
+
+ @Override
+ protected AbstractOptionParser[] getOptionParsers() {
+ return optionParsers;
+ }
+
+ @Override
+ protected URI getMappedRootURI(IResource sourceFile, String parsedResourceName) {
+ if (mappedRootURI==null) {
+ mappedRootURI = super.getMappedRootURI(sourceFile, parsedResourceName);
+ if (mappedRootURI==null) {
+ mappedRootURI = CYGWIN_ROOT;
+ }
+ }
+ return mappedRootURI;
+ }
+
+ @Override
+ protected URI getBuildDirURI(URI mappedRootURI) {
+ if (buildDirURI==null) {
+ buildDirURI = super.getBuildDirURI(mappedRootURI);
+ if (buildDirURI==null) {
+ buildDirURI = CYGWIN_ROOT;
+ }
+ }
+ return buildDirURI;
+ }
+
+ @Override
+ public GCCBuiltinSpecsDetectorCygwin cloneShallow() throws CloneNotSupportedException {
+ return (GCCBuiltinSpecsDetectorCygwin) super.cloneShallow();
+ }
+
+ @Override
+ public GCCBuiltinSpecsDetectorCygwin clone() throws CloneNotSupportedException {
+ return (GCCBuiltinSpecsDetectorCygwin) super.clone();
+ }
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/MBSLanguageSettingsProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/MBSLanguageSettingsProvider.java
new file mode 100644
index 00000000000..5540b00958f
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/MBSLanguageSettingsProvider.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2011 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.scannerconfig;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.cdt.core.AbstractExecutableExtensionBase;
+import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsBroadcastingProvider;
+import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsStorage;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICFileDescription;
+import org.eclipse.cdt.core.settings.model.ICFolderDescription;
+import org.eclipse.cdt.core.settings.model.ICLanguageSetting;
+import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
+import org.eclipse.cdt.core.settings.model.ICResourceDescription;
+import org.eclipse.cdt.core.settings.model.ICSettingBase;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * Implementation of language settings provider for CDT Managed Build System.
+ */
+public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase implements ILanguageSettingsBroadcastingProvider {
+ @Override
+ public List getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
+
+ IPath projectPath = rc.getProjectRelativePath();
+ ICLanguageSetting[] languageSettings = null;
+
+ if (rc instanceof IFile) {
+ ICLanguageSetting ls = cfgDescription.getLanguageSettingForFile(projectPath, true);
+ if (ls != null) {
+ languageSettings = new ICLanguageSetting[] {ls};
+ } else {
+ return getSettingEntries(cfgDescription, rc.getParent(), languageId);
+ }
+ } else {
+ ICResourceDescription rcDescription = cfgDescription.getResourceDescription(projectPath, false);
+ languageSettings = getLanguageSettings(rcDescription);
+ }
+
+ List list = new ArrayList();
+
+ if (languageSettings != null) {
+ for (ICLanguageSetting langSetting : languageSettings) {
+ if (langSetting!=null) {
+ String id = langSetting.getLanguageId();
+ if (id!=null && id.equals(languageId)) {
+ int kindsBits = langSetting.getSupportedEntryKinds();
+ for (int kind=1;kind<=kindsBits;kind<<=1) {
+ if ((kindsBits & kind) != 0) {
+ list.addAll(langSetting.getSettingEntriesList(kind));
+ }
+ }
+ } else {
+ // System.err.println("languageSetting id=null: name=" + languageSetting.getName());
+ }
+ } else {
+ System.err.println("languageSetting=null: rc=" + rc);
+ }
+ }
+ }
+ return LanguageSettingsStorage.getPooledList(list);
+ }
+
+ private ICLanguageSetting[] getLanguageSettings(ICResourceDescription rcDescription) {
+ ICLanguageSetting[] array = null;
+ switch (rcDescription.getType()) {
+ case ICSettingBase.SETTING_PROJECT:
+ case ICSettingBase.SETTING_CONFIGURATION:
+ case ICSettingBase.SETTING_FOLDER:
+ ICFolderDescription foDes = (ICFolderDescription)rcDescription;
+ array = foDes.getLanguageSettings();
+ break;
+ case ICSettingBase.SETTING_FILE:
+ ICFileDescription fiDes = (ICFileDescription)rcDescription;
+ ICLanguageSetting ls = fiDes.getLanguageSetting();
+ if (ls!=null) {
+ array = new ICLanguageSetting[] { ls };
+ }
+ }
+ if (array==null) {
+ array = new ICLanguageSetting[0];
+ }
+ return array;
+ }
+
+ public void setSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId,
+ List entries) {
+
+// lang.setSettingEntries(kind, entries);
+ IPath projectPath = rc.getProjectRelativePath();
+ ICResourceDescription rcDescription = cfgDescription.getResourceDescription(projectPath, false);
+
+ for (ICLanguageSetting languageSetting : getLanguageSettings(rcDescription)) {
+ if (languageSetting!=null) {
+ String id = languageSetting.getLanguageId();
+ if (id!=null && id.equals(languageId)) {
+ int kindsBits = languageSetting.getSupportedEntryKinds();
+ for (int kind=1;kind<=kindsBits;kind<<=1) {
+ if ((kindsBits & kind) != 0) {
+ List list = new ArrayList(entries.size());
+ for (ICLanguageSettingEntry entry : entries) {
+ if (entry.getKind()==kind) {
+ list.add(entry);
+ }
+ }
+ languageSetting.setSettingEntries(kind, list);
+ }
+ }
+ } else {
+// System.err.println("languageSetting id=null: name=" + languageSetting.getName());
+ }
+ } else {
+ System.err.println("languageSetting=null: rcDescription=" + rcDescription.getName());
+ }
+ }
+ }
+
+ @Override
+ public LanguageSettingsStorage copyStorage() {
+ class PretendStorage extends LanguageSettingsStorage {
+ @Override
+ public boolean isEmpty() {
+ return false;
+ }
+ @Override
+ public LanguageSettingsStorage clone() throws CloneNotSupportedException {
+ return this;
+ }
+ @Override
+ public boolean equals(Object obj) {
+ // Note that this always triggers change event even if nothing changed in MBS
+ return false;
+ }
+ }
+ return new PretendStorage();
+ }
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/ToolchainBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/ToolchainBuiltinSpecsDetector.java
new file mode 100644
index 00000000000..eec392dee85
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/ToolchainBuiltinSpecsDetector.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2011 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.scannerconfig;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.cdt.make.core.scannerconfig.AbstractBuiltinSpecsDetector;
+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;
+
+/**
+ * Abstract parser capable to execute compiler command printing built-in compiler
+ * specs and parse built-in language settings out of it. The compiler to be used
+ * is taken from MBS tool-chain definition.
+ *
+ * @since 8.1
+ */
+public abstract class ToolchainBuiltinSpecsDetector extends AbstractBuiltinSpecsDetector {
+ private Map toolMap = new HashMap();
+ /**
+ * TODO
+ */
+ protected abstract String getToolchainId();
+
+ private ITool getTool(String languageId) {
+ ITool langTool = toolMap.get(languageId);
+ if (langTool != null) {
+ return langTool;
+ }
+
+ String toolchainId = getToolchainId();
+ IToolChain toolchain = ManagedBuildManager.getExtensionToolChain(toolchainId);
+ if (toolchain != null) {
+ ITool[] tools = toolchain.getTools();
+ for (ITool tool : tools) {
+ IInputType[] inputTypes = tool.getInputTypes();
+ for (IInputType inType : inputTypes) {
+ String lang = inType.getLanguageId(tool);
+ if (languageId.equals(lang)) {
+ toolMap.put(languageId, tool);
+ return tool;
+ }
+ }
+ }
+ }
+ ManagedBuilderCorePlugin.error("Unable to find tool in toolchain="+toolchainId+" for language="+languageId);
+ return null;
+ }
+
+ @Override
+ protected String getCompilerCommand(String languageId) {
+ ITool tool = getTool(languageId);
+ String compiler = tool.getToolCommand();
+ if (compiler.length() == 0) {
+ String msg = "Unable to find compiler command in toolchain="+getToolchainId();
+ ManagedBuilderCorePlugin.error(msg);
+ }
+ return compiler;
+ }
+
+ @Override
+ protected String getSpecFileExtension(String languageId) {
+ String ext = null;
+ ITool tool = getTool(languageId);
+ String[] srcFileExtensions = tool.getAllInputExtensions();
+ if (srcFileExtensions != null && srcFileExtensions.length > 0) {
+ ext = srcFileExtensions[0];
+ }
+ if (ext == null || ext.length() == 0) {
+ ManagedBuilderCorePlugin.error("Unable to find file extension for language "+languageId);
+ }
+ return ext;
+ }
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
index 146c331769c..3e6c0caa23e 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
@@ -1269,7 +1269,6 @@
dependencyExtensions="h"
dependencyCalculator="org.eclipse.cdt.managedbuilder.makegen.gnu.DefaultGCCDependencyCalculator2"
id="cdt.managedbuild.tool.gnu.c.compiler.input"
- scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC|org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"
languageId="org.eclipse.cdt.core.gcc">
+ />
+ />
+ osList="linux,hpux,aix,qnx"
+ targetTool="cdt.managedbuild.tool.gnu.c.linker;cdt.managedbuild.tool.gnu.cpp.linker;cdt.managedbuild.tool.gnu.archiver">
@@ -1842,6 +1842,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.make.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
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">
@@ -2083,9 +2084,9 @@