Skip to main content
summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-05-04 18:33:09 -0400
committerAndrew Gvozdev2012-05-04 18:35:17 -0400
commitd2c19fcd47de828faef36593bce200b1226eb8af (patch)
treec390dd0d3a1df34187ebb66b40c44c175e30e224 /build
parenta5fd3894d10a265185f60c0555fc36d619cdbaca (diff)
downloadorg.eclipse.cdt-d2c19fcd47de828faef36593bce200b1226eb8af.tar.gz
org.eclipse.cdt-d2c19fcd47de828faef36593bce200b1226eb8af.tar.xz
org.eclipse.cdt-d2c19fcd47de828faef36593bce200b1226eb8af.zip
bug 376592: [sd90] Extend BuildDefinitions to allow defining language settings providers
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/AllLanguageSettingsProvidersMBSTests.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/LanguageSettingsProvidersMBSTest.java189
-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
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml73
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestConfiguration.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestToolchain.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/plugin.xml9
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java174
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java265
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java97
22 files changed, 1210 insertions, 696 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/AllLanguageSettingsProvidersMBSTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/AllLanguageSettingsProvidersMBSTests.java
index 4ab865896a..6937c34379 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/AllLanguageSettingsProvidersMBSTests.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/AllLanguageSettingsProvidersMBSTests.java
@@ -25,6 +25,7 @@ public class AllLanguageSettingsProvidersMBSTests extends TestSuite {
public AllLanguageSettingsProvidersMBSTests() {
super(AllLanguageSettingsProvidersMBSTests.class.getName());
+ addTestSuite(LanguageSettingsProvidersMBSTest.class);
addTestSuite(GCCBuildCommandParserTest.class);
addTestSuite(BuiltinSpecsDetectorTest.class);
addTestSuite(GCCBuiltinSpecsDetectorTest.class);
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/LanguageSettingsProvidersMBSTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/LanguageSettingsProvidersMBSTest.java
new file mode 100644
index 0000000000..82d5eec4ee
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/LanguageSettingsProvidersMBSTest.java
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2012 Andrew Gvozdev and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.managedbuilder.language.settings.providers.tests;
+
+import java.util.ArrayList;
+import java.util.List;
+
+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.LanguageSettingsPersistenceProjectTests;
+import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICProjectDescription;
+import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
+import org.eclipse.cdt.managedbuilder.testplugin.ManagedBuildTestHelper;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * Test creation of a new project in respect with language settings providers.
+ */
+public class LanguageSettingsProvidersMBSTest extends BaseTestCase {
+ private static final String MBS_LANGUAGE_SETTINGS_PROVIDER_ID = ScannerDiscoveryLegacySupport.MBS_LANGUAGE_SETTINGS_PROVIDER_ID;
+ private static final String USER_LANGUAGE_SETTINGS_PROVIDER_ID = ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID;
+ private static final String GCC_SPECS_DETECTOR_ID = "org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector";
+ private static final String PROJECT_TYPE_EXECUTABLE_GNU = "cdt.managedbuild.target.gnu.exe";
+ private static final String LANGUAGE_SETTINGS_PROJECT_XML = LanguageSettingsPersistenceProjectTests.LANGUAGE_SETTINGS_PROJECT_XML;
+ private static final String LANGUAGE_SETTINGS_WORKSPACE_XML = LanguageSettingsPersistenceProjectTests.LANGUAGE_SETTINGS_WORKSPACE_XML;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ ManagedBuildTestHelper.removeProject(this.getName());
+ super.tearDown();
+ }
+
+ /**
+ * Imitate a new Project Wizard. New Project Wizards really do these things in CDT.
+ */
+ private static IProject imitateNewProjectWizard(String name, String projectTypeId) throws CoreException {
+ IProject project = ManagedBuildTestHelper.createProject(name, projectTypeId);
+ ManagedBuildTestHelper.addManagedBuildNature(project);
+
+ ICProjectDescription prjDescription = CoreModel.getDefault().getProjectDescription(project, true);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription[] cfgDescriptions = prjDescription.getConfigurations();
+ for (ICConfigurationDescription cfgDescription : cfgDescriptions) {
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgDescription);
+ ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, cfg, cfgDescription);
+
+ assertTrue(((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders().size() > 0);
+ }
+
+ CoreModel.getDefault().setProjectDescription(project, prjDescription);
+
+ return project;
+ }
+
+ /**
+ * Test new GNU Executable project.
+ */
+ public void testGnuToolchainProviders() throws Exception {
+ // create a new project imitating wizard
+ IProject project = imitateNewProjectWizard(this.getName(), PROJECT_TYPE_EXECUTABLE_GNU);
+
+ // check that the language settings providers are in place.
+ ICProjectDescription prjDescription = CoreModel.getDefault().getProjectDescription(project, false);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription[] cfgDescriptions = prjDescription.getConfigurations();
+ for (ICConfigurationDescription cfgDescription : cfgDescriptions) {
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ {
+ ILanguageSettingsProvider provider = providers.get(0);
+ String id = provider.getId();
+ assertEquals(USER_LANGUAGE_SETTINGS_PROVIDER_ID, id);
+ assertEquals(false, LanguageSettingsManager.isPreferShared(id));
+ assertEquals(false, LanguageSettingsManager.isWorkspaceProvider(provider));
+ }
+ {
+ ILanguageSettingsProvider provider = providers.get(1);
+ String id = provider.getId();
+ assertEquals(MBS_LANGUAGE_SETTINGS_PROVIDER_ID, id);
+ assertEquals(true, LanguageSettingsManager.isPreferShared(id));
+ assertEquals(true, LanguageSettingsManager.isWorkspaceProvider(provider));
+ }
+ {
+ ILanguageSettingsProvider provider = providers.get(2);
+ String id = provider.getId();
+ assertEquals(GCC_SPECS_DETECTOR_ID, id);
+ assertEquals(true, LanguageSettingsManager.isPreferShared(id));
+ assertEquals(true, LanguageSettingsManager.isWorkspaceProvider(provider));
+ }
+ assertEquals(3, providers.size());
+ }
+ }
+
+ /**
+ * Test that no unnecessary storage file is created for language settings for default set
+ * of language settings providers.
+ */
+ public void testProjectPersistence_Defaults() throws Exception {
+ // create a new project imitating wizard
+ IProject project = imitateNewProjectWizard(this.getName(), PROJECT_TYPE_EXECUTABLE_GNU);
+
+ // double-check that the project contains language settings providers
+ ICProjectDescription prjDescription = CoreModel.getDefault().getProjectDescription(project, false);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription[] cfgDescriptions = prjDescription.getConfigurations();
+ for (ICConfigurationDescription cfgDescription : cfgDescriptions) {
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ String[] defaultIds = ((ILanguageSettingsProvidersKeeper) cfgDescription).getDefaultLanguageSettingsProvidersIds();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ assertEquals(defaultIds.length, providers.size());
+ for (int i = 0; i < defaultIds.length; i++) {
+ assertEquals(providers.get(i).getId(), defaultIds[i]);
+ }
+ assertTrue(defaultIds.length > 0);
+ }
+
+ // no settings file in project area
+ IFile xmlStorageFile = project.getFile(LANGUAGE_SETTINGS_PROJECT_XML);
+ assertEquals(false, xmlStorageFile.exists());
+ assertEquals(false, xmlStorageFile.getParent().exists()); // .settings folder
+
+ // no settings file in workspace area
+ String xmlPrjWspStorageFileLocation = LanguageSettingsPersistenceProjectTests.getStoreLocationInWorkspaceArea(project.getName()+'.'+LANGUAGE_SETTINGS_WORKSPACE_XML);
+ java.io.File xmlStorageFilePrjWsp = new java.io.File(xmlPrjWspStorageFileLocation);
+ assertEquals(false, xmlStorageFilePrjWsp.exists());
+ }
+
+ /**
+ * Test that storage file is created for language settings for empty set of language settings providers.
+ */
+ public void testProjectPersistence_NoProviders() throws Exception {
+ // create a new project imitating wizard
+ IProject project = imitateNewProjectWizard(this.getName(), PROJECT_TYPE_EXECUTABLE_GNU);
+
+ // remove language settings providers from the project
+ ICProjectDescription prjDescription = CoreModel.getDefault().getProjectDescription(project, true);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription[] cfgDescriptions = prjDescription.getConfigurations();
+ for (ICConfigurationDescription cfgDescription : cfgDescriptions) {
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(new ArrayList<ILanguageSettingsProvider>());
+ assertTrue(((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders().size() == 0);
+ }
+
+ CoreModel.getDefault().setProjectDescription(project, prjDescription);
+
+ // settings file appears in project area
+ IFile xmlStorageFile = project.getFile(LANGUAGE_SETTINGS_PROJECT_XML);
+ assertEquals(true, xmlStorageFile.exists());
+
+ // no settings file in workspace area
+ String xmlPrjWspStorageFileLocation = LanguageSettingsPersistenceProjectTests.getStoreLocationInWorkspaceArea(project.getName()+'.'+LANGUAGE_SETTINGS_WORKSPACE_XML);
+ java.io.File xmlStorageFilePrjWsp = new java.io.File(xmlPrjWspStorageFileLocation);
+ assertEquals(false, xmlStorageFilePrjWsp.exists());
+
+ }
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/plugin.xml b/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
index ae8c2baf88..14cde1542a 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 6e8e0e3285..8a3777470f 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 6c27670a7b..54397ce390 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 8b7f0499dc..87db9d380d 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 57cba447fc..c41dba208a 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 8a55afcaea..c6202bbb74 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 7932e7b2f3..63953098db 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 0b1f6c233e..3c5b553177 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 97201a4e60..30f027a94c 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 82a1c9c805..5c29520d0b 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;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
index 146c331769..db5faa8aa5 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
@@ -1269,7 +1269,6 @@
dependencyExtensions="h"
dependencyCalculator="org.eclipse.cdt.managedbuilder.makegen.gnu.DefaultGCCDependencyCalculator2"
id="cdt.managedbuild.tool.gnu.c.compiler.input"
- scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC|org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"
languageId="org.eclipse.cdt.core.gcc">
</inputType>
<outputType
@@ -1591,7 +1590,6 @@
dependencyExtensions="h,H,hpp"
dependencyCalculator="org.eclipse.cdt.managedbuilder.makegen.gnu.DefaultGCCDependencyCalculator2"
id="cdt.managedbuild.tool.gnu.cpp.compiler.input"
- scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP|org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"
languageId="org.eclipse.cdt.core.g++">
</inputType>
<outputType
@@ -1658,7 +1656,7 @@
<inputType
id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"
superClass="cdt.managedbuild.tool.gnu.c.compiler.input"
- scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"/>
+ />
</tool>
<tool
id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin"
@@ -1672,7 +1670,7 @@
<inputType
id="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin"
superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"
- scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"/>
+ />
</tool>
<builder
@@ -1704,11 +1702,12 @@
</builder>
<toolChain
- archList="all"
- osList="linux,hpux,aix,qnx"
- name="%ToolChainName.Linux"
- targetTool="cdt.managedbuild.tool.gnu.c.linker;cdt.managedbuild.tool.gnu.cpp.linker;cdt.managedbuild.tool.gnu.archiver"
- id="cdt.managedbuild.toolchain.gnu.base">
+ archList="all"
+ id="cdt.managedbuild.toolchain.gnu.base"
+ languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
+ name="%ToolChainName.Linux"
+ osList="linux,hpux,aix,qnx"
+ targetTool="cdt.managedbuild.tool.gnu.c.linker;cdt.managedbuild.tool.gnu.cpp.linker;cdt.managedbuild.tool.gnu.archiver">
<targetPlatform
id="cdt.managedbuild.target.gnu.platform.base"
name="%PlatformName.Dbg"
@@ -1773,6 +1772,7 @@
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.cygwin.GnuCygwinConfigurationEnvironmentSupplier"
id="cdt.managedbuild.toolchain.gnu.cygwin.base"
isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.cygwin.IsGnuCygwinToolChainSupported"
+ languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
name="%ToolChainName.Cygwin"
osList="win32"
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base;cdt.managedbuild.tool.gnu.c.linker.cygwin.base;cdt.managedbuild.tool.gnu.archiver">
@@ -1842,6 +1842,7 @@
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwEnvironmentVariableSupplier"
id="cdt.managedbuild.toolchain.gnu.mingw.base"
isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwIsToolChainSupported"
+ languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
name="%ToolChainName.MinGW"
osList="win32"
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base;cdt.managedbuild.tool.gnu.c.linker.mingw.base;cdt.managedbuild.tool.gnu.archiver">
@@ -2083,9 +2084,9 @@
</toolChain>
<configuration
- id="cdt.managedbuild.config.gnu.base"
cleanCommand="rm -rf"
- >
+ id="cdt.managedbuild.config.gnu.base"
+ languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser">
<enablement type="CONTAINER_ATTRIBUTE"
attribute="artifactExtension"
value="so"
@@ -2480,27 +2481,27 @@
</projectType>
<configuration
- id="cdt.managedbuild.config.gnu.cygwin.base"
- cleanCommand="rm -rf"
- artifactExtension="exe"
- >
- <enablement type="CONTAINER_ATTRIBUTE"
- attribute="artifactExtension"
- value="dll"
- extensionAdjustment="false">
- <checkBuildProperty
- property="org.eclipse.cdt.build.core.buildArtefactType"
- value="org.eclipse.cdt.build.core.buildArtefactType.sharedLib"/>
- </enablement>
- <enablement type="CONTAINER_ATTRIBUTE"
- attribute="artifactExtension"
- value="a"
- extensionAdjustment="false">
- <checkBuildProperty
- property="org.eclipse.cdt.build.core.buildArtefactType"
- value="org.eclipse.cdt.build.core.buildArtefactType.staticLib"/>
- </enablement>
- </configuration>
+ artifactExtension="exe"
+ cleanCommand="rm -rf"
+ id="cdt.managedbuild.config.gnu.cygwin.base"
+ languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser">
+ <enablement type="CONTAINER_ATTRIBUTE"
+ attribute="artifactExtension"
+ value="dll"
+ extensionAdjustment="false">
+ <checkBuildProperty
+ property="org.eclipse.cdt.build.core.buildArtefactType"
+ value="org.eclipse.cdt.build.core.buildArtefactType.sharedLib"/>
+ </enablement>
+ <enablement type="CONTAINER_ATTRIBUTE"
+ attribute="artifactExtension"
+ value="a"
+ extensionAdjustment="false">
+ <checkBuildProperty
+ property="org.eclipse.cdt.build.core.buildArtefactType"
+ value="org.eclipse.cdt.build.core.buildArtefactType.staticLib"/>
+ </enablement>
+ </configuration>
<projectType
buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe"
@@ -2878,10 +2879,10 @@
</projectType>
<configuration
- id="cdt.managedbuild.config.gnu.mingw.base"
- cleanCommand="rm -rf"
- artifactExtension="exe"
- >
+ artifactExtension="exe"
+ cleanCommand="rm -rf"
+ id="cdt.managedbuild.config.gnu.mingw.base"
+ languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser">
<enablement type="CONTAINER_ATTRIBUTE"
attribute="artifactExtension"
value="dll"
diff --git a/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestConfiguration.java b/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestConfiguration.java
index 45d1c8e541..ba72ebfcdb 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestConfiguration.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestConfiguration.java
@@ -208,6 +208,12 @@ public class TestConfiguration implements IConfiguration {
}
@Override
+ public String[] getDefaultLanguageSettingsProviderIds() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
public ITool[] getFilteredTools() {
// TODO Auto-generated method stub
return null;
diff --git a/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestToolchain.java b/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestToolchain.java
index 2d87555545..f10bd5aa90 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestToolchain.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/util/TestToolchain.java
@@ -363,7 +363,11 @@ public class TestToolchain extends HoldsOptions implements IToolChain {
// TODO Auto-generated method stub
return false;
}
-
-
+
+ @Override
+ public String getDefaultLanguageSettingsProviderIds() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
index aa14d2bdc2..cbb257072d 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
@@ -577,8 +577,13 @@
>
<enabledWhen>
<adapt type="org.eclipse.core.resources.IProject">
- <test property="org.eclipse.core.resources.projectNature"
- value="org.eclipse.cdt.managedbuilder.core.managedBuildNature"/>
+ <and>
+ <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.cdt.managedbuilder.core.managedBuildNature"/>
+ <or>
+ <test property="org.eclipse.cdt.ui.checkPreference" value="org.eclipse.cdt.ui:properties.sd.page.enable="/>
+ <test property="org.eclipse.cdt.ui.checkPreference" value="org.eclipse.cdt.ui:properties.sd.page.enable=true"/>
+ </or>
+ </and>
</adapt>
</enabledWhen>
</page>
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
index 5986337af0..69436a7ed9 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
@@ -223,6 +223,7 @@ public class Messages extends NLS {
public static String PropertyPageDefsTab_9;
public static String PropertyPageDefsTab_showIncludeFileTab;
public static String PropertyPageDefsTab_showProvidersTab;
+ public static String PropertyPageDefsTab_showScannerDiscoveryTab;
public static String RefreshPolicyExceptionDialog_addDialogLabel;
public static String RefreshPolicyExceptionDialog_AddExceptionInfoDialog_message;
public static String RefreshPolicyExceptionDialog_AddExceptionInfoDialog_title;
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
index a39e524536..59bc380dca 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
@@ -274,7 +274,8 @@ PropertyPageDefsTab_7=Show disc. page names if they are unique. Else show profil
PropertyPageDefsTab_8=Always show names + profile IDs
PropertyPageDefsTab_9=Always show profile IDs only
PropertyPageDefsTab_showIncludeFileTab=Display "Include Files" tab
-PropertyPageDefsTab_showProvidersTab=Display "Preprocessor Include Paths" tabs
+PropertyPageDefsTab_showProvidersTab=Display "Preprocessor Include Paths" tab and enable language settings providers
+PropertyPageDefsTab_showScannerDiscoveryTab=Display "Scanner Discovery" tab
ProjectConvert_convertersList=Converters List
AbstractPrefPage_0=\ Preference settings will be applied to new projects \n only when there were no toolchains selected.
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java
index 9c6bb0af7e..c54c02609f 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java
@@ -11,8 +11,8 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.preferences;
+import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
-import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
@@ -34,109 +34,116 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
private static final int SPACING = 5; // for radio buttons layout
- private Button show_tree;
- private Button show_inc_files;
- private Button show_mng;
- private Button show_tool;
- private Button show_exp;
- private Button show_providers_tab; // temporary checkbox for scanner discovery Providers tab
- private Button show_tipbox;
+ private Button show_tree;
+ private Button show_inc_files;
+ private Button show_mng;
+ private Button show_tool;
+ private Button show_exp;
+ private Button show_sd;
+ private Button show_providers_tab; // temporary checkbox for scanner discovery Providers tab
+ private Button show_tipbox;
- private Button b_0;
- private Button b_1;
- private Button b_2;
- private Button b_3;
+ private Button b_0;
+ private Button b_1;
+ private Button b_2;
+ private Button b_3;
- private Button s_0;
- private Button s_1;
- private Button s_2;
+ private Button s_0;
+ private Button s_1;
+ private Button s_2;
@Override
public void createControls(Composite parent) {
super.createControls(parent);
usercomp.setLayout(new GridLayout(1, false));
- show_mng = new Button(usercomp, SWT.CHECK);
- show_mng.setText(Messages.PropertyPageDefsTab_0);
- show_mng.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ show_mng = new Button(usercomp, SWT.CHECK);
+ show_mng.setText(Messages.PropertyPageDefsTab_0);
+ show_mng.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- show_inc_files = new Button(usercomp, SWT.CHECK);
- show_inc_files.setText(Messages.PropertyPageDefsTab_showIncludeFileTab);
- show_inc_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ show_inc_files = new Button(usercomp, SWT.CHECK);
+ show_inc_files.setText(Messages.PropertyPageDefsTab_showIncludeFileTab);
+ show_inc_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_tree = new Button(usercomp, SWT.CHECK);
- show_tree.setText(Messages.PropertyPageDefsTab_1);
- show_tree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ show_tree.setText(Messages.PropertyPageDefsTab_1);
+ show_tree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_tool = new Button(usercomp, SWT.CHECK);
- show_tool.setText(Messages.PropertyPageDefsTab_4);
- show_tool.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ show_tool.setText(Messages.PropertyPageDefsTab_4);
+ show_tool.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_exp = new Button(usercomp, SWT.CHECK);
- show_exp.setText(Messages.PropertyPageDefsTab_10);
- show_exp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- show_providers_tab = new Button(usercomp, SWT.CHECK);
- show_providers_tab.setText(Messages.PropertyPageDefsTab_showProvidersTab);
- show_providers_tab.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- show_tipbox = new Button(usercomp, SWT.CHECK);
- show_tipbox.setText(Messages.PropertyPageDefsTab_16);
- show_tipbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Group saveGrp = new Group(usercomp, SWT.NONE);
- saveGrp.setText(Messages.PropertyPageDefsTab_11);
- saveGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- FillLayout fl = new FillLayout(SWT.VERTICAL);
- fl.spacing = SPACING;
- fl.marginHeight = SPACING;
- fl.marginWidth = SPACING;
- saveGrp.setLayout(fl);
-
- s_0 = new Button(saveGrp, SWT.RADIO);
- s_0.setText(Messages.PropertyPageDefsTab_13);
- s_1 = new Button(saveGrp, SWT.RADIO);
- s_1.setText(Messages.PropertyPageDefsTab_12);
- s_2 = new Button(saveGrp, SWT.RADIO);
- s_2.setText(Messages.PropertyPageDefsTab_14);
-
- Group discGrp = new Group(usercomp, SWT.NONE);
- discGrp.setText(Messages.PropertyPageDefsTab_5);
- discGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fl = new FillLayout(SWT.VERTICAL);
- fl.spacing = SPACING;
- fl.marginHeight = SPACING;
- fl.marginWidth = SPACING;
- discGrp.setLayout(fl);
-
- b_0 = new Button(discGrp, SWT.RADIO);
- b_0.setText(Messages.PropertyPageDefsTab_6);
- b_1 = new Button(discGrp, SWT.RADIO);
- b_1.setText(Messages.PropertyPageDefsTab_7);
- b_2 = new Button(discGrp, SWT.RADIO);
- b_2.setText(Messages.PropertyPageDefsTab_8);
- b_3 = new Button(discGrp, SWT.RADIO);
- b_3.setText(Messages.PropertyPageDefsTab_9);
-
- show_inc_files.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_SHOW_INC_FILES));
- show_tree.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_DTREE));
+ show_exp.setText(Messages.PropertyPageDefsTab_10);
+ show_exp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ show_sd = new Button(usercomp, SWT.CHECK);
+ show_sd.setText(Messages.PropertyPageDefsTab_showScannerDiscoveryTab);
+ show_sd.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ show_providers_tab = new Button(usercomp, SWT.CHECK);
+ show_providers_tab.setText(Messages.PropertyPageDefsTab_showProvidersTab);
+ show_providers_tab.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ show_tipbox = new Button(usercomp, SWT.CHECK);
+ show_tipbox.setText(Messages.PropertyPageDefsTab_16);
+ show_tipbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Group saveGrp = new Group(usercomp, SWT.NONE);
+ saveGrp.setText(Messages.PropertyPageDefsTab_11);
+ saveGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ FillLayout fl = new FillLayout(SWT.VERTICAL);
+ fl.spacing = SPACING;
+ fl.marginHeight = SPACING;
+ fl.marginWidth = SPACING;
+ saveGrp.setLayout(fl);
+
+ s_0 = new Button(saveGrp, SWT.RADIO);
+ s_0.setText(Messages.PropertyPageDefsTab_13);
+ s_1 = new Button(saveGrp, SWT.RADIO);
+ s_1.setText(Messages.PropertyPageDefsTab_12);
+ s_2 = new Button(saveGrp, SWT.RADIO);
+ s_2.setText(Messages.PropertyPageDefsTab_14);
+
+ Group discGrp = new Group(usercomp, SWT.NONE);
+ discGrp.setText(Messages.PropertyPageDefsTab_5);
+ discGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ fl = new FillLayout(SWT.VERTICAL);
+ fl.spacing = SPACING;
+ fl.marginHeight = SPACING;
+ fl.marginWidth = SPACING;
+ discGrp.setLayout(fl);
+
+ b_0 = new Button(discGrp, SWT.RADIO);
+ b_0.setText(Messages.PropertyPageDefsTab_6);
+ b_1 = new Button(discGrp, SWT.RADIO);
+ b_1.setText(Messages.PropertyPageDefsTab_7);
+ b_2 = new Button(discGrp, SWT.RADIO);
+ b_2.setText(Messages.PropertyPageDefsTab_8);
+ b_3 = new Button(discGrp, SWT.RADIO);
+ b_3.setText(Messages.PropertyPageDefsTab_9);
+
+ show_inc_files.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_SHOW_INC_FILES));
+ show_tree.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_DTREE));
show_mng.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOMNG));
show_tool.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOTOOLM));
show_exp.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_EXPORT));
- show_providers_tab.setSelection(!CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS));
+ // ensure default is "true" for scanner discovery tab
+ show_sd.setSelection(!CDTPrefUtil.getStr(CDTPrefUtil.KEY_SHOW_SD).equals(Boolean.FALSE.toString()));
+ show_providers_tab.setSelection(ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(null));
show_tipbox.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_TIPBOX));
switch (CDTPrefUtil.getInt(CDTPrefUtil.KEY_DISC_NAMES)) {
- case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_BOTH: b_0.setSelection(true); break;
- case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_IDS: b_1.setSelection(true); break;
- case CDTPrefUtil.DISC_NAMING_ALWAYS_BOTH: b_2.setSelection(true); break;
- case CDTPrefUtil.DISC_NAMING_ALWAYS_IDS: b_3.setSelection(true); break;
+ case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_BOTH: b_0.setSelection(true); break;
+ case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_IDS: b_1.setSelection(true); break;
+ case CDTPrefUtil.DISC_NAMING_ALWAYS_BOTH: b_2.setSelection(true); break;
+ case CDTPrefUtil.DISC_NAMING_ALWAYS_IDS: b_3.setSelection(true); break;
}
switch (CDTPrefUtil.getInt(CDTPrefUtil.KEY_POSSAVE)) {
- case CDTPrefUtil.POSITION_SAVE_BOTH: s_1.setSelection(true); break;
- case CDTPrefUtil.POSITION_SAVE_NONE: s_2.setSelection(true); break;
- default: s_0.setSelection(true); break;
+ case CDTPrefUtil.POSITION_SAVE_BOTH: s_1.setSelection(true); break;
+ case CDTPrefUtil.POSITION_SAVE_NONE: s_2.setSelection(true); break;
+ default: s_0.setSelection(true); break;
}
}
@@ -147,7 +154,9 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOMNG, !show_mng.getSelection());
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOTOOLM, !show_tool.getSelection());
CDTPrefUtil.setBool(CDTPrefUtil.KEY_EXPORT, show_exp.getSelection());
- CDTPrefUtil.setBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS, !show_providers_tab.getSelection());
+ // ensure default is "true" for scanner discovery tab
+ CDTPrefUtil.setStr(CDTPrefUtil.KEY_SHOW_SD, Boolean.toString(show_sd.getSelection()));
+ ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(null, show_providers_tab.getSelection());
CDTPrefUtil.setBool(CDTPrefUtil.KEY_TIPBOX, show_tipbox.getSelection());
int x = 0;
if (b_1.getSelection()) x = 1;
@@ -168,7 +177,8 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
show_mng.setSelection(true);
show_tool.setSelection(true);
show_exp.setSelection(false);
- show_providers_tab.setSelection(false);
+ show_sd.setSelection(true);
+ show_providers_tab.setSelection(true);
show_tipbox.setSelection(false);
b_0.setSelection(true);
b_1.setSelection(false);
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java
index 73be50d9ad..8d204ec1f7 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java
@@ -41,8 +41,9 @@ import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
-import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
+import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
+import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
import org.eclipse.cdt.ui.templateengine.IWizardDataPage;
import org.eclipse.cdt.ui.templateengine.Template;
@@ -73,10 +74,10 @@ import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
/**
* This object is created per each Project type
- *
+ *
* It is responsible for:
* - corresponding line in left pane of 1st wizard page
- * - whole view of right pane, including
+ * - whole view of right pane, including
*
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
@@ -84,16 +85,17 @@ import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
public class MBSWizardHandler extends CWizardHandler {
public static final String ARTIFACT = "org.eclipse.cdt.build.core.buildArtefactType"; //$NON-NLS-1$
public static final String EMPTY_STR = ""; //$NON-NLS-1$
-
+
private static final String PROPERTY = "org.eclipse.cdt.build.core.buildType"; //$NON-NLS-1$
private static final String PROP_VAL = PROPERTY + ".debug"; //$NON-NLS-1$
- private static final String tooltip =
- Messages.CWizardHandler_1 +
- Messages.CWizardHandler_2 +
- Messages.CWizardHandler_3 +
- Messages.CWizardHandler_4 +
- Messages.CWizardHandler_5;
-
+
+ private static final String tooltip =
+ Messages.CWizardHandler_1 +
+ Messages.CWizardHandler_2 +
+ Messages.CWizardHandler_3 +
+ Messages.CWizardHandler_4 +
+ Messages.CWizardHandler_5;
+
protected SortedMap<String, IToolChain> full_tcs = new TreeMap<String, IToolChain>();
private String propertyId = null;
private IProjectType pt = null;
@@ -102,16 +104,16 @@ public class MBSWizardHandler extends CWizardHandler {
private IToolChain[] savedToolChains = null;
private IWizard wizard;
private IWizardPage startingPage;
-// private EntryDescriptor entryDescriptor = null;
+ // private EntryDescriptor entryDescriptor = null;
private EntryInfo entryInfo;
protected CfgHolder[] cfgs = null;
protected IWizardPage[] customPages;
-
+
/**
* Current list of preferred toolchains
*/
private List<String> preferredTCs = new ArrayList<String>();
-
+
protected static final class EntryInfo {
private SortedMap<String, IToolChain> tcs;
private EntryDescriptor entryDescriptor;
@@ -124,12 +126,12 @@ public class MBSWizardHandler extends CWizardHandler {
private IWizardPage predatingPage;
private IWizardPage followingPage;
private IWizard wizard;
-
+
public EntryInfo(EntryDescriptor dr, SortedMap<String, IToolChain> _tcs){
entryDescriptor = dr;
tcs = _tcs;
}
-
+
/**
* @since 5.1
*/
@@ -137,7 +139,7 @@ public class MBSWizardHandler extends CWizardHandler {
this(dr, _tcs);
wizard = w;
}
-
+
public boolean isValid(){
initialize();
return isValid;
@@ -147,7 +149,7 @@ public class MBSWizardHandler extends CWizardHandler {
initialize();
return template;
}
-
+
public EntryDescriptor getDescriptor(){
return entryDescriptor;
}
@@ -155,19 +157,19 @@ public class MBSWizardHandler extends CWizardHandler {
private void initialize(){
if(initialized)
return;
-
+
do {
if(entryDescriptor == null)
break;
String path[] = entryDescriptor.getPathArray();
if(path == null || path.length == 0)
break;
-
+
projectTypeId = path[0];
- if(!entryDescriptor.isDefaultForCategory() &&
+ if(!entryDescriptor.isDefaultForCategory() &&
path.length > 1 && (!path[0].equals(ManagedBuildWizard.OTHERS_LABEL))){
- templateId = path[path.length - 1];
- Template templates[] = null;
+ templateId = path[path.length - 1];
+ Template templates[] = null;
if(wizard instanceof ICDTCommonProjectWizard) {
ICDTCommonProjectWizard wz = (ICDTCommonProjectWizard)wizard;
String[] langIDs = wz.getLanguageIDs();
@@ -175,42 +177,42 @@ public class MBSWizardHandler extends CWizardHandler {
List<Template> lstTemplates = new ArrayList<Template>();
for (String id : langIDs) {
lstTemplates.addAll(Arrays.asList(TemplateEngineUI.getDefault().
- getTemplates(projectTypeId, null, id)));
- }
+ getTemplates(projectTypeId, null, id)));
+ }
templates = lstTemplates.toArray(new Template[lstTemplates.size()]);
}
- }
+ }
if(null == templates) {
- templates = TemplateEngineUI.getDefault().getTemplates(projectTypeId);
+ templates = TemplateEngineUI.getDefault().getTemplates(projectTypeId);
}
if((null == templates) || (templates.length == 0))
break;
-
+
for (Template t : templates) {
if(t.getTemplateId().equals(templateId)){
template = t;
break;
}
}
-
+
if(template == null)
break;
}
-
+
isValid = true;
} while(false);
initialized = true;
}
-
+
public Template getInitializedTemplate(IWizardPage predatingPage, IWizardPage followingPage, Map<String, String> map){
getNextPage(predatingPage, followingPage);
-
+
Template template = getTemplate();
-
+
if(template != null){
Map<String, String> valueStore = template.getValueStore();
-// valueStore.clear();
+ // valueStore.clear();
for (IWizardPage page : templatePages) {
if (page instanceof UIWizardPage)
valueStore.putAll(((UIWizardPage)page).getPageData());
@@ -223,11 +225,11 @@ public class MBSWizardHandler extends CWizardHandler {
}
return template;
}
-
+
public IWizardPage getNextPage(IWizardPage predatingPage, IWizardPage followingPage) {
initialize();
- if(this.templatePages == null
- || this.predatingPage != predatingPage
+ if(this.templatePages == null
+ || this.predatingPage != predatingPage
|| this.followingPage != followingPage){
this.predatingPage = predatingPage;
this.followingPage = followingPage;
@@ -238,12 +240,12 @@ public class MBSWizardHandler extends CWizardHandler {
followingPage.setPreviousPage(predatingPage);
}
}
-
+
if(templatePages.length != 0)
return templatePages[0];
return followingPage;
}
-
+
private boolean canFinish(IWizardPage predatingPage, IWizardPage followingPage){
getNextPage(predatingPage, followingPage);
for(int i = 0; i < templatePages.length; i++){
@@ -252,50 +254,50 @@ public class MBSWizardHandler extends CWizardHandler {
}
return true;
}
-
+
/**
- * Filters toolchains
- *
+ * Filters toolchains
+ *
* @return - set of compatible toolchain's IDs
*/
protected Set<String> tc_filter() {
Set<String> full = tcs.keySet();
- if (entryDescriptor == null)
+ if (entryDescriptor == null)
return full;
Set<String> out = new LinkedHashSet<String>(full.size());
for (String s : full)
- if (isToolChainAcceptable(s))
+ if (isToolChainAcceptable(s))
out.add(s);
return out;
}
/**
* Checks whether given toolchain can be displayed
- *
+ *
* @param tcId - toolchain _NAME_ to check
* @return - true if toolchain can be displayed
*/
public boolean isToolChainAcceptable(String tcId) {
- if (template == null || template.getTemplateInfo() == null)
+ if (template == null || template.getTemplateInfo() == null)
return true;
-
+
String[] toolChainIds = template.getTemplateInfo().getToolChainIds();
- if (toolChainIds == null || toolChainIds.length == 0)
+ if (toolChainIds == null || toolChainIds.length == 0)
return true;
-
+
Object ob = tcs.get(tcId);
if (ob == null)
return true; // sic ! This can occur with Other Toolchain only
if (!(ob instanceof IToolChain))
return false;
-
+
String id1 = ((IToolChain)ob).getId();
IToolChain sup = ((IToolChain)ob).getSuperClass();
String id2 = sup == null ? null : sup.getId();
-
+
for (String id : toolChainIds) {
if ((id != null && id.equals(id1)) ||
- (id != null && id.equals(id2)))
+ (id != null && id.equals(id2)))
return true;
}
return false;
@@ -305,20 +307,20 @@ public class MBSWizardHandler extends CWizardHandler {
return tc_filter().size();
}
}
-
+
public MBSWizardHandler(IProjectType _pt, Composite p, IWizard w) {
- super(p, Messages.CWizardHandler_0, _pt.getName());
+ super(p, Messages.CWizardHandler_0, _pt.getName());
pt = _pt;
setWizard(w);
}
public MBSWizardHandler(String name, Composite p, IWizard w) {
- super(p, Messages.CWizardHandler_0, name);
+ super(p, Messages.CWizardHandler_0, name);
setWizard(w);
}
public MBSWizardHandler(IBuildPropertyValue val, Composite p, IWizard w) {
- super(p, Messages.CWizardHandler_0, val.getName());
+ super(p, Messages.CWizardHandler_0, val.getName());
propertyId = val.getId();
setWizard(w);
}
@@ -330,16 +332,16 @@ public class MBSWizardHandler extends CWizardHandler {
startingPage = w.getStartingPage();
}
}
-
+
protected IWizardPage getStartingPage(){
return startingPage;
}
-
+
public Map<String, String> getMainPageData() {
WizardNewProjectCreationPage page = (WizardNewProjectCreationPage)getStartingPage();
Map<String, String> data = new HashMap<String, String>();
String projName = page.getProjectName();
- projName = projName != null ? projName.trim() : EMPTY_STR;
+ projName = projName != null ? projName.trim() : EMPTY_STR;
data.put("projectName", projName); //$NON-NLS-1$
data.put("baseName", getBaseName(projName)); //$NON-NLS-1$
data.put("baseNameUpper", getBaseName(projName).toUpperCase() ); //$NON-NLS-1$
@@ -350,7 +352,7 @@ public class MBSWizardHandler extends CWizardHandler {
data.put("location", location); //getProjectLocation().toPortableString()); //$NON-NLS-1$
return data;
}
-
+
private String getBaseName(String name) {
String baseName = name;
int dot = baseName.lastIndexOf('.');
@@ -363,11 +365,11 @@ public class MBSWizardHandler extends CWizardHandler {
}
return baseName;
}
-
+
@Override
public void handleSelection() {
List<String> preferred = CDTPrefUtil.getPreferredTCs();
-
+
if (table == null) {
table = new Table(parent, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
table.getAccessible().addAccessibleListener(
@@ -400,7 +402,7 @@ public class MBSWizardHandler extends CWizardHandler {
counter++;
}
if (counter > 0) table.select(position);
- }
+ }
table.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -421,11 +423,11 @@ public class MBSWizardHandler extends CWizardHandler {
if (listener != null)
listener.toolChainListChanged(table.getSelectionCount());
}
-
+
private void loadCustomPages() {
- if (! (getWizard() instanceof ICDTCommonProjectWizard))
- return; // not probable
-
+ if (! (getWizard() instanceof ICDTCommonProjectWizard))
+ return; // not probable
+
ICDTCommonProjectWizard wz = (ICDTCommonProjectWizard)getWizard();
MBSCustomPageManager.init();
MBSCustomPageManager.addStockPage(getStartingPage(), CDTMainWizardPage.PAGE_ID);
@@ -438,9 +440,9 @@ public class MBSWizardHandler extends CWizardHandler {
customPages = MBSCustomPageManager.getCustomPages();
- if (customPages == null)
+ if (customPages == null)
customPages = new IWizardPage[0];
-
+
for (IWizardPage customPage : customPages)
customPage.setWizard(wz);
setCustomPagesFilter(wz);
@@ -463,13 +465,13 @@ public class MBSWizardHandler extends CWizardHandler {
boolean ptIsNull = (getProjectType() == null);
if (!ptIsNull)
MBSCustomPageManager.addPageProperty(
- MBSCustomPageManager.PAGE_ID,
- MBSCustomPageManager.PROJECT_TYPE,
+ MBSCustomPageManager.PAGE_ID,
+ MBSCustomPageManager.PROJECT_TYPE,
getProjectType().getId()
- );
+ );
IToolChain[] tcs = getSelectedToolChains();
- ArrayList<IToolChain> x = new ArrayList<IToolChain>();
+ ArrayList<IToolChain> x = new ArrayList<IToolChain>();
TreeSet<String> y = new TreeSet<String>();
if (tcs!=null) {
int n = tcs.length;
@@ -477,7 +479,7 @@ public class MBSWizardHandler extends CWizardHandler {
if (tcs[i] == null) // --- NO TOOLCHAIN ---
continue; // has no custom pages.
x.add(tcs[i]);
-
+
IConfiguration cfg = tcs[i].getParent();
if (cfg == null)
continue;
@@ -487,24 +489,24 @@ public class MBSWizardHandler extends CWizardHandler {
}
}
MBSCustomPageManager.addPageProperty(
- MBSCustomPageManager.PAGE_ID,
- MBSCustomPageManager.TOOLCHAIN,
+ MBSCustomPageManager.PAGE_ID,
+ MBSCustomPageManager.TOOLCHAIN,
x);
-
+
if (ptIsNull) {
if (y.size() > 0)
MBSCustomPageManager.addPageProperty(
- MBSCustomPageManager.PAGE_ID,
- MBSCustomPageManager.PROJECT_TYPE,
+ MBSCustomPageManager.PAGE_ID,
+ MBSCustomPageManager.PROJECT_TYPE,
y);
else
MBSCustomPageManager.addPageProperty(
- MBSCustomPageManager.PAGE_ID,
- MBSCustomPageManager.PROJECT_TYPE,
+ MBSCustomPageManager.PAGE_ID,
+ MBSCustomPageManager.PROJECT_TYPE,
null);
}
}
-
+
@Override
public void handleUnSelection() {
if (table != null) {
@@ -517,16 +519,16 @@ public class MBSWizardHandler extends CWizardHandler {
if (tc.isAbstract() || tc.isSystemObject()) return;
IConfiguration[] cfgs = null;
// New style managed project type. Configurations are referenced via propertyId.
- if (propertyId != null) {
+ if (propertyId != null) {
cfgs = ManagedBuildManager.getExtensionConfigurations(tc, ARTIFACT, propertyId);
- // Old style managewd project type. Configs are obtained via projectType
+ // Old style managewd project type. Configs are obtained via projectType
} else if (pt != null) {
cfgs = ManagedBuildManager.getExtensionConfigurations(tc, pt);
- }
+ }
if (cfgs == null || cfgs.length == 0) return;
full_tcs.put(tc.getUniqueRealName(), tc);
}
-
+
@Override
public void createProject(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException {
try {
@@ -544,20 +546,20 @@ public class MBSWizardHandler extends CWizardHandler {
public void convertProject(IProject proj, IProgressMonitor monitor) throws CoreException {
setProjectDescription(proj, true, true, monitor);
}
-
+
private void setProjectDescription(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException {
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
monitor.worked(10);
cfgs = getCfgItems(false);
- if (cfgs == null || cfgs.length == 0)
+ if (cfgs == null || cfgs.length == 0)
cfgs = CDTConfigWizardPage.getDefaultCfgs(this);
-
+
if (cfgs == null || cfgs.length == 0 || cfgs[0].getConfiguration() == null) {
- throw new CoreException(new Status(IStatus.ERROR,
+ throw new CoreException(new Status(IStatus.ERROR,
ManagedBuilderUIPlugin.getUniqueIdentifier(),
- Messages.CWizardHandler_6));
+ Messages.CWizardHandler_6));
}
Configuration cf = (Configuration)cfgs[0].getConfiguration();
ManagedProject mProj = new ManagedProject(project, cf.getProjectType());
@@ -565,12 +567,12 @@ public class MBSWizardHandler extends CWizardHandler {
monitor.worked(10);
cfgs = CfgHolder.unique(cfgs);
cfgs = CfgHolder.reorder(cfgs);
-
+
ICConfigurationDescription cfgDebug = null;
ICConfigurationDescription cfgFirst = null;
-
+
int work = 50/cfgs.length;
-
+
for (CfgHolder cfg : cfgs) {
cf = (Configuration)cfg.getConfiguration();
String id = ManagedBuildManager.calculateChildId(cf.getId(), null);
@@ -582,32 +584,36 @@ public class MBSWizardHandler extends CWizardHandler {
IBuilder bld = config.getEditableBuilder();
if (bld != null) { bld.setManagedBuildOn(true); }
-
+
config.setName(cfg.getName());
config.setArtifactName(mProj.getDefaultArtifactName());
-
+
IBuildProperty b = config.getBuildProperties().getProperty(PROPERTY);
if (cfgDebug == null && b != null && b.getValue() != null && PROP_VAL.equals(b.getValue().getId()))
cfgDebug = cfgDes;
- if (cfgFirst == null) // select at least first configuration
- cfgFirst = cfgDes;
+ if (cfgFirst == null) // select at least first configuration
+ cfgFirst = cfgDes;
+
+ ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, config, cfgDes);
+
monitor.worked(work);
}
mngr.setProjectDescription(project, des);
}
-
+
+
@Override
protected void doTemplatesPostProcess(IProject prj) {
if(entryInfo == null)
return;
-
+
Template template = entryInfo.getInitializedTemplate(getStartingPage(), getConfigPage(), getMainPageData());
if(template == null)
return;
List<IConfiguration> configs = new ArrayList<IConfiguration>();
for (CfgHolder cfg : cfgs) {
- configs.add((IConfiguration)cfg.getConfiguration());
+ configs.add(cfg.getConfiguration());
}
template.getTemplateInfo().setConfigurations(configs);
@@ -616,19 +622,19 @@ public class MBSWizardHandler extends CWizardHandler {
TemplateEngineUIUtil.showError(statuses[0].getMessage(), statuses[0].getException());
}
}
-
+
protected CDTConfigWizardPage getConfigPage() {
if (fConfigPage == null) {
fConfigPage = new CDTConfigWizardPage(this);
}
return fConfigPage;
}
-
+
@Override
public IWizardPage getSpecificPage() {
return entryInfo.getNextPage(getStartingPage(), getConfigPage());
}
-
+
/**
* Mark preferred toolchains with specific images
*/
@@ -647,11 +653,11 @@ public class MBSWizardHandler extends CWizardHandler {
}
}
}
-
+
public List<String> getPreferredTCNames() {
return preferredTCs;
}
-
+
@Override
public String getHeader() { return head; }
public boolean isDummy() { return false; }
@@ -659,11 +665,11 @@ public class MBSWizardHandler extends CWizardHandler {
public boolean supportsPreferred() { return true; }
@Override
- public boolean isChanged() {
+ public boolean isChanged() {
if (savedToolChains == null)
return true;
IToolChain[] tcs = getSelectedToolChains();
- if (savedToolChains.length != tcs.length)
+ if (savedToolChains.length != tcs.length)
return true;
for (IToolChain savedToolChain : savedToolChains) {
boolean found = false;
@@ -678,12 +684,12 @@ public class MBSWizardHandler extends CWizardHandler {
}
return false;
}
-
+
@Override
public void saveState() {
savedToolChains = getSelectedToolChains();
}
-
+
// Methods specific for MBSWizardHandler
public IToolChain[] getSelectedToolChains() {
@@ -699,7 +705,7 @@ public class MBSWizardHandler extends CWizardHandler {
public int getToolChainsCount() {
if (entryInfo == null)
return full_tcs.size();
- else
+ else
return entryInfo.tc_filter().size();
}
public String getPropertyId() {
@@ -716,13 +722,13 @@ public class MBSWizardHandler extends CWizardHandler {
return fConfigPage.getCfgItems(defaults);
}
@Override
- public String getErrorMessage() {
+ public String getErrorMessage() {
TableItem[] tis = table.getSelection();
if (tis == null || tis.length == 0)
- return Messages.MBSWizardHandler_0;
+ return Messages.MBSWizardHandler_0;
return null;
}
-
+
@Override
protected void doCustom(IProject newProject) {
IRunnableWithProgress[] operations = MBSCustomPageManager.getOperations();
@@ -736,7 +742,7 @@ public class MBSWizardHandler extends CWizardHandler {
ManagedBuilderUIPlugin.log(e);
}
}
-
+
@Override
public void postProcess(IProject newProject, boolean created) {
deleteExtraConfigs(newProject);
@@ -747,17 +753,17 @@ public class MBSWizardHandler extends CWizardHandler {
doCustom(newProject);
}
}
-
+
/**
- * Deletes configurations
- *
+ * Deletes configurations
+ *
* @param newProject - affected project
*/
private void deleteExtraConfigs(IProject newProject) {
- if (isChanged()) return; // no need to delete
+ if (isChanged()) return; // no need to delete
if (listener != null && listener.isCurrent()) return; // nothing to delete
if (fConfigPage == null || !fConfigPage.pagesLoaded) return;
-
+
ICProjectDescription prjd = CoreModel.getDefault().getProjectDescription(newProject, true);
if (prjd == null) return;
ICConfigurationDescription[] all = prjd.getConfigurations();
@@ -781,19 +787,19 @@ public class MBSWizardHandler extends CWizardHandler {
CoreModel.getDefault().setProjectDescription(newProject, prjd);
} catch (CoreException e) {}
}
-
+
@Override
- public boolean isApplicable(EntryDescriptor data) {
+ public boolean isApplicable(EntryDescriptor data) {
EntryInfo info = new EntryInfo(data, full_tcs, wizard);
return info.isValid() && (info.getToolChainsCount() > 0);
}
-
+
@Override
public void initialize(EntryDescriptor data) throws CoreException {
EntryInfo info = new EntryInfo(data, full_tcs, wizard);
if(!info.isValid())
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderUIPlugin.getUniqueIdentifier(), "inappropriate descriptor")); //$NON-NLS-1$
-
+
entryInfo = info;
}
@@ -819,20 +825,19 @@ public class MBSWizardHandler extends CWizardHandler {
public boolean canFinish() {
if(entryInfo == null)
return false;
-
+
if (!getConfigPage().isCustomPageComplete())
return false;
-
+
if(!entryInfo.canFinish(startingPage, getConfigPage()))
return false;
-
+
if (customPages != null)
for (int i=0; i<customPages.length; i++)
if (!customPages[i].isPageComplete())
return false;
-
+
return super.canFinish();
}
-
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java
index 706f0c6373..ab46facdf0 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java
@@ -15,6 +15,7 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
@@ -25,6 +26,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
+import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
import org.eclipse.core.resources.IProject;
@@ -110,7 +112,10 @@ public class NewMakeProjFromExisting extends Wizard implements IImportWizard, IN
IBuilder builder = config.getEditableBuilder();
builder.setManagedBuildOn(false);
CConfigurationData data = config.getConfigurationData();
- projDesc.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
+ ICConfigurationDescription cfgDes = projDesc.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
+
+ ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, config, cfgDes);
+
monitor.worked(1);
pdMgr.setProjectDescription(project, projDesc);
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java
index b5128f0ef2..231c82953b 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java
@@ -12,6 +12,7 @@
package org.eclipse.cdt.managedbuilder.ui.wizards;
import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
@@ -23,6 +24,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
+import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
@@ -37,16 +39,16 @@ import org.eclipse.swt.widgets.Composite;
public class STDWizardHandler extends MBSWizardHandler {
public STDWizardHandler(Composite p, IWizard w) {
- super(Messages.StdBuildWizard_0, p, w);
+ super(Messages.StdBuildWizard_0, p, w);
}
@Override
public void addTc(IToolChain tc) {
if (tc == null) {
- full_tcs.put(Messages.StdProjectTypeHandler_0, null);
+ full_tcs.put(Messages.StdProjectTypeHandler_0, null);
} else {
if (tc.isAbstract() || tc.isSystemObject()) return;
- // unlike CWizardHandler, we don't check for configs
+ // unlike CWizardHandler, we don't check for configs
full_tcs.put(tc.getUniqueRealName(), tc);
}
}
@@ -58,9 +60,9 @@ public class STDWizardHandler extends MBSWizardHandler {
public void createProject(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException {
try {
monitor.beginTask("", 100);//$NON-NLS-1$
-
+
setProjectDescription(project, defaults, onFinish, monitor);
-
+
doTemplatesPostProcess(project);
doCustom(project);
monitor.worked(30);
@@ -70,53 +72,60 @@ public class STDWizardHandler extends MBSWizardHandler {
}
private void setProjectDescription(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor)
- throws CoreException {
- ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
- ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
- ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
- ManagedProject mProj = new ManagedProject(des);
- info.setManagedProject(mProj);
- monitor.worked(20);
- cfgs = CfgHolder.unique(getCfgItems(false));
- cfgs = CfgHolder.reorder(cfgs);
- int work = 50/cfgs.length;
- for (int i=0; i<cfgs.length; i++) {
- String s = (cfgs[i].getToolChain() == null) ? "0" : ((ToolChain)(cfgs[i].getToolChain())).getId(); //$NON-NLS-1$
- Configuration cfg = new Configuration(mProj, (ToolChain)cfgs[i].getToolChain(), ManagedBuildManager.calculateChildId(s, null), cfgs[i].getName());
- cfgs[i].setConfiguration(cfg);
- IBuilder bld = cfg.getEditableBuilder();
- if (bld != null) {
- if(bld.isInternalBuilder()){
- IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
- IBuilder prefBuilder = prefCfg.getBuilder();
- cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName());
- bld = cfg.getEditableBuilder();
- bld.setBuildPath(null);
- }
- bld.setManagedBuildOn(false);
- } else {
- System.out.println(Messages.StdProjectTypeHandler_3);
- }
- cfg.setArtifactName(mProj.getDefaultArtifactName());
- CConfigurationData data = cfg.getConfigurationData();
- des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
- monitor.worked(work);
- }
- mngr.setProjectDescription(project, des);
- }
- public boolean canCreateWithoutToolchain() { return true; }
-
+ throws CoreException {
+
+ ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
+ ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
+ ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
+ ManagedProject mProj = new ManagedProject(des);
+ info.setManagedProject(mProj);
+ monitor.worked(20);
+ cfgs = CfgHolder.unique(getCfgItems(false));
+ cfgs = CfgHolder.reorder(cfgs);
+ int work = 50/cfgs.length;
+ for (int i=0; i<cfgs.length; i++) {
+ String s = (cfgs[i].getToolChain() == null) ? "0" : ((ToolChain)(cfgs[i].getToolChain())).getId(); //$NON-NLS-1$
+ Configuration cfg = new Configuration(mProj, (ToolChain)cfgs[i].getToolChain(), ManagedBuildManager.calculateChildId(s, null), cfgs[i].getName());
+ cfgs[i].setConfiguration(cfg);
+ IBuilder bld = cfg.getEditableBuilder();
+ if (bld != null) {
+ if(bld.isInternalBuilder()){
+ IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
+ IBuilder prefBuilder = prefCfg.getBuilder();
+ cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName());
+ bld = cfg.getEditableBuilder();
+ bld.setBuildPath(null);
+ }
+ bld.setManagedBuildOn(false);
+ } else {
+ System.out.println(Messages.StdProjectTypeHandler_3);
+ }
+ cfg.setArtifactName(mProj.getDefaultArtifactName());
+ CConfigurationData data = cfg.getConfigurationData();
+ ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
+
+ ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, cfg, cfgDes);
+
+ monitor.worked(work);
+ }
+ mngr.setProjectDescription(project, des);
+ }
+
+ public boolean canCreateWithoutToolchain() {
+ return true;
+ }
+
@Override
public void convertProject(IProject proj, IProgressMonitor monitor) throws CoreException {
- setProjectDescription(proj, true, true, monitor);
+ setProjectDescription(proj, true, true, monitor);
}
-
+
/**
* If no toolchains selected by user, use default toolchain
*/
@Override
public IToolChain[] getSelectedToolChains() {
- if (full_tcs.size() == 0 || table.getSelection().length == 0)
+ if (full_tcs.size() == 0 || table.getSelection().length == 0)
return new IToolChain[] { null };
else
return super.getSelectedToolChains();

Back to the top