- * 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,207 @@ 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();
-
+
+ /** @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
+ * 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 +294,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 +337,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 +357,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 +368,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 +409,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 +457,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 +465,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 +559,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(MapProjectType
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();
ListProjectType
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,7 +332,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
setId(id);
this.projectType = projectType;
isExtensionConfig = true;
-
+
// setup for resolving
resolved = false;
@@ -343,13 +344,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// 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 +358,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 +370,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 +382,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 +428,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 +450,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 +464,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 +480,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.
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 +519,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 +544,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 +563,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 +602,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 +618,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)
@@ -637,7 +638,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// 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 +664,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 +675,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 +694,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 +712,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 +741,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
-
+
public void applyToManagedProject(ManagedProject mProj){
managedProject = mProj;
isPreferenceConfig = false;
@@ -751,28 +752,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 +781,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
+ defaultLanguageSettingsProvidersIds = 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 +822,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 +858,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 +873,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 +903,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 +919,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 +952,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 +970,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 +990,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 +998,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 +1006,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 +1015,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 +1043,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 +1085,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 +1099,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 +1112,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 +1161,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 +1177,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 +1212,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 +1257,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 +1284,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPostbuildStep()
*/
@Override
@@ -1300,7 +1304,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPreannouncebuildStep()
*/
@Override
@@ -1320,7 +1324,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPostannouncebuildStep()
*/
@Override
@@ -1340,7 +1344,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getCleanCommand()
*/
@Override
@@ -1362,7 +1366,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return cleanCommand;
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getDescription()
*/
@@ -1383,14 +1387,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 +1413,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 +1449,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
}
-
+
if(includeChildren){
IResourceInfo[] rcInfos = getResourceInfos();
for(int i = 0; i < rcInfos.length; i++){
@@ -1455,7 +1459,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
return set;
}
-
+
+ @Override
+ public String getDefaultLanguageSettingsProvidersIds() {
+ return defaultLanguageSettingsProvidersIds;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setArtifactExtension(java.lang.String)
*/
@@ -1497,7 +1506,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 +1553,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 +1611,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 +1675,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 +1687,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 +1703,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 +1724,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 +1745,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return false;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setDirty(boolean)
*/
@@ -1761,15 +1770,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 +1804,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return true;
}
}
- }
+ }
String args = builder.getArguments();
if (args != null) {
String superA = superB.getArguments();
@@ -1804,23 +1813,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 +1837,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
-
+
/**
* Reset the configuration's, tools', options
*/
@@ -1843,7 +1852,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public IResourceConfiguration createResourceConfiguration(IFile file)
{
return createFileInfo(file.getFullPath().removeFirstSegments(1));
-
+
}
@Override
@@ -1865,12 +1874,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 +1891,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 +1922,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 +1937,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 +1947,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 +1989,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 +2011,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 +2035,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 +2049,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 +2068,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 +2090,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 +2104,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 +2133,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 +2144,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
}
-
+
// if(newBuilder == null){
// IBuilder builders[] = ManagedBuildManager.getRealBuilders();
// IBuilder tmpB = null;
@@ -2144,7 +2153,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// if(b.isInternalBuilder())
// continue;
//
-//
+//
// if(isBuilderCompatible(b)){
// newBuilder = b;
// break;
@@ -2152,7 +2161,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// tmpB = b;
// }
// }
-//
+//
// if(newBuilder == null){
// if(tmpB != null)
// newBuilder = tmpB;
@@ -2163,14 +2172,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 +2197,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 +2219,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 +2274,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 +2288,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 +2341,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 +2383,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 +2398,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 +2446,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
resetErrorParsers();
Set