Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/plugin.xml11
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/schema/buildDefinitions.exsd44
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java60
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java420
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolChain.java206
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java66
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java58
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java76
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java79
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java53
10 files changed, 675 insertions, 398 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/plugin.xml b/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
index ae8c2baf886..14cde1542a5 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
@@ -307,14 +307,15 @@
fileVersion="4.0.0">
</managedBuildRevision>
<configuration
- id="org.eclipse.cdt.build.core.emptycfg"
- name="%cfg1_empty">
+ id="org.eclipse.cdt.build.core.emptycfg"
+ languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;${Toolchain}"
+ name="%cfg1_empty">
</configuration>
<configuration
- id="org.eclipse.cdt.build.core.prefbase.cfg"
- name="%cfg1_base"
- >
+ id="org.eclipse.cdt.build.core.prefbase.cfg"
+ languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;${Toolchain}"
+ name="%cfg1_base">
<toolChain
id="org.eclipse.cdt.build.core.prefbase.toolchain"
name="%toolChain.name"
diff --git a/build/org.eclipse.cdt.managedbuilder.core/schema/buildDefinitions.exsd b/build/org.eclipse.cdt.managedbuilder.core/schema/buildDefinitions.exsd
index 6e8e0e32854..8a3777470fd 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/schema/buildDefinitions.exsd
+++ b/build/org.eclipse.cdt.managedbuilder.core/schema/buildDefinitions.exsd
@@ -263,7 +263,16 @@ Specifying this attribute is fully equivalent to specifying the &quot;org.eclips
<attribute name="errorParsers" type="string">
<annotation>
<documentation>
- The semi-colon separated list of the default error parsers to be used with this configuration. The list is ordered with the first error parser on the list invoked first, the second error parser second, and so on. The list may contain the error parsers defined by CDT and/or other installed error parser extensions. The list of error parsers to be used may be changed by the user on a per-configuration basis. When specified, this overrides the tool-chain errorParsers attribute.
+ The semi-colon separated list of the default error parsers to be used with this configuration. The list is ordered with the first error parser on the list invoked first, the second error parser second, and so on. The list may contain the error parsers defined by CDT and/or other installed error parser extensions. The list of error parsers to be used may be changed by the user on a per-configuration basis. When specified, this overrides the tool-chain errorParsers attribute.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="languageSettingsProviders" type="string">
+ <annotation>
+ <documentation>
+ Semicolon-separated list of providers ID implementing ILanguageSettingProvider interface.
+This field could be amended with toolchain-level providers list by using ${Toolchain} keyword. Provider ID can be prefixed with &quot;-&quot; which will cause id to be removed from the preceeding list including providers defined with ${Toolchain} keyword.
+If this field is not specified, &quot;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider&quot; (MBS Language Settings Provider) is used by default.
</documentation>
</annotation>
</attribute>
@@ -405,7 +414,14 @@ Specifying this attribute is fully equivalent to specifying the &quot;org.eclips
<attribute name="errorParsers" type="string">
<annotation>
<documentation>
- The semi-colon separated list of the default error parsers to be used with this tool-chain. The list is ordered with the first error parser on the list invoked first, the second error parser second, and so on. The list may contain the error parsers defined by CDT and/or other installed error parser extensions. When specified, this overrides the tool errorParsers attributes of the tool children of the tool-chain and the builder child of the tool-chain.
+ The semi-colon separated list of the default error parsers to be used with this tool-chain. The list is ordered with the first error parser on the list invoked first, the second error parser second, and so on. The list may contain the error parsers defined by CDT and/or other installed error parser extensions. When specified, this overrides the tool errorParsers attributes of the tool children of the tool-chain and the builder child of the tool-chain.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="languageSettingsProviders" type="string">
+ <annotation>
+ <documentation>
+ Semicolon-separated list of providers ID implementing ILanguageSettingProvider interface. This list could be adjusted on configuration level in the corresponding attribute.
</documentation>
</annotation>
</attribute>
@@ -732,14 +748,14 @@ The pathConverter of a toolchain applies for all tools of the toolchain except i
<attribute name="customBuildStep" type="boolean">
<annotation>
<documentation>
- Specifies whether this Tool represents a user-define custom build step. The default is false. When True, the default value of the commandLinePattern attribute changes to “$(command)”.
+ Specifies whether this Tool represents a user-define custom build step. The default is false. When True, the default value of the commandLinePattern attribute changes to &quot;$(command)&quot;.
</documentation>
</annotation>
</attribute>
<attribute name="announcement" type="string">
<annotation>
<documentation>
- Specifies a string that is written to the build output prior to each invocation of the tool. The default value is “Invoking tool-name (tool-id)…”
+ Specifies a string that is written to the build output prior to each invocation of the tool. The default value is &quot;Invoking tool-name (tool-id)...&quot;
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
@@ -1066,7 +1082,7 @@ Overrides language id specified with the languageId attribute.
<attribute name="primaryInputType" type="string">
<annotation>
<documentation>
- The id of the input type that is used in determining the build “rules” for the output type and for the default name of the output file. The default is the input type with primaryInput == true.
+ The id of the input type that is used in determining the build &quot;rules&quot; for the output type and for the default name of the output file. The default is the input type with primaryInput == true.
</documentation>
</annotation>
</attribute>
@@ -1080,7 +1096,7 @@ Overrides language id specified with the languageId attribute.
<attribute name="outputPrefix" type="string">
<annotation>
<documentation>
- Some tools produce files with a special prefix that must be specified. For example, a librarian on POSIX systems expects the output to be libtarget.a, so &apos;lib&apos; would be the prefix. The default is to use the Tool “outputPrefix” attribute if primaryOutput is True, otherwise the default is an empty string. This attribute supports MBS configuration context macros.
+ Some tools produce files with a special prefix that must be specified. For example, a librarian on POSIX systems expects the output to be libtarget.a, so &apos;lib&apos; would be the prefix. The default is to use the Tool &quot;outputPrefix&quot; attribute if primaryOutput is True, otherwise the default is an empty string. This attribute supports MBS configuration context macros.
</documentation>
</annotation>
</attribute>
@@ -2150,11 +2166,11 @@ If the &quot;buildPathResolver&quot; attribute is specified, the &quot;pathDelim
<documentation>
Represents the applicability type for this enablement.
Can contain the following values:
-UI_VISIBILITY – the given enablement expression specifies whether the option is to be visible in UI,
-UI_ENABLEMENT – the given enablement expression specifies the enable state of the controls that represent the option in UI,
-CMD_USAGE – the given enablement expression specifies whether the option is to be used in command line
+UI_VISIBILITY - the given enablement expression specifies whether the option is to be visible in UI,
+UI_ENABLEMENT - the given enablement expression specifies the enable state of the controls that represent the option in UI,
+CMD_USAGE - the given enablement expression specifies whether the option is to be used in command line
CONTAINER_ATTRIBUTE - the given enablement expressions specifies thecontainer attribute value
-ALL – this value means the combination of all the above values.
+ALL - this value means the combination of all the above values.
Several types could be specified simultaneously using the &quot;|&quot; as a delimiter, e.g.:
type=&quot;UI_VISIBILITY|CMD_USAGE&quot;
@@ -2288,7 +2304,7 @@ Default value is true.
<attribute name="value" type="string">
<annotation>
<documentation>
- Specifies the expected value. If the current option value matches the value specified in this attribute, the checkOption element is treated as true, otherwise – as false.
+ Specifies the expected value. If the current option value matches the value specified in this attribute, the checkOption element is treated as true, otherwise - as false.
The expected value could be specified either as a string that may contain build macros or as a regular expression. During the comparison, the build macros are resolved and the option value is checked to match the resulting string or regular expression. The way the expected value is specified and treated depends on the value of the isRegex attribute
</documentation>
</annotation>
@@ -2303,14 +2319,14 @@ The expected value could be specified either as a string that may contain build
<attribute name="otherOptionId" type="string">
<annotation>
<documentation>
- The id of the option which is to be compared with the option specified with the “optionId” attribute. The default is the id of the option that holds this expression. If the “value” attribute is specified, both the “otherOptionId” and the “otherHolderId” attributes are ignored. When searching for the option to be checked, MBS will examine all the options the holder contains along with all superclasses of each option to find the option with the specified id.
+ The id of the option which is to be compared with the option specified with the &quot;optionId&quot; attribute. The default is the id of the option that holds this expression. If the &quot;value&quot; attribute is specified, both the &quot;otherOptionId&quot; and the &quot;otherHolderId&quot; attributes are ignored. When searching for the option to be checked, MBS will examine all the options the holder contains along with all superclasses of each option to find the option with the specified id.
</documentation>
</annotation>
</attribute>
<attribute name="otherHolderId" type="string">
<annotation>
<documentation>
- The option holder id that holds the option specified with the “otherOptionId” attribute. The default is the id of the holder that holds the container of this expression. If the “value” attribute is specified, both the “otherOptionId” and the “otherHolderId” attributes are ingnored. When searching for the needed holder, MBS will examine all the holders the current configuration contains along with all superclasses of each holder in order to find the holder with the specified id.
+ The option holder id that holds the option specified with the &quot;otherOptionId&quot; attribute. The default is the id of the holder that holds the container of this expression. If the &quot;value&quot; attribute is specified, both the &quot;otherOptionId&quot; and the &quot;otherHolderId&quot; attributes are ingnored. When searching for the needed holder, MBS will examine all the holders the current configuration contains along with all superclasses of each holder in order to find the holder with the specified id.
</documentation>
</annotation>
</attribute>
@@ -2334,7 +2350,7 @@ The expected value could be specified either as a string that may contain build
<attribute name="value" type="string" use="required">
<annotation>
<documentation>
- Specifies the expected value. If the current string specified in the “string” attribute matches the value specified in this attribute, the checkString element is treated as true, otherwise – as false.
+ Specifies the expected value. If the current string specified in the &quot;string&quot; attribute matches the value specified in this attribute, the checkString element is treated as true, otherwise - as false.
The expected value could be specified either as a string that might contain the build macros or as a regular expression.
The way the value is specified and treated depends on the value of the isRegex attribute.
</documentation>
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java
index 6c27670a7b6..54397ce3905 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java
@@ -38,7 +38,7 @@ public class CfgScannerConfigUtil {
IInputType inType = context.getInputType();
boolean adjust = false;
CfgInfoContext newContext = context;
-
+
if(tool != null){
if(inType != null){
if(!tool.hasScannerConfigSettings(inType)){
@@ -59,10 +59,10 @@ public class CfgScannerConfigUtil {
inType = null;
adjust = true;
}
-
+
if(rcInfo != null){
ToolChain tc = getToolChain(rcInfo);
-
+
if(tc != null){
if(!tc.hasScannerConfigSettings()){
adjust = true;
@@ -85,23 +85,23 @@ public class CfgScannerConfigUtil {
// adjust = true;
// }
// }
-
+
if(adjust){
if(rcInfo == null)
newContext = new CfgInfoContext(context.getConfiguration());
else
newContext = new CfgInfoContext(rcInfo, tool, inType);
}
-
+
return newContext;
}
-
+
private static ToolChain getToolChain(IResourceInfo rcInfo){
- return rcInfo instanceof FolderInfo ?
+ return rcInfo instanceof FolderInfo ?
(ToolChain)((FolderInfo)rcInfo).getToolChain()
: (ToolChain)((ResourceConfiguration)rcInfo).getBaseToolChain();
}
-
+
public static String getDefaultProfileId(CfgInfoContext context, boolean searchFirstIfNone){
String id = null;
if(context.getInputType() != null)
@@ -116,19 +116,19 @@ public class CfgScannerConfigUtil {
if(id == null){
id = ((Configuration)context.getConfiguration()).getDiscoveryProfileId();
}
-
+
if(id == null && searchFirstIfNone){
id = getFirstProfileId(context.getConfiguration().getFilteredTools());
}
return id;
}
-
+
public static String getFirstProfileId(ITool[] tools){
String id = null;
for(int i = 0; i < tools.length; i++){
ITool tool = tools[i];
IInputType[] types = tool.getInputTypes();
-
+
if(types.length != 0){
for(int k = 0; k < types.length; k++){
id = types[k].getDiscoveryProfileId(tool);
@@ -142,24 +142,30 @@ public class CfgScannerConfigUtil {
if(id != null)
break;
}
-
+
return id;
}
/**
* Search for toolchain's discovery profiles. Discovery profiles could be
* specified on toolchain level, input types level or in their super-classes.
- *
+ *
* @param toolchain - toolchain to search for scanner discovery profiles.
* @return all available discovery profiles in given toolchain
*/
public static Set<String> getAllScannerDiscoveryProfileIds(IToolChain toolchain) {
Assert.isNotNull(toolchain);
-
+
Set<String> profiles = new TreeSet<String>();
-
+
if (toolchain!=null) {
- String toolchainProfileId = toolchain.getScannerConfigDiscoveryProfileId();
+ String toolchainProfileId = null;
+ if (toolchain instanceof ToolChain) {
+ // still allow a user a choice to select any legacy profiles
+ toolchainProfileId = ((ToolChain) toolchain).getLegacyScannerConfigDiscoveryProfileId();
+ } else {
+ toolchainProfileId = toolchain.getScannerConfigDiscoveryProfileId();
+ }
if (toolchainProfileId!=null && toolchainProfileId.length()>0) {
profiles.add(toolchainProfileId);
}
@@ -172,15 +178,15 @@ public class CfgScannerConfigUtil {
profiles.addAll(getAllScannerDiscoveryProfileIds(superClass));
}
}
-
+
return profiles;
}
-
+
/**
* Search for tool's discovery profiles. Discovery profiles could be retrieved
* from tool/input type super-class. Input type could hold list of profiles
* separated by pipe character '|'.
- *
+ *
* @param tool - tool to search for scanner discovery profiles
* @return all available discovery profiles in given configuration
*/
@@ -192,42 +198,42 @@ public class CfgScannerConfigUtil {
new Object[] { Tool.class.getName() });
throw new UnsupportedOperationException(msg);
}
-
+
Set<String> profiles = new TreeSet<String>();
-
+
for (IInputType inputType : ((Tool) tool).getAllInputTypes()) {
for (String profileId : getAllScannerDiscoveryProfileIds(inputType)) {
profiles.add(profileId);
}
}
-
+
ITool superClass = tool.getSuperClass();
if (superClass!=null) {
profiles.addAll(getAllScannerDiscoveryProfileIds(superClass));
}
return profiles;
}
-
+
/**
* Search for input type's discovery profiles. Discovery profiles could be specified
* on input type super-class. Input type could hold list of profiles
* separated by pipe character '|'.
- *
+ *
* @param inputType - input type to search for scanner discovery profiles
* @return all available discovery profiles in given configuration
*/
private static Set<String> getAllScannerDiscoveryProfileIds(IInputType inputType) {
Assert.isNotNull(inputType);
-
+
if ( ! (inputType instanceof InputType) ) {
String msg = MessageFormat.format(ManagedMakeMessages.getString("CfgScannerConfigUtil_ErrorNotSupported"), //$NON-NLS-1$
new Object[] { InputType.class.getName() });
throw new UnsupportedOperationException(msg);
}
-
+
Set<String> profiles = new TreeSet<String>();
- String attribute = ((InputType) inputType).getDiscoveryProfileIdAttribute();
+ String attribute = ((InputType) inputType).getLegacyDiscoveryProfileIdAttribute();
if (attribute!=null) {
// FIXME: temporary; we should add new method to IInputType instead of that
for (String profileId : attribute.split("\\|")) { //$NON-NLS-1$
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..87db9d380d4 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.
* <p>
- * 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"; //$NON-NLS-1$
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();
-
+
+ /**
+ * Returns default language settings providers IDs specified for the configuration.
+ * @return default language settings providers IDs or {@code null}.
+ *
+ * @since 8.1
+ */
+ public String[] getDefaultLanguageSettingsProviderIds();
+
/**
- * 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 <code>ITools</code> 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 <code>ITools</code> 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 <code>null</code>.
- *
+ *
* @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 <code>null</code>.
- *
+ *
* @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 <code>null</code> if none.
*/
public IResourceConfiguration getResourceConfiguration(String path);
-
+
/**
* Returns the resource configuration children of this configuration.
- *
+ *
* @return IResourceConfigurations[]
*/
public IResourceConfiguration[] getResourceConfigurations();
-
+
/**
* Returns the <code>ITool</code> in this configuration's tool-chain with
- * the same id as the argument, or <code>null</code>.
- *
+ * the same id as the argument, or <code>null</code>.
+ *
* @param id unique identifier to search for
* @return ITool
*/
public ITool getTool(String id);
/**
- * Returns the <code>ITool</code> in this configuration's tool-chain with
- * the specified ID, or the tool(s) with a superclass with this id.
- *
- * <p>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 <code>ITool</code> in this configuration's tool-chain with
+ * the specified ID, or the tool(s) with a superclass with this id.
+ *
+ * <p>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 <code>ITool[]</code>
* @since 3.0.2
*/
public ITool[] getToolsBySuperClassId(String id);
-
+
/**
* Returns the <code>IToolChain</code> 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 <code>true</code> if this configuration has overridden the default build
* build command in this configuration, otherwise <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean hasOverriddenBuildCommand();
-
+
/**
- * Returns <code>true</code> if the extension matches one of the special
- * file extensions the tools for the configuration consider to be a header file.
- *
+ * Returns <code>true</code> 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 <code>true</code> if this configuration has changes that need to
- * be saved in the project file, else <code>false</code>.
+ * Returns <code>true</code> if this configuration has changes that need to
+ * be saved in the project file, else <code>false</code>.
* Should not be called for an extension configuration.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isDirty();
-
+
/**
* Returns <code>true</code> if this configuration was loaded from a manifest file,
* and <code>false</code> 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 <code>true</code> if the configuration contains a change
+ *
+ * @return <code>true</code> 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 <code>true</code> 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 <code>true</code> if the configuration's tool-chain is supported on the system
* otherwise returns <code>false</code>
- *
- * @return boolean
- */
+ *
+ * @return boolean
+ */
public boolean isSupported();
-
+
/**
* Returns the implementation of the IConfigurationEnvironmentVariableSupplier provided
* by the tool-integrator or <code>null</code> if none.
- *
- * @return IConfigurationEnvironmentVariableSupplier
- */
+ *
+ * @return IConfigurationEnvironmentVariableSupplier
+ */
public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier();
-
+
/**
* Returns the tool-integrator provided implementation of the configuration build macro supplier
- * or <code>null</code> if none.
- *
+ * or <code>null</code> 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 <code>ITool</code> for the tool associated with the
+ * Returns a <code>ITool</code> 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 <code>ITool</code> for the tool associated with the
+ * Returns a <code>ITool</code> 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..c41dba208ac 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.
* <p>
* 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"; //$NON-NLS-1$
+
/**
* 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 <code>Builder</code> 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 <code>null</code>
- *
+ * Returns the tool in this tool-chain with the ID specified in the argument,
+ * or <code>null</code>
+ *
* @param id The ID of the requested tool
* @return ITool
*/
public ITool getTool(String id);
/**
- * Returns the <code>ITool</code> in the tool-chain with the specified
- * ID, or the tool(s) with a superclass with this id.
- *
- * <p>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 <code>ITool</code> in the tool-chain with the specified
+ * ID, or the tool(s) with a superclass with this id.
+ *
+ * <p>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 <code>ITool[]</code>
* @since 3.0.2
@@ -181,55 +184,55 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
/**
* Returns the <code>IToolChain</code> that is the superclass of this
* tool-chain, or <code>null</code> if the attribute was not specified.
- *
+ *
* @return IToolChain
*/
public IToolChain getSuperClass();
-
+
/**
* Returns whether this element is abstract. Returns <code>false</code>
* 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 <code>null</code> 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 getDefaultLanguageSettingsProviderIds();
+
+ /**
+ * Returns the scanner config discovery profile id or <code>null</code> 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 <code>true</code> if this tool-chain has changes that need to
+ * Returns <code>true</code> if this tool-chain has changes that need to
* be saved in the project file, else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isDirty();
-
+
/**
* Sets the element's "dirty" (have I been modified?) flag.
*/
public void setDirty(boolean isDirty);
-
+
/**
* Returns <code>true</code> if this tool-chain was loaded from a manifest file,
* and <code>false</code> if it was loaded from a project (.cdtbuild) file.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isExtensionElement();
-
+
/**
* Returns <code>true</code> if the tool-chain support is installed on the system
* otherwise returns <code>false</code>
- *
- * @return boolean
- */
+ *
+ * @return boolean
+ */
public boolean isSupported();
-
+
/**
* Returns the tool-integrator provided implementation of the configuration environment variable supplier
- * or <code>null</code> if none.
- *
+ * or <code>null</code> if none.
+ *
* @return IConfigurationEnvironmentVariableSupplier
*/
public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier();
-
+
/**
* Returns the tool-integrator provided implementation of the configuration build macro supplier
- * or <code>null</code> if none.
- *
+ * or <code>null</code> 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/internal/core/Configuration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
index 8a55afcaead..c6202bbb744 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
@@ -92,6 +92,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
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$
+ private static final String LANGUAGE_SETTINGS_PROVIDER_NEGATION_SIGN = "-"; //$NON-NLS-1$
+ private static final String $TOOLCHAIN = "${Toolchain}"; //$NON-NLS-1$
// Parent and children
private String parentId;
@@ -102,6 +105,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
private String cleanCommand;
private String artifactExtension;
private String errorParserIds;
+ private String defaultLanguageSettingsProvidersAttribute;
+ private String[] defaultLanguageSettingsProviderIds;
private String prebuildStep;
private String postbuildStep;
private String preannouncebuildStep;
@@ -781,6 +786,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// Get the semicolon separated list of IDs of the error parsers
errorParserIds = SafeStringInterner.safeIntern(element.getAttribute(ERROR_PARSERS));
+ // Get the initial/default language settings providers IDs
+ defaultLanguageSettingsProvidersAttribute = SafeStringInterner.safeIntern(element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS));
+
// Get the artifact extension
artifactExtension = SafeStringInterner.safeIntern(element.getAttribute(EXTENSION));
@@ -1453,6 +1461,62 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return set;
}
+ /**
+ * Get value of attribute {@link IConfiguration#LANGUAGE_SETTINGS_PROVIDERS}
+ * It not defined, it will try to pull the attribute from the parent configuration.
+ */
+ private String getDefaultLanguageSettingsProvidersAttribute() {
+ if (defaultLanguageSettingsProvidersAttribute == null && parent instanceof Configuration) {
+ defaultLanguageSettingsProvidersAttribute = ((Configuration) parent).getDefaultLanguageSettingsProvidersAttribute();
+ }
+
+ return defaultLanguageSettingsProvidersAttribute;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * This function will try to find default provider Ids specified in this instance.
+ * It none defined, it will try to pull Ids from the parent configuration.
+ */
+ @Override
+ public String[] getDefaultLanguageSettingsProviderIds() {
+ defaultLanguageSettingsProviderIds = null;
+ if (defaultLanguageSettingsProviderIds == null) {
+ defaultLanguageSettingsProvidersAttribute = getDefaultLanguageSettingsProvidersAttribute();
+ if (defaultLanguageSettingsProvidersAttribute != null) {
+ List<String> ids = new ArrayList<String>();
+ String[] defaultIds = defaultLanguageSettingsProvidersAttribute.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER);
+ for (String id : defaultIds) {
+ if (id != null && !id.isEmpty()) {
+ if (id.startsWith(LANGUAGE_SETTINGS_PROVIDER_NEGATION_SIGN)) {
+ 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.getDefaultLanguageSettingsProviderIds();
+ if (toolchainProvidersIds != null) {
+ ids.addAll(Arrays.asList(toolchainProvidersIds.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER)));
+ }
+ }
+ } else {
+ ids.add(id);
+ }
+ }
+ }
+
+ }
+ defaultLanguageSettingsProviderIds = ids.toArray(new String[ids.size()]);
+ } else if (parent != null) {
+ defaultLanguageSettingsProviderIds = parent.getDefaultLanguageSettingsProviderIds();
+ }
+ }
+
+ return defaultLanguageSettingsProviderIds;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setArtifactExtension(java.lang.String)
*/
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..63953098db2 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,58 @@ public class InputType extends BuildObject implements IInputType {
return id;
}
- public String getDiscoveryProfileIdAttribute(){
- if(buildInfoDicsoveryProfileId == null && superClass != null)
- return ((InputType)superClass).getDiscoveryProfileIdAttribute();
+ /**
+ * Check if legacy scanner discovery method should be used.
+ */
+ private boolean isLegacyScannerDiscovery() {
+ 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 (isLegacyScannerDiscovery()) {
+ return getLegacyDiscoveryProfileIdAttribute();
+ }
+
+ return getDiscoveryProfileIdAttributeInternal();
+ }
+
+ /**
+ * Do not inline! This method needs to call itself recursively.
+ */
+ 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..3c5b5531772 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<fCfgs.length; i++)
@@ -68,19 +68,19 @@ public class MultiConfiguration extends MultiItemsHolder implements
break;
}
}
-
+
public MultiConfiguration(ICConfigurationDescription[] cfds) {
this(cfds2cfs(cfds));
}
-
+
public static IConfiguration[] cfds2cfs(ICConfigurationDescription[] cfgds) {
IConfiguration[] cfs = new IConfiguration[cfgds.length];
for (int i=0; i<cfgds.length; i++)
cfs[i] = ManagedBuildManager.getConfigurationForDescription(cfgds[i]);
return cfs;
}
-
-
+
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.MultiItemsHolder#getItems()
*/
@@ -211,24 +211,24 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public IManagedCommandLineInfo generateToolCommandLineInfo(
- String sourceExtension,
- String[] flags,
+ String sourceExtension,
+ String[] flags,
String outputFlag,
- String outputPrefix,
- String outputName,
+ String outputPrefix,
+ String outputName,
String[] inputResources,
- IPath inputLocation,
+ IPath inputLocation,
IPath outputLocation) {
if (DEBUG)
System.out.println("Strange multi access: MultiConfiguration.generateToolCommandLineInfo()"); //$NON-NLS-1$
return curr().generateToolCommandLineInfo(
- sourceExtension,
- flags,
- outputFlag,
- outputPrefix,
- outputName,
- inputResources,
- inputLocation,
+ sourceExtension,
+ flags,
+ outputFlag,
+ outputPrefix,
+ outputName,
+ inputResources,
+ inputLocation,
outputLocation);
}
@@ -243,7 +243,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
return EMPTY_STR;
return s;
}
-
+
public String[] getArtifactExtensions() {
String[] s = new String[fCfgs.length];
for (int i=0; i<fCfgs.length; i++)
@@ -278,7 +278,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
String args0 = fCfgs[0].getBuildArguments();
if (args0 == null)
args0 = EMPTY_STR;
-
+
for (IConfiguration cfg : fCfgs) {
String args = cfg.getBuildArguments();
if (args == null)
@@ -294,7 +294,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public IBuildPropertyValue getBuildArtefactType() {
- IBuildPropertyValue b = fCfgs[0].getBuildArtefactType();
+ IBuildPropertyValue b = fCfgs[0].getBuildArtefactType();
if (b == null)
return null;
for (int i=1; i<fCfgs.length; i++)
@@ -414,7 +414,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getErrorParserIds()
*/
-
+
@Override
public String getErrorParserIds() {
String s = fCfgs[0].getErrorParserIds();
@@ -440,6 +440,12 @@ public class MultiConfiguration extends MultiItemsHolder implements
return s;
}
+ @Override
+ public String[] getDefaultLanguageSettingsProviderIds() {
+ ManagedBuilderCorePlugin.error("Default Language Settings Providers are not supported in multiconfiguration mode"); //$NON-NLS-1$
+ return null;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getFilteredTools()
*/
@@ -842,9 +848,9 @@ public class MultiConfiguration extends MultiItemsHolder implements
return false;
return true;
}
-
+
public boolean[] isManagedBuildOnMulti() {
- boolean[] b = new boolean[fCfgs.length];
+ boolean[] b = new boolean[fCfgs.length];
for (int i=0; i<fCfgs.length; i++)
b[i] = fCfgs[i].isManagedBuildOn();
return b;
@@ -1026,7 +1032,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setName(java.lang.String)
*/
@Override
- public void setName(String name) {} // do nothing
+ public void setName(String name) {} // do nothing
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, boolean)
@@ -1209,7 +1215,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
}
return true; // all cfgs report true
}
-
+
@Override
public void setParallelDef(boolean parallel) {
for (IConfiguration cfg : fCfgs) {
@@ -1217,7 +1223,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
((Configuration)cfg).setParallelDef(parallel);
}
}
-
+
@Override
public int getParallelNumber() {
int res = 0;
@@ -1226,7 +1232,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
int num = ((Configuration)cfg).getParallelNumber();
Assert.isTrue(num != 0); // can't be 0, see IMakeCommonBuildInfo.getParallelizationNum()
- if (res == 0)
+ if (res == 0)
res = num;
else if (res != num)
return 0; // values are different !
@@ -1235,7 +1241,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
}
return res; // all cfgs report same value
}
-
+
@Override
public void setParallelNumber(int num) {
for (IConfiguration cfg : fCfgs) {
@@ -1243,12 +1249,12 @@ public class MultiConfiguration extends MultiItemsHolder implements
((Configuration)cfg).setParallelNumber(num);
}
}
-
+
@Override
public boolean getInternalBuilderParallel() {
return getParallelDef();
}
-
+
@Override
public boolean isInternalBuilderEnabled() {
for (int i=0; i<fCfgs.length; i++)
@@ -1270,14 +1276,14 @@ public class MultiConfiguration extends MultiItemsHolder implements
return false;
return true; // all cfgs report true
}
-
+
@Override
public void enableInternalBuilder(boolean v) {
for (int i=0; i<fCfgs.length; i++)
if (fCfgs[i] instanceof Configuration)
((Configuration)fCfgs[i]).enableInternalBuilder(v);
}
-
+
/**
* Returns "default" configuration.
*/
@@ -1362,7 +1368,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
ManagedBuilderCorePlugin.log(e);
}
}
-
+
public String getBuildAttribute(String name, String defValue) {
String res = defValue;
IBuilder b = fCfgs[0].getBuilder();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java
index 97201a4e605..30f027a94c5 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java
@@ -24,6 +24,7 @@ import java.util.SortedMap;
import java.util.StringTokenizer;
import org.eclipse.cdt.build.internal.core.scannerconfig.CfgDiscoveredPathManager.PathInfoCache;
+import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
import org.eclipse.cdt.core.settings.model.ICStorageElement;
import org.eclipse.cdt.core.settings.model.extension.CTargetPlatformData;
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
@@ -50,6 +51,8 @@ import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSu
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
import org.eclipse.cdt.managedbuilder.internal.enablement.OptionEnablementExpression;
import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier;
+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.IExtension;
@@ -85,6 +88,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
private String targetToolIds;
private String secondaryOutputIds;
private Boolean isAbstract;
+ private String defaultLanguageSettingsProviderIds;
private String scannerConfigDiscoveryProfileId;
private String versionsSupported;
private String convertToId;
@@ -554,6 +558,9 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// Get the target tool id
targetToolIds = SafeStringInterner.safeIntern(element.getAttribute(TARGET_TOOL));
+ // Get the initial/default language settings providers IDs
+ defaultLanguageSettingsProviderIds = element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS);
+
// Get the scanner config discovery profile id
scannerConfigDiscoveryProfileId = SafeStringInterner.safeIntern(element.getAttribute(SCANNER_CONFIG_PROFILE_ID));
String tmp = element.getAttribute(RESOURCE_TYPE_BASED_DISCOVERY);
@@ -1529,18 +1536,68 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
setDirty(true);
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getScannerConfigDiscoveryProfileId()
- */
- @Override
+ @Override
+ public String getDefaultLanguageSettingsProviderIds() {
+ if (defaultLanguageSettingsProviderIds == null && superClass instanceof IToolChain) {
+ defaultLanguageSettingsProviderIds = ((IToolChain) superClass).getDefaultLanguageSettingsProviderIds();
+ }
+ return defaultLanguageSettingsProviderIds;
+ }
+
+ /**
+ * Check if legacy scanner discovery method should be used.
+ */
+ private boolean isLegacyScannerDiscovery() {
+ boolean isLanguageSettingsProvidersEnabled = false;
+ IConfiguration cfg = getParent();
+ if (cfg != null) {
+ IResource rc = cfg.getOwner();
+ if (rc != null) {
+ IProject project = rc.getProject();
+ isLanguageSettingsProvidersEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
+ }
+ }
+ return !isLanguageSettingsProvidersEnabled;
+ }
+
+ /**
+ * Get list of scanner discovery profiles supported by previous version.
+ * @see ScannerDiscoveryLegacySupport#getDeprecatedLegacyProfiles(String)
+ *
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public String getLegacyScannerConfigDiscoveryProfileId() {
+ String profileId = scannerConfigDiscoveryProfileId;
+ if (profileId == null) {
+ profileId = ScannerDiscoveryLegacySupport.getDeprecatedLegacyProfiles(id);
+ if (profileId == null) {
+ IToolChain superClass = getSuperClass();
+ if (superClass instanceof ToolChain) {
+ profileId = ((ToolChain) superClass).getLegacyScannerConfigDiscoveryProfileId();
+ }
+ }
+ }
+ return profileId;
+ }
+
+ @Override
public String getScannerConfigDiscoveryProfileId() {
- if (scannerConfigDiscoveryProfileId == null) {
- if (getSuperClass() != null) {
- return getSuperClass().getScannerConfigDiscoveryProfileId();
- }
- }
- return scannerConfigDiscoveryProfileId;
- }
+ if (isLegacyScannerDiscovery()) {
+ return getLegacyScannerConfigDiscoveryProfileId();
+ }
+
+ return getScannerConfigDiscoveryProfileIdInternal();
+ }
+
+ /**
+ * Do not inline! This method needs to call itself recursively.
+ */
+ private String getScannerConfigDiscoveryProfileIdInternal() {
+ if (scannerConfigDiscoveryProfileId == null && superClass instanceof ToolChain) {
+ return ((ToolChain) getSuperClass()).getScannerConfigDiscoveryProfileIdInternal();
+ }
+ return scannerConfigDiscoveryProfileId;
+ }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#setScannerConfigDiscoveryProfileId(java.lang.String)
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java
index 82a1c9c805e..5c29520d0b7 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java
@@ -20,6 +20,10 @@ import java.util.Map;
import java.util.Set;
import org.eclipse.cdt.build.internal.core.scannerconfig2.CfgScannerConfigInfoFactory2;
+import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
+import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
+import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager;
+import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
import org.eclipse.cdt.core.model.ILanguageDescriptor;
import org.eclipse.cdt.core.model.LanguageManager;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
@@ -509,11 +513,60 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
// Update the ManagedBuildInfo in the ManagedBuildManager map. Doing this creates a barrier for subsequent
// ManagedBuildManager#getBuildInfo(...) see Bug 305146 for more
ManagedBuildManager.setLoaddedBuildInfo(cfgDescription.getProjectDescription().getProject(), info);
+ setDefaultLanguageSettingsProvidersIds(cfg, cfgDescription);
return cfg.getConfigurationData();
}
return null;
}
+ private static List<ILanguageSettingsProvider> getDefaultLanguageSettingsProviders(IConfiguration cfg) {
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
+ String[] ids = cfg.getDefaultLanguageSettingsProviderIds();
+ 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()) {
+ providers = ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy();
+ }
+
+ return providers;
+ }
+
+ private static void setDefaultLanguageSettingsProvidersIds(IConfiguration cfg, ICConfigurationDescription cfgDescription) {
+ if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
+ List<ILanguageSettingsProvider> 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(IProject project, IConfiguration cfg, ICConfigurationDescription cfgDescription) {
+ // propagate the preference to project properties
+ boolean isPreferenceEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(null);
+ ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isPreferenceEnabled);
+
+ if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
+ ConfigurationDataProvider.setDefaultLanguageSettingsProvidersIds(cfg, cfgDescription);
+ List<ILanguageSettingsProvider> providers = ConfigurationDataProvider.getDefaultLanguageSettingsProviders(cfg);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+ }
+ }
+
private boolean isPersistedCfg(ICConfigurationDescription cfgDescription){
return cfgDescription.getSessionProperty(CFG_PERSISTED_PROPERTY) != null;
}

Back to the top