1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Merge remote-tracking branch 'cdt/master' into sd90

This commit is contained in:
Andrew Gvozdev 2012-05-04 20:04:15 -04:00
commit ab11301481
53 changed files with 1828 additions and 829 deletions

View file

@ -25,6 +25,7 @@ public class AllLanguageSettingsProvidersMBSTests extends TestSuite {
public AllLanguageSettingsProvidersMBSTests() { public AllLanguageSettingsProvidersMBSTests() {
super(AllLanguageSettingsProvidersMBSTests.class.getName()); super(AllLanguageSettingsProvidersMBSTests.class.getName());
addTestSuite(LanguageSettingsProvidersMBSTest.class);
addTestSuite(GCCBuildCommandParserTest.class); addTestSuite(GCCBuildCommandParserTest.class);
addTestSuite(BuiltinSpecsDetectorTest.class); addTestSuite(BuiltinSpecsDetectorTest.class);
addTestSuite(GCCBuiltinSpecsDetectorTest.class); addTestSuite(GCCBuiltinSpecsDetectorTest.class);

View file

@ -14,16 +14,23 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage; import org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.settings.model.CIncludePathEntry; import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
import org.eclipse.cdt.core.settings.model.CMacroEntry; import org.eclipse.cdt.core.settings.model.CMacroEntry;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
import org.eclipse.cdt.core.settings.model.ICSettingEntry; import org.eclipse.cdt.core.settings.model.ICSettingEntry;
import org.eclipse.cdt.core.testplugin.ResourceHelper; import org.eclipse.cdt.core.testplugin.ResourceHelper;
import org.eclipse.cdt.core.testplugin.util.BaseTestCase; import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
import org.eclipse.cdt.internal.core.Cygwin;
import org.eclipse.cdt.managedbuilder.internal.language.settings.providers.GCCBuiltinSpecsDetectorCygwin;
import org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector; import org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
/** /**
* Test cases to test GCC built-in specs detector. * Test cases to test GCC built-in specs detector.
@ -45,6 +52,20 @@ public class GCCBuiltinSpecsDetectorTest extends BaseTestCase {
} }
} }
/**
* Mock GCCBuiltinSpecsDetectorCygwin to gain access to protected methods.
*/
class MockGCCBuiltinSpecsDetectorCygwin extends GCCBuiltinSpecsDetectorCygwin {
@Override
public void startupForLanguage(String languageId) throws CoreException {
super.startupForLanguage(languageId);
}
@Override
public void shutdownForLanguage() {
super.shutdownForLanguage();
}
}
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
@ -55,6 +76,21 @@ public class GCCBuiltinSpecsDetectorTest extends BaseTestCase {
super.tearDown(); super.tearDown();
} }
/**
* Helper method to fetch configuration descriptions.
*/
private ICConfigurationDescription[] getConfigurationDescriptions(IProject project) {
CoreModel coreModel = CoreModel.getDefault();
ICProjectDescriptionManager mngr = coreModel.getProjectDescriptionManager();
// project description
ICProjectDescription projectDescription = mngr.getProjectDescription(project);
assertNotNull(projectDescription);
assertEquals(1, projectDescription.getConfigurations().length);
// configuration description
ICConfigurationDescription[] cfgDescriptions = projectDescription.getConfigurations();
return cfgDescriptions;
}
/** /**
* Test expansion of variables in build command. * Test expansion of variables in build command.
*/ */
@ -363,4 +399,68 @@ public class GCCBuiltinSpecsDetectorTest extends BaseTestCase {
assertEquals(1, entries.size()); assertEquals(1, entries.size());
} }
/**
* Test parsing of include directives for Cygwin for global provider.
*/
public void testGCCBuiltinSpecsDetector_Cygwin_NoProject() throws Exception {
if (!Cygwin.isAvailable()) {
// Skip the test if Cygwin is not available.
return;
}
String cygwinLocation = "/usr/include";
String windowsLocation = ResourceHelper.cygwinToWindowsPath(cygwinLocation);
assertTrue("windowsLocation=["+windowsLocation+"]", new Path(windowsLocation).getDevice()!=null);
MockGCCBuiltinSpecsDetectorCygwin detector = new MockGCCBuiltinSpecsDetectorCygwin();
detector.startup(null, null);
detector.startupForLanguage(null);
detector.processLine("#include <...> search starts here:");
detector.processLine(" /usr/include");
detector.processLine("End of search list.");
detector.shutdownForLanguage();
detector.shutdown();
// check populated entries
List<ICLanguageSettingEntry> entries = detector.getSettingEntries(null, null, null);
assertEquals(new CIncludePathEntry(new Path(windowsLocation), ICSettingEntry.BUILTIN | ICSettingEntry.READONLY), entries.get(0));
assertEquals(1, entries.size());
}
/**
* Test parsing of include directives for Cygwin for provider running for a configuration.
*/
public void testGCCBuiltinSpecsDetector_Cygwin_Configuration() throws Exception {
if (!Cygwin.isAvailable()) {
// Skip the test if Cygwin is not available.
return;
}
String cygwinLocation = "/usr/include";
String windowsLocation = ResourceHelper.cygwinToWindowsPath(cygwinLocation);
assertTrue("windowsLocation=["+windowsLocation+"]", new Path(windowsLocation).getDevice()!=null);
// Create model project and folders to test
String projectName = getName();
IProject project = ResourceHelper.createCDTProjectWithConfig(projectName);
ICConfigurationDescription[] cfgDescriptions = getConfigurationDescriptions(project);
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
MockGCCBuiltinSpecsDetectorCygwin detector = new MockGCCBuiltinSpecsDetectorCygwin();
detector.startup(cfgDescription, null);
detector.startupForLanguage(null);
detector.processLine("#include <...> search starts here:");
detector.processLine(" /usr/include");
detector.processLine("End of search list.");
detector.shutdownForLanguage();
detector.shutdown();
// check populated entries
List<ICLanguageSettingEntry> entries = detector.getSettingEntries(null, null, null);
assertEquals(new CIncludePathEntry(new Path(windowsLocation), ICSettingEntry.BUILTIN | ICSettingEntry.READONLY), entries.get(0));
assertEquals(1, entries.size());
}
} }

View file

@ -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());
}
}

View file

@ -307,14 +307,15 @@
fileVersion="4.0.0"> fileVersion="4.0.0">
</managedBuildRevision> </managedBuildRevision>
<configuration <configuration
id="org.eclipse.cdt.build.core.emptycfg" id="org.eclipse.cdt.build.core.emptycfg"
name="%cfg1_empty"> languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;${Toolchain}"
name="%cfg1_empty">
</configuration> </configuration>
<configuration <configuration
id="org.eclipse.cdt.build.core.prefbase.cfg" id="org.eclipse.cdt.build.core.prefbase.cfg"
name="%cfg1_base" languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;${Toolchain}"
> name="%cfg1_base">
<toolChain <toolChain
id="org.eclipse.cdt.build.core.prefbase.toolchain" id="org.eclipse.cdt.build.core.prefbase.toolchain"
name="%toolChain.name" name="%toolChain.name"
@ -612,6 +613,14 @@
<language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/> <language-scope id="org.eclipse.cdt.core.g++"/>
</provider> </provider>
<provider
class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.GCCBuiltinSpecsDetectorCygwin"
id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorCygwin"
name="CDT GCC Builtin Compiler Settings Cygwin"
parameter="${COMMAND} -E -P -v -dD ${INPUTS}">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider <provider
class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser"
id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"

View file

@ -263,7 +263,16 @@ Specifying this attribute is fully equivalent to specifying the &quot;org.eclips
<attribute name="errorParsers" type="string"> <attribute name="errorParsers" type="string">
<annotation> <annotation>
<documentation> <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> </documentation>
</annotation> </annotation>
</attribute> </attribute>
@ -405,7 +414,14 @@ Specifying this attribute is fully equivalent to specifying the &quot;org.eclips
<attribute name="errorParsers" type="string"> <attribute name="errorParsers" type="string">
<annotation> <annotation>
<documentation> <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> </documentation>
</annotation> </annotation>
</attribute> </attribute>
@ -732,14 +748,14 @@ The pathConverter of a toolchain applies for all tools of the toolchain except i
<attribute name="customBuildStep" type="boolean"> <attribute name="customBuildStep" type="boolean">
<annotation> <annotation>
<documentation> <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> </documentation>
</annotation> </annotation>
</attribute> </attribute>
<attribute name="announcement" type="string"> <attribute name="announcement" type="string">
<annotation> <annotation>
<documentation> <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> </documentation>
<appInfo> <appInfo>
<meta.attribute translatable="true"/> <meta.attribute translatable="true"/>
@ -1066,7 +1082,7 @@ Overrides language id specified with the languageId attribute.
<attribute name="primaryInputType" type="string"> <attribute name="primaryInputType" type="string">
<annotation> <annotation>
<documentation> <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> </documentation>
</annotation> </annotation>
</attribute> </attribute>
@ -1080,7 +1096,7 @@ Overrides language id specified with the languageId attribute.
<attribute name="outputPrefix" type="string"> <attribute name="outputPrefix" type="string">
<annotation> <annotation>
<documentation> <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> </documentation>
</annotation> </annotation>
</attribute> </attribute>
@ -2150,11 +2166,11 @@ If the &quot;buildPathResolver&quot; attribute is specified, the &quot;pathDelim
<documentation> <documentation>
Represents the applicability type for this enablement. Represents the applicability type for this enablement.
Can contain the following values: Can contain the following values:
UI_VISIBILITY the given enablement expression specifies whether the option is to be visible in UI, 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, 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 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 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.: Several types could be specified simultaneously using the &quot;|&quot; as a delimiter, e.g.:
type=&quot;UI_VISIBILITY|CMD_USAGE&quot; type=&quot;UI_VISIBILITY|CMD_USAGE&quot;
@ -2288,7 +2304,7 @@ Default value is true.
<attribute name="value" type="string"> <attribute name="value" type="string">
<annotation> <annotation>
<documentation> <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 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> </documentation>
</annotation> </annotation>
@ -2303,14 +2319,14 @@ The expected value could be specified either as a string that may contain build
<attribute name="otherOptionId" type="string"> <attribute name="otherOptionId" type="string">
<annotation> <annotation>
<documentation> <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> </documentation>
</annotation> </annotation>
</attribute> </attribute>
<attribute name="otherHolderId" type="string"> <attribute name="otherHolderId" type="string">
<annotation> <annotation>
<documentation> <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> </documentation>
</annotation> </annotation>
</attribute> </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"> <attribute name="value" type="string" use="required">
<annotation> <annotation>
<documentation> <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 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. The way the value is specified and treated depends on the value of the isRegex attribute.
</documentation> </documentation>

View file

@ -159,7 +159,13 @@ public class CfgScannerConfigUtil {
Set<String> profiles = new TreeSet<String>(); Set<String> profiles = new TreeSet<String>();
if (toolchain!=null) { 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) { if (toolchainProfileId!=null && toolchainProfileId.length()>0) {
profiles.add(toolchainProfileId); profiles.add(toolchainProfileId);
} }
@ -227,7 +233,7 @@ public class CfgScannerConfigUtil {
Set<String> profiles = new TreeSet<String>(); Set<String> profiles = new TreeSet<String>();
String attribute = ((InputType) inputType).getDiscoveryProfileIdAttribute(); String attribute = ((InputType) inputType).getLegacyDiscoveryProfileIdAttribute();
if (attribute!=null) { if (attribute!=null) {
// FIXME: temporary; we should add new method to IInputType instead of that // FIXME: temporary; we should add new method to IInputType instead of that
for (String profileId : attribute.split("\\|")) { //$NON-NLS-1$ for (String profileId : attribute.split("\\|")) { //$NON-NLS-1$

View file

@ -46,6 +46,8 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
// Schema element names // Schema element names
public static final String CONFIGURATION_ELEMENT_NAME = "configuration"; //$NON-NLS-1$ public static final String CONFIGURATION_ELEMENT_NAME = "configuration"; //$NON-NLS-1$
public static final String ERROR_PARSERS = "errorParsers"; //$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 EXTENSION = "artifactExtension"; //$NON-NLS-1$
public static final String PARENT = "parent"; //$NON-NLS-1$ public static final String PARENT = "parent"; //$NON-NLS-1$
@ -170,6 +172,14 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
*/ */
public String[] getErrorParserList(); 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 * 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 * misapplied to a project. This method allows the caller to retrieve a list

View file

@ -53,6 +53,9 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
// The attribute name for the scanner info collector // The attribute name for the scanner info collector
public static final String SCANNER_CONFIG_PROFILE_ID = "scannerConfigDiscoveryProfileId"; //$NON-NLS-1$ 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. * Returns the configuration that is the parent of this tool-chain.
* *
@ -261,6 +264,15 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
*/ */
public void setErrorParserIds(String ids); public void setErrorParserIds(String ids);
/**
* 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. * Returns the scanner config discovery profile id or <code>null</code> if none.
* *

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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_STRING = ""; //$NON-NLS-1$
private static final String EMPTY_CFG_ID = "org.eclipse.cdt.build.core.emptycfg"; //$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 // Parent and children
private String parentId; private String parentId;
@ -102,6 +105,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
private String cleanCommand; private String cleanCommand;
private String artifactExtension; private String artifactExtension;
private String errorParserIds; private String errorParserIds;
private String defaultLanguageSettingsProvidersAttribute;
private String[] defaultLanguageSettingsProviderIds;
private String prebuildStep; private String prebuildStep;
private String postbuildStep; private String postbuildStep;
private String preannouncebuildStep; 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 // Get the semicolon separated list of IDs of the error parsers
errorParserIds = SafeStringInterner.safeIntern(element.getAttribute(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 // Get the artifact extension
artifactExtension = SafeStringInterner.safeIntern(element.getAttribute(EXTENSION)); artifactExtension = SafeStringInterner.safeIntern(element.getAttribute(EXTENSION));
@ -1453,6 +1461,62 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return set; 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) /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setArtifactExtension(java.lang.String) * @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setArtifactExtension(java.lang.String)
*/ */

View file

@ -17,6 +17,7 @@ import java.util.List;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import java.util.Vector; 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.ILanguage;
import org.eclipse.cdt.core.model.LanguageManager; import org.eclipse.cdt.core.model.LanguageManager;
import org.eclipse.cdt.core.settings.model.ICStorageElement; 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.internal.core.SafeStringInterner;
import org.eclipse.cdt.managedbuilder.core.IAdditionalInput; import org.eclipse.cdt.managedbuilder.core.IAdditionalInput;
import org.eclipse.cdt.managedbuilder.core.IBuildObject; 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.IFileInfo;
import org.eclipse.cdt.managedbuilder.core.IInputOrder; import org.eclipse.cdt.managedbuilder.core.IInputOrder;
import org.eclipse.cdt.managedbuilder.core.IInputType; 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.internal.enablement.OptionEnablementExpression;
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType; import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
@ -1838,9 +1841,58 @@ public class InputType extends BuildObject implements IInputType {
return id; return id;
} }
public String getDiscoveryProfileIdAttribute(){ /**
if(buildInfoDicsoveryProfileId == null && superClass != null) * Check if legacy scanner discovery method should be used.
return ((InputType)superClass).getDiscoveryProfileIdAttribute(); */
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; return buildInfoDicsoveryProfileId;
} }

View file

@ -440,6 +440,12 @@ public class MultiConfiguration extends MultiItemsHolder implements
return s; 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) /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getFilteredTools() * @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getFilteredTools()
*/ */

View file

@ -24,6 +24,7 @@ import java.util.SortedMap;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import org.eclipse.cdt.build.internal.core.scannerconfig.CfgDiscoveredPathManager.PathInfoCache; 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.ICStorageElement;
import org.eclipse.cdt.core.settings.model.extension.CTargetPlatformData; import org.eclipse.cdt.core.settings.model.extension.CTargetPlatformData;
import org.eclipse.cdt.core.settings.model.util.CDataUtil; 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.dataprovider.ConfigurationDataProvider;
import org.eclipse.cdt.managedbuilder.internal.enablement.OptionEnablementExpression; import org.eclipse.cdt.managedbuilder.internal.enablement.OptionEnablementExpression;
import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier; 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.CoreException;
import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtension;
@ -85,6 +88,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
private String targetToolIds; private String targetToolIds;
private String secondaryOutputIds; private String secondaryOutputIds;
private Boolean isAbstract; private Boolean isAbstract;
private String defaultLanguageSettingsProviderIds;
private String scannerConfigDiscoveryProfileId; private String scannerConfigDiscoveryProfileId;
private String versionsSupported; private String versionsSupported;
private String convertToId; private String convertToId;
@ -554,6 +558,9 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// Get the target tool id // Get the target tool id
targetToolIds = SafeStringInterner.safeIntern(element.getAttribute(TARGET_TOOL)); 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 // Get the scanner config discovery profile id
scannerConfigDiscoveryProfileId = SafeStringInterner.safeIntern(element.getAttribute(SCANNER_CONFIG_PROFILE_ID)); scannerConfigDiscoveryProfileId = SafeStringInterner.safeIntern(element.getAttribute(SCANNER_CONFIG_PROFILE_ID));
String tmp = element.getAttribute(RESOURCE_TYPE_BASED_DISCOVERY); String tmp = element.getAttribute(RESOURCE_TYPE_BASED_DISCOVERY);
@ -1529,18 +1536,68 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
setDirty(true); setDirty(true);
} }
/* (non-Javadoc) @Override
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#getScannerConfigDiscoveryProfileId() public String getDefaultLanguageSettingsProviderIds() {
*/ if (defaultLanguageSettingsProviderIds == null && superClass instanceof IToolChain) {
@Override 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() { public String getScannerConfigDiscoveryProfileId() {
if (scannerConfigDiscoveryProfileId == null) { if (isLegacyScannerDiscovery()) {
if (getSuperClass() != null) { return getLegacyScannerConfigDiscoveryProfileId();
return getSuperClass().getScannerConfigDiscoveryProfileId(); }
}
} return getScannerConfigDiscoveryProfileIdInternal();
return scannerConfigDiscoveryProfileId; }
}
/**
* 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) /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#setScannerConfigDiscoveryProfileId(java.lang.String) * @see org.eclipse.cdt.managedbuilder.core.IToolChain#setScannerConfigDiscoveryProfileId(java.lang.String)

View file

@ -20,6 +20,10 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import org.eclipse.cdt.build.internal.core.scannerconfig2.CfgScannerConfigInfoFactory2; 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.ILanguageDescriptor;
import org.eclipse.cdt.core.model.LanguageManager; import org.eclipse.cdt.core.model.LanguageManager;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
@ -509,11 +513,61 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
// Update the ManagedBuildInfo in the ManagedBuildManager map. Doing this creates a barrier for subsequent // Update the ManagedBuildInfo in the ManagedBuildManager map. Doing this creates a barrier for subsequent
// ManagedBuildManager#getBuildInfo(...) see Bug 305146 for more // ManagedBuildManager#getBuildInfo(...) see Bug 305146 for more
ManagedBuildManager.setLoaddedBuildInfo(cfgDescription.getProjectDescription().getProject(), info); ManagedBuildManager.setLoaddedBuildInfo(cfgDescription.getProjectDescription().getProject(), info);
setDefaultLanguageSettingsProvidersIds(cfg, cfgDescription);
return cfg.getConfigurationData(); return cfg.getConfigurationData();
} }
return null; 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);
}
}
// AG TODO - should it be when empty or when ids==null?
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){ private boolean isPersistedCfg(ICConfigurationDescription cfgDescription){
return cfgDescription.getSessionProperty(CFG_PERSISTED_PROPERTY) != null; return cfgDescription.getSessionProperty(CFG_PERSISTED_PROPERTY) != null;
} }

View file

@ -0,0 +1,68 @@
/*******************************************************************************
* Copyright (c) 2009, 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.internal.language.settings.providers;
import java.net.URI;
import java.net.URISyntaxException;
import org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector;
import org.eclipse.core.resources.IResource;
/**
* Class to detect built-in compiler settings.
* The paths are converted to cygwin "file-system" representation.
*
*/
public class GCCBuiltinSpecsDetectorCygwin extends GCCBuiltinSpecsDetector {
private static final URI CYGWIN_ROOT;
static {
try {
CYGWIN_ROOT = new URI("cygwin:/"); //$NON-NLS-1$
} catch (URISyntaxException e) {
// hey we know this works
throw new IllegalStateException(e);
}
}
@Override
protected URI getMappedRootURI(IResource sourceFile, String parsedResourceName) {
if (mappedRootURI == null) {
mappedRootURI = super.getMappedRootURI(sourceFile, parsedResourceName);
if (mappedRootURI == null) {
mappedRootURI = CYGWIN_ROOT;
}
}
return mappedRootURI;
}
@Override
protected URI getBuildDirURI(URI mappedRootURI) {
if (buildDirURI == null) {
buildDirURI = super.getBuildDirURI(mappedRootURI);
if (buildDirURI == null) {
buildDirURI = CYGWIN_ROOT;
}
}
return buildDirURI;
}
@Override
public GCCBuiltinSpecsDetectorCygwin cloneShallow() throws CloneNotSupportedException {
return (GCCBuiltinSpecsDetectorCygwin) super.cloneShallow();
}
@Override
public GCCBuiltinSpecsDetectorCygwin clone() throws CloneNotSupportedException {
return (GCCBuiltinSpecsDetectorCygwin) super.clone();
}
}

View file

@ -23,6 +23,7 @@ import org.eclipse.cdt.core.errorparsers.RegexErrorPattern;
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider; import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager; import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsLogger;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
@ -167,6 +168,11 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting
} }
setSettingEntries(currentCfgDescription, rc, currentLanguageId, entries); setSettingEntries(currentCfgDescription, rc, currentLanguageId, entries);
// AG FIXME - temporary log to remove before CDT Juno release
LanguageSettingsLogger.logInfo(getPrefixForLog()
+ getClass().getSimpleName() + " collected " + (entries!=null ? ("" + entries.size()) : "null") + " entries for " + rc);
} }
/** /**

View file

@ -37,6 +37,7 @@ import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.core.settings.model.ICProjectDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.internal.core.BuildRunnerHelper; import org.eclipse.cdt.internal.core.BuildRunnerHelper;
import org.eclipse.cdt.internal.core.XmlUtil; import org.eclipse.cdt.internal.core.XmlUtil;
import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsLogger;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages; import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages;
import org.eclipse.cdt.utils.CommandLineUtil; import org.eclipse.cdt.utils.CommandLineUtil;
@ -317,12 +318,17 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
@Override @Override
public void registerListener(ICConfigurationDescription cfgDescription) { public void registerListener(ICConfigurationDescription cfgDescription) {
// AG FIXME - temporary log to remove before CDT Juno release
LanguageSettingsLogger.logInfo(getPrefixForLog() + "registerListener [" + System.identityHashCode(this) + "] " + this);
currentCfgDescription = cfgDescription; currentCfgDescription = cfgDescription;
execute(); execute();
} }
@Override @Override
public void unregisterListener() { public void unregisterListener() {
// AG FIXME - temporary log to remove before CDT Juno release
LanguageSettingsLogger.logInfo(getPrefixForLog() + "unregisterListener [" + System.identityHashCode(this) + "] " + this);
} }
@Override @Override
@ -347,6 +353,8 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
*/ */
protected void execute() { protected void execute() {
if (isExecuted) { if (isExecuted) {
// AG FIXME - temporary log to remove before CDT Juno release
// LanguageSettingsLogger.logInfo(getPrefixForLog() + "Already executed [" + System.identityHashCode(this) + "] " + this);
return; return;
} }
@ -385,6 +393,9 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
} }
job.setRule(rule); job.setRule(rule);
job.schedule(); job.schedule();
// AG FIXME - temporary log to remove before CDT Juno release
LanguageSettingsLogger.logInfo(getPrefixForLog() + "Execution scheduled [" + System.identityHashCode(this) + "] " + this);
} }
/** /**
@ -481,6 +492,11 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
protected void shutdownForLanguage() { protected void shutdownForLanguage() {
if (detectedSettingEntries != null && detectedSettingEntries.size() > 0) { if (detectedSettingEntries != null && detectedSettingEntries.size() > 0) {
collected = detectedSettingEntries.size(); collected = detectedSettingEntries.size();
// AG FIXME - temporary log to remove before CDT Juno release
LanguageSettingsLogger.logInfo(getPrefixForLog()
+ getClass().getSimpleName() + " collected " + detectedSettingEntries.size() + " entries" + " for language " + currentLanguageId);
setSettingEntries(currentCfgDescription, currentResource, currentLanguageId, detectedSettingEntries); setSettingEntries(currentCfgDescription, currentResource, currentLanguageId, detectedSettingEntries);
} }
detectedSettingEntries = null; detectedSettingEntries = null;

View file

@ -38,6 +38,7 @@ import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.core.settings.model.ICSettingEntry; import org.eclipse.cdt.core.settings.model.ICSettingEntry;
import org.eclipse.cdt.core.settings.model.util.CDataUtil; import org.eclipse.cdt.core.settings.model.util.CDataUtil;
import org.eclipse.cdt.internal.core.XmlUtil; import org.eclipse.cdt.internal.core.XmlUtil;
import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsLogger;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.utils.EFSExtensionManager; import org.eclipse.cdt.utils.EFSExtensionManager;
import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.EFS;
@ -556,6 +557,19 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
return buildDirURI; return buildDirURI;
} }
// AG FIXME - temporary, remove me
@Deprecated
protected String getPrefixForLog() {
String str;
if (currentCfgDescription!= null) {
IProject ownerProject = currentCfgDescription.getProjectDescription().getProject();
str = ownerProject + ":" + currentCfgDescription.getName();
} else {
str = "[global]";
}
return str + ": ";
}
/** /**
* Sets language settings entries for current configuration description, current resource * Sets language settings entries for current configuration description, current resource
* and current language ID. * and current language ID.
@ -564,6 +578,10 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
*/ */
protected void setSettingEntries(List<ICLanguageSettingEntry> entries) { protected void setSettingEntries(List<ICLanguageSettingEntry> entries) {
setSettingEntries(currentCfgDescription, currentResource, currentLanguageId, entries); setSettingEntries(currentCfgDescription, currentResource, currentLanguageId, entries);
// AG FIXME - temporary log to remove before CDT Juno release
LanguageSettingsLogger.logInfo(getPrefixForLog()
+ getClass().getSimpleName() + " collected " + (entries!=null ? ("" + entries.size()) : "null") + " entries for " + currentResource);
} }
/** /**

View file

@ -1269,7 +1269,6 @@
dependencyExtensions="h" dependencyExtensions="h"
dependencyCalculator="org.eclipse.cdt.managedbuilder.makegen.gnu.DefaultGCCDependencyCalculator2" dependencyCalculator="org.eclipse.cdt.managedbuilder.makegen.gnu.DefaultGCCDependencyCalculator2"
id="cdt.managedbuild.tool.gnu.c.compiler.input" 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"> languageId="org.eclipse.cdt.core.gcc">
</inputType> </inputType>
<outputType <outputType
@ -1591,7 +1590,6 @@
dependencyExtensions="h,H,hpp" dependencyExtensions="h,H,hpp"
dependencyCalculator="org.eclipse.cdt.managedbuilder.makegen.gnu.DefaultGCCDependencyCalculator2" dependencyCalculator="org.eclipse.cdt.managedbuilder.makegen.gnu.DefaultGCCDependencyCalculator2"
id="cdt.managedbuild.tool.gnu.cpp.compiler.input" 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++"> languageId="org.eclipse.cdt.core.g++">
</inputType> </inputType>
<outputType <outputType
@ -1658,7 +1656,7 @@
<inputType <inputType
id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin" id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"
superClass="cdt.managedbuild.tool.gnu.c.compiler.input" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"/> />
</tool> </tool>
<tool <tool
id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin" id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin"
@ -1672,7 +1670,7 @@
<inputType <inputType
id="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin" id="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin"
superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"/> />
</tool> </tool>
<builder <builder
@ -1704,11 +1702,12 @@
</builder> </builder>
<toolChain <toolChain
archList="all" archList="all"
osList="linux,hpux,aix,qnx" id="cdt.managedbuild.toolchain.gnu.base"
name="%ToolChainName.Linux" languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
targetTool="cdt.managedbuild.tool.gnu.c.linker;cdt.managedbuild.tool.gnu.cpp.linker;cdt.managedbuild.tool.gnu.archiver" name="%ToolChainName.Linux"
id="cdt.managedbuild.toolchain.gnu.base"> osList="linux,hpux,aix,qnx"
targetTool="cdt.managedbuild.tool.gnu.c.linker;cdt.managedbuild.tool.gnu.cpp.linker;cdt.managedbuild.tool.gnu.archiver">
<targetPlatform <targetPlatform
id="cdt.managedbuild.target.gnu.platform.base" id="cdt.managedbuild.target.gnu.platform.base"
name="%PlatformName.Dbg" name="%PlatformName.Dbg"
@ -1773,6 +1772,7 @@
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.cygwin.GnuCygwinConfigurationEnvironmentSupplier" configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.cygwin.GnuCygwinConfigurationEnvironmentSupplier"
id="cdt.managedbuild.toolchain.gnu.cygwin.base" id="cdt.managedbuild.toolchain.gnu.cygwin.base"
isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.cygwin.IsGnuCygwinToolChainSupported" isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.cygwin.IsGnuCygwinToolChainSupported"
languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorCygwin"
name="%ToolChainName.Cygwin" name="%ToolChainName.Cygwin"
osList="win32" osList="win32"
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base;cdt.managedbuild.tool.gnu.c.linker.cygwin.base;cdt.managedbuild.tool.gnu.archiver"> 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" configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwEnvironmentVariableSupplier"
id="cdt.managedbuild.toolchain.gnu.mingw.base" id="cdt.managedbuild.toolchain.gnu.mingw.base"
isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwIsToolChainSupported" isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwIsToolChainSupported"
languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
name="%ToolChainName.MinGW" name="%ToolChainName.MinGW"
osList="win32" osList="win32"
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base;cdt.managedbuild.tool.gnu.c.linker.mingw.base;cdt.managedbuild.tool.gnu.archiver"> 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> </toolChain>
<configuration <configuration
id="cdt.managedbuild.config.gnu.base"
cleanCommand="rm -rf" 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" <enablement type="CONTAINER_ATTRIBUTE"
attribute="artifactExtension" attribute="artifactExtension"
value="so" value="so"
@ -2480,27 +2481,27 @@
</projectType> </projectType>
<configuration <configuration
id="cdt.managedbuild.config.gnu.cygwin.base" artifactExtension="exe"
cleanCommand="rm -rf" cleanCommand="rm -rf"
artifactExtension="exe" 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" <enablement type="CONTAINER_ATTRIBUTE"
attribute="artifactExtension" attribute="artifactExtension"
value="dll" value="dll"
extensionAdjustment="false"> extensionAdjustment="false">
<checkBuildProperty <checkBuildProperty
property="org.eclipse.cdt.build.core.buildArtefactType" property="org.eclipse.cdt.build.core.buildArtefactType"
value="org.eclipse.cdt.build.core.buildArtefactType.sharedLib"/> value="org.eclipse.cdt.build.core.buildArtefactType.sharedLib"/>
</enablement> </enablement>
<enablement type="CONTAINER_ATTRIBUTE" <enablement type="CONTAINER_ATTRIBUTE"
attribute="artifactExtension" attribute="artifactExtension"
value="a" value="a"
extensionAdjustment="false"> extensionAdjustment="false">
<checkBuildProperty <checkBuildProperty
property="org.eclipse.cdt.build.core.buildArtefactType" property="org.eclipse.cdt.build.core.buildArtefactType"
value="org.eclipse.cdt.build.core.buildArtefactType.staticLib"/> value="org.eclipse.cdt.build.core.buildArtefactType.staticLib"/>
</enablement> </enablement>
</configuration> </configuration>
<projectType <projectType
buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe"
@ -2878,10 +2879,10 @@
</projectType> </projectType>
<configuration <configuration
id="cdt.managedbuild.config.gnu.mingw.base" artifactExtension="exe"
cleanCommand="rm -rf" cleanCommand="rm -rf"
artifactExtension="exe" 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" <enablement type="CONTAINER_ATTRIBUTE"
attribute="artifactExtension" attribute="artifactExtension"
value="dll" value="dll"

View file

@ -207,6 +207,12 @@ public class TestConfiguration implements IConfiguration {
return null; return null;
} }
@Override
public String[] getDefaultLanguageSettingsProviderIds() {
// TODO Auto-generated method stub
return null;
}
@Override @Override
public ITool[] getFilteredTools() { public ITool[] getFilteredTools() {
// TODO Auto-generated method stub // TODO Auto-generated method stub

View file

@ -364,6 +364,10 @@ public class TestToolchain extends HoldsOptions implements IToolChain {
return false; return false;
} }
@Override
public String getDefaultLanguageSettingsProviderIds() {
// TODO Auto-generated method stub
return null;
}
} }

View file

@ -577,8 +577,13 @@
> >
<enabledWhen> <enabledWhen>
<adapt type="org.eclipse.core.resources.IProject"> <adapt type="org.eclipse.core.resources.IProject">
<test property="org.eclipse.core.resources.projectNature" <and>
value="org.eclipse.cdt.managedbuilder.core.managedBuildNature"/> <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> </adapt>
</enabledWhen> </enabledWhen>
</page> </page>

View file

@ -223,6 +223,7 @@ public class Messages extends NLS {
public static String PropertyPageDefsTab_9; public static String PropertyPageDefsTab_9;
public static String PropertyPageDefsTab_showIncludeFileTab; public static String PropertyPageDefsTab_showIncludeFileTab;
public static String PropertyPageDefsTab_showProvidersTab; public static String PropertyPageDefsTab_showProvidersTab;
public static String PropertyPageDefsTab_showScannerDiscoveryTab;
public static String RefreshPolicyExceptionDialog_addDialogLabel; public static String RefreshPolicyExceptionDialog_addDialogLabel;
public static String RefreshPolicyExceptionDialog_AddExceptionInfoDialog_message; public static String RefreshPolicyExceptionDialog_AddExceptionInfoDialog_message;
public static String RefreshPolicyExceptionDialog_AddExceptionInfoDialog_title; public static String RefreshPolicyExceptionDialog_AddExceptionInfoDialog_title;

View file

@ -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_8=Always show names + profile IDs
PropertyPageDefsTab_9=Always show profile IDs only PropertyPageDefsTab_9=Always show profile IDs only
PropertyPageDefsTab_showIncludeFileTab=Display "Include Files" tab 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 ProjectConvert_convertersList=Converters List
AbstractPrefPage_0=\ Preference settings will be applied to new projects \n only when there were no toolchains selected. AbstractPrefPage_0=\ Preference settings will be applied to new projects \n only when there were no toolchains selected.

View file

@ -11,8 +11,8 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.preferences; 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.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.managedbuilder.internal.ui.Messages;
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab; import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
import org.eclipse.cdt.ui.newui.CDTPrefUtil; 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 static final int SPACING = 5; // for radio buttons layout
private Button show_tree; private Button show_tree;
private Button show_inc_files; private Button show_inc_files;
private Button show_mng; private Button show_mng;
private Button show_tool; private Button show_tool;
private Button show_exp; private Button show_exp;
private Button show_providers_tab; // temporary checkbox for scanner discovery Providers tab private Button show_sd;
private Button show_tipbox; private Button show_providers_tab; // temporary checkbox for scanner discovery Providers tab
private Button show_tipbox;
private Button b_0; private Button b_0;
private Button b_1; private Button b_1;
private Button b_2; private Button b_2;
private Button b_3; private Button b_3;
private Button s_0; private Button s_0;
private Button s_1; private Button s_1;
private Button s_2; private Button s_2;
@Override @Override
public void createControls(Composite parent) { public void createControls(Composite parent) {
super.createControls(parent); super.createControls(parent);
usercomp.setLayout(new GridLayout(1, false)); usercomp.setLayout(new GridLayout(1, false));
show_mng = new Button(usercomp, SWT.CHECK); show_mng = new Button(usercomp, SWT.CHECK);
show_mng.setText(Messages.PropertyPageDefsTab_0); show_mng.setText(Messages.PropertyPageDefsTab_0);
show_mng.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); show_mng.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_inc_files = new Button(usercomp, SWT.CHECK); show_inc_files = new Button(usercomp, SWT.CHECK);
show_inc_files.setText(Messages.PropertyPageDefsTab_showIncludeFileTab); show_inc_files.setText(Messages.PropertyPageDefsTab_showIncludeFileTab);
show_inc_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); show_inc_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_tree = new Button(usercomp, SWT.CHECK); show_tree = new Button(usercomp, SWT.CHECK);
show_tree.setText(Messages.PropertyPageDefsTab_1); show_tree.setText(Messages.PropertyPageDefsTab_1);
show_tree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); show_tree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_tool = new Button(usercomp, SWT.CHECK); show_tool = new Button(usercomp, SWT.CHECK);
show_tool.setText(Messages.PropertyPageDefsTab_4); show_tool.setText(Messages.PropertyPageDefsTab_4);
show_tool.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); show_tool.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_exp = new Button(usercomp, SWT.CHECK); show_exp = new Button(usercomp, SWT.CHECK);
show_exp.setText(Messages.PropertyPageDefsTab_10); show_exp.setText(Messages.PropertyPageDefsTab_10);
show_exp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); show_exp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_providers_tab = new Button(usercomp, SWT.CHECK); show_sd = new Button(usercomp, SWT.CHECK);
show_providers_tab.setText(Messages.PropertyPageDefsTab_showProvidersTab); show_sd.setText(Messages.PropertyPageDefsTab_showScannerDiscoveryTab);
show_providers_tab.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); show_sd.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_tipbox = new Button(usercomp, SWT.CHECK); show_providers_tab = new Button(usercomp, SWT.CHECK);
show_tipbox.setText(Messages.PropertyPageDefsTab_16); show_providers_tab.setText(Messages.PropertyPageDefsTab_showProvidersTab);
show_tipbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); show_providers_tab.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Group saveGrp = new Group(usercomp, SWT.NONE); show_tipbox = new Button(usercomp, SWT.CHECK);
saveGrp.setText(Messages.PropertyPageDefsTab_11); show_tipbox.setText(Messages.PropertyPageDefsTab_16);
saveGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); show_tipbox.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); Group saveGrp = new Group(usercomp, SWT.NONE);
s_0.setText(Messages.PropertyPageDefsTab_13); saveGrp.setText(Messages.PropertyPageDefsTab_11);
s_1 = new Button(saveGrp, SWT.RADIO); saveGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
s_1.setText(Messages.PropertyPageDefsTab_12); FillLayout fl = new FillLayout(SWT.VERTICAL);
s_2 = new Button(saveGrp, SWT.RADIO); fl.spacing = SPACING;
s_2.setText(Messages.PropertyPageDefsTab_14); fl.marginHeight = SPACING;
fl.marginWidth = SPACING;
saveGrp.setLayout(fl);
Group discGrp = new Group(usercomp, SWT.NONE); s_0 = new Button(saveGrp, SWT.RADIO);
discGrp.setText(Messages.PropertyPageDefsTab_5); s_0.setText(Messages.PropertyPageDefsTab_13);
discGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); s_1 = new Button(saveGrp, SWT.RADIO);
fl = new FillLayout(SWT.VERTICAL); s_1.setText(Messages.PropertyPageDefsTab_12);
fl.spacing = SPACING; s_2 = new Button(saveGrp, SWT.RADIO);
fl.marginHeight = SPACING; s_2.setText(Messages.PropertyPageDefsTab_14);
fl.marginWidth = SPACING;
discGrp.setLayout(fl);
b_0 = new Button(discGrp, SWT.RADIO); Group discGrp = new Group(usercomp, SWT.NONE);
b_0.setText(Messages.PropertyPageDefsTab_6); discGrp.setText(Messages.PropertyPageDefsTab_5);
b_1 = new Button(discGrp, SWT.RADIO); discGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
b_1.setText(Messages.PropertyPageDefsTab_7); fl = new FillLayout(SWT.VERTICAL);
b_2 = new Button(discGrp, SWT.RADIO); fl.spacing = SPACING;
b_2.setText(Messages.PropertyPageDefsTab_8); fl.marginHeight = SPACING;
b_3 = new Button(discGrp, SWT.RADIO); fl.marginWidth = SPACING;
b_3.setText(Messages.PropertyPageDefsTab_9); discGrp.setLayout(fl);
show_inc_files.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_SHOW_INC_FILES)); b_0 = new Button(discGrp, SWT.RADIO);
show_tree.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_DTREE)); 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_mng.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOMNG));
show_tool.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOTOOLM)); show_tool.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOTOOLM));
show_exp.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_EXPORT)); 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)); show_tipbox.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_TIPBOX));
switch (CDTPrefUtil.getInt(CDTPrefUtil.KEY_DISC_NAMES)) { 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_BOTH: b_0.setSelection(true); break;
case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_IDS: b_1.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_BOTH: b_2.setSelection(true); break;
case CDTPrefUtil.DISC_NAMING_ALWAYS_IDS: b_3.setSelection(true); break; case CDTPrefUtil.DISC_NAMING_ALWAYS_IDS: b_3.setSelection(true); break;
} }
switch (CDTPrefUtil.getInt(CDTPrefUtil.KEY_POSSAVE)) { switch (CDTPrefUtil.getInt(CDTPrefUtil.KEY_POSSAVE)) {
case CDTPrefUtil.POSITION_SAVE_BOTH: s_1.setSelection(true); break; case CDTPrefUtil.POSITION_SAVE_BOTH: s_1.setSelection(true); break;
case CDTPrefUtil.POSITION_SAVE_NONE: s_2.setSelection(true); break; case CDTPrefUtil.POSITION_SAVE_NONE: s_2.setSelection(true); break;
default: s_0.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_NOMNG, !show_mng.getSelection());
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOTOOLM, !show_tool.getSelection()); CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOTOOLM, !show_tool.getSelection());
CDTPrefUtil.setBool(CDTPrefUtil.KEY_EXPORT, show_exp.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()); CDTPrefUtil.setBool(CDTPrefUtil.KEY_TIPBOX, show_tipbox.getSelection());
int x = 0; int x = 0;
if (b_1.getSelection()) x = 1; if (b_1.getSelection()) x = 1;
@ -168,7 +177,8 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
show_mng.setSelection(true); show_mng.setSelection(true);
show_tool.setSelection(true); show_tool.setSelection(true);
show_exp.setSelection(false); show_exp.setSelection(false);
show_providers_tab.setSelection(false); show_sd.setSelection(true);
show_providers_tab.setSelection(true);
show_tipbox.setSelection(false); show_tipbox.setSelection(false);
b_0.setSelection(true); b_0.setSelection(true);
b_1.setSelection(false); b_1.setSelection(false);

View file

@ -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.Configuration;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo; import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject; 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.internal.ui.Messages;
import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
import org.eclipse.cdt.ui.newui.CDTPrefUtil; import org.eclipse.cdt.ui.newui.CDTPrefUtil;
import org.eclipse.cdt.ui.templateengine.IWizardDataPage; import org.eclipse.cdt.ui.templateengine.IWizardDataPage;
import org.eclipse.cdt.ui.templateengine.Template; import org.eclipse.cdt.ui.templateengine.Template;
@ -87,12 +88,13 @@ public class MBSWizardHandler extends CWizardHandler {
private static final String PROPERTY = "org.eclipse.cdt.build.core.buildType"; //$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 PROP_VAL = PROPERTY + ".debug"; //$NON-NLS-1$
private static final String tooltip = private static final String tooltip =
Messages.CWizardHandler_1 + Messages.CWizardHandler_1 +
Messages.CWizardHandler_2 + Messages.CWizardHandler_2 +
Messages.CWizardHandler_3 + Messages.CWizardHandler_3 +
Messages.CWizardHandler_4 + Messages.CWizardHandler_4 +
Messages.CWizardHandler_5; Messages.CWizardHandler_5;
protected SortedMap<String, IToolChain> full_tcs = new TreeMap<String, IToolChain>(); protected SortedMap<String, IToolChain> full_tcs = new TreeMap<String, IToolChain>();
private String propertyId = null; private String propertyId = null;
@ -102,7 +104,7 @@ public class MBSWizardHandler extends CWizardHandler {
private IToolChain[] savedToolChains = null; private IToolChain[] savedToolChains = null;
private IWizard wizard; private IWizard wizard;
private IWizardPage startingPage; private IWizardPage startingPage;
// private EntryDescriptor entryDescriptor = null; // private EntryDescriptor entryDescriptor = null;
private EntryInfo entryInfo; private EntryInfo entryInfo;
protected CfgHolder[] cfgs = null; protected CfgHolder[] cfgs = null;
protected IWizardPage[] customPages; protected IWizardPage[] customPages;
@ -175,13 +177,13 @@ public class MBSWizardHandler extends CWizardHandler {
List<Template> lstTemplates = new ArrayList<Template>(); List<Template> lstTemplates = new ArrayList<Template>();
for (String id : langIDs) { for (String id : langIDs) {
lstTemplates.addAll(Arrays.asList(TemplateEngineUI.getDefault(). lstTemplates.addAll(Arrays.asList(TemplateEngineUI.getDefault().
getTemplates(projectTypeId, null, id))); getTemplates(projectTypeId, null, id)));
} }
templates = lstTemplates.toArray(new Template[lstTemplates.size()]); templates = lstTemplates.toArray(new Template[lstTemplates.size()]);
} }
} }
if(null == templates) { if(null == templates) {
templates = TemplateEngineUI.getDefault().getTemplates(projectTypeId); templates = TemplateEngineUI.getDefault().getTemplates(projectTypeId);
} }
if((null == templates) || (templates.length == 0)) if((null == templates) || (templates.length == 0))
break; break;
@ -210,7 +212,7 @@ public class MBSWizardHandler extends CWizardHandler {
if(template != null){ if(template != null){
Map<String, String> valueStore = template.getValueStore(); Map<String, String> valueStore = template.getValueStore();
// valueStore.clear(); // valueStore.clear();
for (IWizardPage page : templatePages) { for (IWizardPage page : templatePages) {
if (page instanceof UIWizardPage) if (page instanceof UIWizardPage)
valueStore.putAll(((UIWizardPage)page).getPageData()); valueStore.putAll(((UIWizardPage)page).getPageData());
@ -295,7 +297,7 @@ public class MBSWizardHandler extends CWizardHandler {
for (String id : toolChainIds) { for (String id : toolChainIds) {
if ((id != null && id.equals(id1)) || if ((id != null && id.equals(id1)) ||
(id != null && id.equals(id2))) (id != null && id.equals(id2)))
return true; return true;
} }
return false; return false;
@ -466,7 +468,7 @@ public class MBSWizardHandler extends CWizardHandler {
MBSCustomPageManager.PAGE_ID, MBSCustomPageManager.PAGE_ID,
MBSCustomPageManager.PROJECT_TYPE, MBSCustomPageManager.PROJECT_TYPE,
getProjectType().getId() getProjectType().getId()
); );
IToolChain[] tcs = getSelectedToolChains(); IToolChain[] tcs = getSelectedToolChains();
ArrayList<IToolChain> x = new ArrayList<IToolChain>(); ArrayList<IToolChain> x = new ArrayList<IToolChain>();
@ -519,7 +521,7 @@ public class MBSWizardHandler extends CWizardHandler {
// New style managed project type. Configurations are referenced via propertyId. // New style managed project type. Configurations are referenced via propertyId.
if (propertyId != null) { if (propertyId != null) {
cfgs = ManagedBuildManager.getExtensionConfigurations(tc, ARTIFACT, propertyId); 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) { } else if (pt != null) {
cfgs = ManagedBuildManager.getExtensionConfigurations(tc, pt); cfgs = ManagedBuildManager.getExtensionConfigurations(tc, pt);
} }
@ -591,11 +593,15 @@ public class MBSWizardHandler extends CWizardHandler {
cfgDebug = cfgDes; cfgDebug = cfgDes;
if (cfgFirst == null) // select at least first configuration if (cfgFirst == null) // select at least first configuration
cfgFirst = cfgDes; cfgFirst = cfgDes;
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, config, cfgDes);
monitor.worked(work); monitor.worked(work);
} }
mngr.setProjectDescription(project, des); mngr.setProjectDescription(project, des);
} }
@Override @Override
protected void doTemplatesPostProcess(IProject prj) { protected void doTemplatesPostProcess(IProject prj) {
if(entryInfo == null) if(entryInfo == null)
@ -607,7 +613,7 @@ public class MBSWizardHandler extends CWizardHandler {
List<IConfiguration> configs = new ArrayList<IConfiguration>(); List<IConfiguration> configs = new ArrayList<IConfiguration>();
for (CfgHolder cfg : cfgs) { for (CfgHolder cfg : cfgs) {
configs.add((IConfiguration)cfg.getConfiguration()); configs.add(cfg.getConfiguration());
} }
template.getTemplateInfo().setConfigurations(configs); template.getTemplateInfo().setConfigurations(configs);
@ -834,5 +840,4 @@ public class MBSWizardHandler extends CWizardHandler {
return super.canFinish(); return super.canFinish();
} }
} }

View file

@ -15,6 +15,7 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.cdt.core.CCProjectNature; import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.CoreModel; 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.ICProjectDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager; import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData; 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.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject; import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain; 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.internal.ui.Messages;
import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin; import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
@ -110,7 +112,10 @@ public class NewMakeProjFromExisting extends Wizard implements IImportWizard, IN
IBuilder builder = config.getEditableBuilder(); IBuilder builder = config.getEditableBuilder();
builder.setManagedBuildOn(false); builder.setManagedBuildOn(false);
CConfigurationData data = config.getConfigurationData(); 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); monitor.worked(1);
pdMgr.setProjectDescription(project, projDesc); pdMgr.setProjectDescription(project, projDesc);

View file

@ -12,6 +12,7 @@
package org.eclipse.cdt.managedbuilder.ui.wizards; package org.eclipse.cdt.managedbuilder.ui.wizards;
import org.eclipse.cdt.core.model.CoreModel; 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.ICProjectDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager; import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData; 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.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject; import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain; 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.internal.ui.Messages;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
@ -46,7 +48,7 @@ public class STDWizardHandler extends MBSWizardHandler {
full_tcs.put(Messages.StdProjectTypeHandler_0, null); full_tcs.put(Messages.StdProjectTypeHandler_0, null);
} else { } else {
if (tc.isAbstract() || tc.isSystemObject()) return; 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); full_tcs.put(tc.getUniqueRealName(), tc);
} }
} }
@ -70,45 +72,52 @@ public class STDWizardHandler extends MBSWizardHandler {
} }
private void setProjectDescription(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) private void setProjectDescription(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor)
throws CoreException { throws CoreException {
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish); ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project); ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
ManagedProject mProj = new ManagedProject(des); ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
info.setManagedProject(mProj); ManagedProject mProj = new ManagedProject(des);
monitor.worked(20); info.setManagedProject(mProj);
cfgs = CfgHolder.unique(getCfgItems(false)); monitor.worked(20);
cfgs = CfgHolder.reorder(cfgs); cfgs = CfgHolder.unique(getCfgItems(false));
int work = 50/cfgs.length; cfgs = CfgHolder.reorder(cfgs);
for (int i=0; i<cfgs.length; i++) { int work = 50/cfgs.length;
String s = (cfgs[i].getToolChain() == null) ? "0" : ((ToolChain)(cfgs[i].getToolChain())).getId(); //$NON-NLS-1$ for (int i=0; i<cfgs.length; i++) {
Configuration cfg = new Configuration(mProj, (ToolChain)cfgs[i].getToolChain(), ManagedBuildManager.calculateChildId(s, null), cfgs[i].getName()); String s = (cfgs[i].getToolChain() == null) ? "0" : ((ToolChain)(cfgs[i].getToolChain())).getId(); //$NON-NLS-1$
cfgs[i].setConfiguration(cfg); Configuration cfg = new Configuration(mProj, (ToolChain)cfgs[i].getToolChain(), ManagedBuildManager.calculateChildId(s, null), cfgs[i].getName());
IBuilder bld = cfg.getEditableBuilder(); cfgs[i].setConfiguration(cfg);
if (bld != null) { IBuilder bld = cfg.getEditableBuilder();
if(bld.isInternalBuilder()){ if (bld != null) {
IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false); if(bld.isInternalBuilder()){
IBuilder prefBuilder = prefCfg.getBuilder(); IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName()); IBuilder prefBuilder = prefCfg.getBuilder();
bld = cfg.getEditableBuilder(); cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName());
bld.setBuildPath(null); bld = cfg.getEditableBuilder();
} bld.setBuildPath(null);
bld.setManagedBuildOn(false); }
} else { bld.setManagedBuildOn(false);
System.out.println(Messages.StdProjectTypeHandler_3); } else {
} System.out.println(Messages.StdProjectTypeHandler_3);
cfg.setArtifactName(mProj.getDefaultArtifactName()); }
CConfigurationData data = cfg.getConfigurationData(); cfg.setArtifactName(mProj.getDefaultArtifactName());
des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data); CConfigurationData data = cfg.getConfigurationData();
monitor.worked(work); ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
}
mngr.setProjectDescription(project, des); ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, cfg, cfgDes);
}
public boolean canCreateWithoutToolchain() { return true; } monitor.worked(work);
}
mngr.setProjectDescription(project, des);
}
public boolean canCreateWithoutToolchain() {
return true;
}
@Override @Override
public void convertProject(IProject proj, IProgressMonitor monitor) throws CoreException { public void convertProject(IProject proj, IProgressMonitor monitor) throws CoreException {
setProjectDescription(proj, true, true, monitor); setProjectDescription(proj, true, true, monitor);
} }
/** /**

View file

@ -12,7 +12,9 @@
package org.eclipse.cdt.core.language.settings.providers; package org.eclipse.cdt.core.language.settings.providers;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.CoreModel;
@ -41,20 +43,22 @@ public class ScannerDiscoveryLegacySupport {
/** ID of MBS language settings provider (from org.eclipse.cdt.managedbuilder.core) */ /** ID of MBS language settings provider (from org.eclipse.cdt.managedbuilder.core) */
public static final String MBS_LANGUAGE_SETTINGS_PROVIDER_ID = "org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider"; //$NON-NLS-1$ public static final String MBS_LANGUAGE_SETTINGS_PROVIDER_ID = "org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider"; //$NON-NLS-1$
private static String USE_LANGUAGE_SETTINGS_PROVIDERS_PREFERENCE = "enabled"; //$NON-NLS-1$ private static String DISABLE_LSP_PREFERENCE = "language.settings.providers.disabled"; //$NON-NLS-1$
// the default needs to be "false" for legacy projects to be open with old SD enabled for MBS provider // the default for project needs to be "disabled" - for legacy projects to be open with old SD enabled for MBS provider
private static boolean USE_LANGUAGE_SETTINGS_PROVIDERS_DEFAULT = false; private static boolean DISABLE_LSP_DEFAULT_PROJECT = true;
private static final String PREFERENCES_QUALIFIER = CCorePlugin.PLUGIN_ID; private static boolean DISABLE_LSP_DEFAULT_WORKSPACE = false;
private static final String LANGUAGE_SETTINGS_PROVIDERS_NODE = "languageSettingsProviders"; //$NON-NLS-1$ private static final String PREFERENCES_QUALIFIER_CCORE = CCorePlugin.PLUGIN_ID;
private static Map<String, String> legacyProfiles = null;
/** /**
* Get preferences node for org.eclipse.cdt.core. * Get preferences node for org.eclipse.cdt.core.
*/ */
private static Preferences getPreferences(IProject project) { private static Preferences getPreferences(IProject project) {
if (project == null) { if (project == null) {
return InstanceScope.INSTANCE.getNode(PREFERENCES_QUALIFIER).node(LANGUAGE_SETTINGS_PROVIDERS_NODE); return InstanceScope.INSTANCE.getNode(PREFERENCES_QUALIFIER_CCORE);
} else { } else {
return new LocalProjectScope(project).getNode(PREFERENCES_QUALIFIER).node(LANGUAGE_SETTINGS_PROVIDERS_NODE); return new LocalProjectScope(project).getNode(PREFERENCES_QUALIFIER_CCORE);
} }
} }
@ -68,7 +72,8 @@ public class ScannerDiscoveryLegacySupport {
*/ */
public static boolean isLanguageSettingsProvidersFunctionalityEnabled(IProject project) { public static boolean isLanguageSettingsProvidersFunctionalityEnabled(IProject project) {
Preferences pref = getPreferences(project); Preferences pref = getPreferences(project);
return pref.getBoolean(USE_LANGUAGE_SETTINGS_PROVIDERS_PREFERENCE, USE_LANGUAGE_SETTINGS_PROVIDERS_DEFAULT); boolean defaultValue = project != null ? DISABLE_LSP_DEFAULT_PROJECT : DISABLE_LSP_DEFAULT_WORKSPACE;
return !pref.getBoolean(DISABLE_LSP_PREFERENCE, defaultValue);
} }
/** /**
@ -81,7 +86,7 @@ public class ScannerDiscoveryLegacySupport {
*/ */
public static void setLanguageSettingsProvidersFunctionalityEnabled(IProject project, boolean value) { public static void setLanguageSettingsProvidersFunctionalityEnabled(IProject project, boolean value) {
Preferences pref = getPreferences(project); Preferences pref = getPreferences(project);
pref.putBoolean(USE_LANGUAGE_SETTINGS_PROVIDERS_PREFERENCE, value); pref.putBoolean(DISABLE_LSP_PREFERENCE, !value);
try { try {
pref.flush(); pref.flush();
} catch (BackingStoreException e) { } catch (BackingStoreException e) {
@ -147,4 +152,37 @@ public class ScannerDiscoveryLegacySupport {
return providers; return providers;
} }
/**
* Returns the values of scanner discovery profiles (scannerConfigDiscoveryProfileId) which were deprecated
* and replaced with language settings providers in plugin.xml.
* This (temporary) function serves as fail-safe switch during the transition.
*
* @param id - can be id of either org.eclipse.cdt.managedbuilder.internal.core.InputType
* or org.eclipse.cdt.managedbuilder.internal.core.ToolChain.
* @return legacy scannerConfigDiscoveryProfileId.
*/
@SuppressWarnings("nls")
public static String getDeprecatedLegacyProfiles(String id) {
if (legacyProfiles == null) {
legacyProfiles = new HashMap<String, String>();
// InputTypes
// TODO -doublecheck
// legacyProfiles.put(inputTypeId, scannerConfigDiscoveryProfileId);
legacyProfiles.put("cdt.managedbuild.tool.gnu.c.compiler.input", "org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC|org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile");
legacyProfiles.put("cdt.managedbuild.tool.gnu.cpp.compiler.input", "org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP|org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile");
legacyProfiles.put("cdt.managedbuild.tool.gnu.c.compiler.input.cygwin", "org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC");
legacyProfiles.put("cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin", "org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP");
legacyProfiles.put("cdt.managedbuild.tool.xlc.c.compiler.input", "org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile");
legacyProfiles.put("cdt.managedbuild.tool.xlc.cpp.c.compiler.input", "org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile");
legacyProfiles.put("cdt.managedbuild.tool.xlc.cpp.compiler.input", "org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP");
// Toolchains
// TODO -doublecheck
// legacyProfiles.put(toolchainId, scannerConfigDiscoveryProfileId);
}
return legacyProfiles.get(id);
}
} }

View file

@ -64,6 +64,7 @@ import org.eclipse.cdt.internal.core.CharOperation;
import org.eclipse.cdt.internal.core.cdtvariables.CoreVariableSubstitutor; import org.eclipse.cdt.internal.core.cdtvariables.CoreVariableSubstitutor;
import org.eclipse.cdt.internal.core.cdtvariables.DefaultVariableContextInfo; import org.eclipse.cdt.internal.core.cdtvariables.DefaultVariableContextInfo;
import org.eclipse.cdt.internal.core.cdtvariables.ICoreVariableContextInfo; import org.eclipse.cdt.internal.core.cdtvariables.ICoreVariableContextInfo;
import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsLogger;
import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsProvidersSerializer; import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsProvidersSerializer;
import org.eclipse.cdt.internal.core.model.APathEntry; import org.eclipse.cdt.internal.core.model.APathEntry;
import org.eclipse.cdt.internal.core.model.CModelStatus; import org.eclipse.cdt.internal.core.model.CModelStatus;
@ -2016,6 +2017,9 @@ public class PathEntryTranslator {
public boolean visit(PathSettingsContainer container) { public boolean visit(PathSettingsContainer container) {
CResourceData rcData = (CResourceData)container.getValue(); CResourceData rcData = (CResourceData)container.getValue();
if (rcData != null) { if (rcData != null) {
// AG FIXME - temporary log to remove before CDT Juno release
temporaryLog(cfgDescription, kinds, rcData);
PathEntryCollector child = collector.createChild(container.getPath()); PathEntryCollector child = collector.createChild(container.getPath());
for (int kind : kinds) { for (int kind : kinds) {
List<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>(); List<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>();
@ -2027,6 +2031,24 @@ public class PathEntryTranslator {
} }
return true; return true;
} }
// AG FIXME - temporary log to remove before CDT Juno release
@Deprecated
private void temporaryLog(final ICConfigurationDescription cfgDescription, final int[] kinds, CResourceData rcData) {
String kindsStr="";
for (int kind : kinds) {
String kstr = LanguageSettingEntriesSerializer.kindToString(kind);
if (kindsStr.length()==0) {
kindsStr = kstr;
} else {
kindsStr += "|" + kstr;
}
}
final IProject prj = cfgDescription.getProjectDescription().getProject();
String log_msg = "path="+prj+"/"+rcData.getPath()+", kind=["+kindsStr+"]"+" (PathEntryTranslator.collectEntries())";
LanguageSettingsLogger.logInfo(log_msg);
}
}); });
return collector; return collector;
} }

View file

@ -0,0 +1,79 @@
package org.eclipse.cdt.internal.core.language.settings.providers;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
/**
* AG FIXME -Temporary class for logging language settings providers development.
* To remove before CDT Juno release
*
*/
@Deprecated
public class LanguageSettingsLogger {
private static boolean isEnabled() {
return false;
// return true;
}
/**
* @param msg
* @noreference This method is not intended to be referenced by clients.
*/
@Deprecated
public static void logInfo(String msg) {
if (isEnabled()) {
Exception e = new Exception(msg);
IStatus status = new Status(IStatus.INFO, CCorePlugin.PLUGIN_ID, msg, e);
CCorePlugin.log(status);
}
}
/**
* @param msg
* @noreference This method is not intended to be referenced by clients.
*/
@Deprecated
public static void logWarning(String msg) {
if (isEnabled()) {
Exception e = new Exception(msg);
IStatus status = new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, msg, e);
CCorePlugin.log(status);
}
}
/**
* @param msg
* @noreference This method is not intended to be referenced by clients.
*/
@Deprecated
public static void logError(String msg) {
if (isEnabled()) {
Exception e = new Exception(msg);
IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, msg, e);
CCorePlugin.log(status);
}
}
/**
* @param rc
* @param who - pass "this" (calling class instance) here
* @noreference This method is not intended to be referenced by clients.
*/
@Deprecated
public static void logScannerInfoProvider(IResource rc, Object who) {
if (isEnabled()) {
String msg = "rc="+rc+" <-- "+who.getClass().getSimpleName(); //$NON-NLS-1$ //$NON-NLS-2$
if (rc instanceof IFile) {
LanguageSettingsLogger.logInfo(msg);
} else if (rc instanceof IProject) {
LanguageSettingsLogger.logWarning(msg);
} else {
LanguageSettingsLogger.logError(msg);
}
}
}
}

View file

@ -28,6 +28,8 @@ import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager;
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsSerializableProvider; import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsSerializableProvider;
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsStorage; import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsStorage;
import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport; 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.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.core.settings.model.ICProjectDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescription;
@ -498,6 +500,9 @@ public class LanguageSettingsProvidersSerializer {
* @throws CoreException * @throws CoreException
*/ */
public static void serializeLanguageSettingsWorkspace() throws CoreException { public static void serializeLanguageSettingsWorkspace() throws CoreException {
// AG FIXME - temporary log to remove before CDT Juno release
LanguageSettingsLogger.logWarning("LanguageSettingsProvidersSerializer.serializeLanguageSettingsWorkspace()");
URI uriStoreWsp = getStoreInWorkspaceArea(STORAGE_WORKSPACE_LANGUAGE_SETTINGS); URI uriStoreWsp = getStoreInWorkspaceArea(STORAGE_WORKSPACE_LANGUAGE_SETTINGS);
List<LanguageSettingsSerializableProvider> serializableWorkspaceProviders = new ArrayList<LanguageSettingsSerializableProvider>(); List<LanguageSettingsSerializableProvider> serializableWorkspaceProviders = new ArrayList<LanguageSettingsSerializableProvider>();
for (ILanguageSettingsProvider provider : rawGlobalWorkspaceProviders.values()) { for (ILanguageSettingsProvider provider : rawGlobalWorkspaceProviders.values()) {
@ -804,6 +809,9 @@ public class LanguageSettingsProvidersSerializer {
*/ */
public static void serializeLanguageSettings(ICProjectDescription prjDescription) throws CoreException { public static void serializeLanguageSettings(ICProjectDescription prjDescription) throws CoreException {
IProject project = prjDescription.getProject(); IProject project = prjDescription.getProject();
// AG FIXME - temporary log to remove before CDT Juno release
LanguageSettingsLogger.logWarning("LanguageSettingsProvidersSerializer.serializeLanguageSettings() for " + project);
try { try {
// Using side effect of adding the module to the storage // Using side effect of adding the module to the storage
prjDescription.getStorage(CPROJECT_STORAGE_MODULE, true); prjDescription.getStorage(CPROJECT_STORAGE_MODULE, true);
@ -1229,6 +1237,35 @@ public class LanguageSettingsProvidersSerializer {
return provider instanceof LanguageSettingsWorkspaceProvider; return provider instanceof LanguageSettingsWorkspaceProvider;
} }
/**
* Reports inconsistency in log.
* AG FIXME - temporary method to remove before CDT Juno release
*/
@SuppressWarnings("nls")
@Deprecated
public static void assertConsistency(ICProjectDescription prjDescription) {
if (prjDescription != null) {
List<ILanguageSettingsProvider> prjProviders = new ArrayList<ILanguageSettingsProvider>();
for (ICConfigurationDescription cfgDescription : prjDescription.getConfigurations()) {
if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
for (ILanguageSettingsProvider provider : providers) {
if (!LanguageSettingsManager.isWorkspaceProvider(provider)) {
if (isInList(prjProviders, provider)) {
IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "Inconsistent state, duplicate LSP in project description "
+ "[" + System.identityHashCode(provider) + "] "
+ provider);
CoreException e = new CoreException(status);
CCorePlugin.log(e);
}
prjProviders.add(provider);
}
}
}
}
}
}
/** /**
* Check that this particular element is in the list. * Check that this particular element is in the list.
*/ */
@ -1320,9 +1357,13 @@ public class LanguageSettingsProvidersSerializer {
*/ */
public static void reRegisterListeners(ICProjectDescription oldPrjDescription, ICProjectDescription newPrjDescription) { public static void reRegisterListeners(ICProjectDescription oldPrjDescription, ICProjectDescription newPrjDescription) {
if (oldPrjDescription == newPrjDescription) { if (oldPrjDescription == newPrjDescription) {
assertConsistency(oldPrjDescription);
return; return;
} }
assertConsistency(oldPrjDescription);
assertConsistency(newPrjDescription);
List<ICListenerAgent> oldListeners = getListeners(oldPrjDescription); List<ICListenerAgent> oldListeners = getListeners(oldPrjDescription);
List<ListenerAssociation> newAssociations = getListenersAssociations(newPrjDescription); List<ListenerAssociation> newAssociations = getListenersAssociations(newPrjDescription);
@ -1389,6 +1430,9 @@ public class LanguageSettingsProvidersSerializer {
* @param event - the {@link ILanguageSettingsChangeEvent} event to be broadcast. * @param event - the {@link ILanguageSettingsChangeEvent} event to be broadcast.
*/ */
private static void notifyLanguageSettingsChangeListeners(ILanguageSettingsChangeEvent event) { private static void notifyLanguageSettingsChangeListeners(ILanguageSettingsChangeEvent event) {
// AG FIXME - temporary log to remove before CDT Juno release
LanguageSettingsLogger.logWarning("Firing " + event);
for (Object listener : fLanguageSettingsChangeListeners.getListeners()) { for (Object listener : fLanguageSettingsChangeListeners.getListeners()) {
((ILanguageSettingsChangeListener) listener).handleEvent(event); ((ILanguageSettingsChangeListener) listener).handleEvent(event);
} }

View file

@ -64,6 +64,9 @@ public class LanguageSettingsScannerInfoProvider implements IScannerInfoProvider
@Override @Override
public ExtendedScannerInfo getScannerInformation(IResource rc) { public ExtendedScannerInfo getScannerInformation(IResource rc) {
// AG FIXME - temporary log to remove before CDT Juno release
LanguageSettingsLogger.logScannerInfoProvider(rc, this);
IProject project = rc.getProject(); IProject project = rc.getProject();
if (project==null) if (project==null)
return DUMMY_SCANNER_INFO; return DUMMY_SCANNER_INFO;

View file

@ -35,6 +35,7 @@ import org.eclipse.cdt.core.settings.model.ICProjectDescriptionListener;
import org.eclipse.cdt.core.settings.model.ICResourceDescription; import org.eclipse.cdt.core.settings.model.ICResourceDescription;
import org.eclipse.cdt.core.settings.model.ICSettingBase; import org.eclipse.cdt.core.settings.model.ICSettingBase;
import org.eclipse.cdt.core.settings.model.ICSettingEntry; import org.eclipse.cdt.core.settings.model.ICSettingEntry;
import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsLogger;
import org.eclipse.cdt.utils.EFSExtensionManager; import org.eclipse.cdt.utils.EFSExtensionManager;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
@ -77,6 +78,9 @@ public class DescriptionScannerInfoProvider implements IScannerInfoProvider, ICP
@Override @Override
public IScannerInfo getScannerInformation(IResource resource) { public IScannerInfo getScannerInformation(IResource resource) {
// AG FIXME - temporary log to remove before CDT Juno release
LanguageSettingsLogger.logScannerInfoProvider(resource, this);
if(!fInited) if(!fInited)
updateProjCfgInfo(CProjectDescriptionManager.getInstance().getProjectDescription(fProject, false)); updateProjCfgInfo(CProjectDescriptionManager.getInstance().getProjectDescription(fProject, false));

View file

@ -782,5 +782,12 @@
factoryClass="org.eclipse.cdt.internal.core.resources.ResourceExclusionFactory"> factoryClass="org.eclipse.cdt.internal.core.resources.ResourceExclusionFactory">
</exclusionFactory> </exclusionFactory>
</extension> </extension>
<extension
point="org.eclipse.cdt.core.EFSExtensionProvider">
<EFSExtensionProvider
class="org.eclipse.cdt.internal.core.resources.CygwinEFSExtensionProvider"
scheme="cygwin">
</EFSExtensionProvider>
</extension>
</plugin> </plugin>

View file

@ -29,8 +29,10 @@ import org.eclipse.cdt.core.model.IMacroFileEntry;
import org.eclipse.cdt.core.parser.IScannerInfo; import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.core.parser.IScannerInfoChangeListener; import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
import org.eclipse.cdt.core.parser.IScannerInfoProvider; import org.eclipse.cdt.core.parser.IScannerInfoProvider;
import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsLogger;
import org.eclipse.cdt.internal.core.model.PathEntryManager; import org.eclipse.cdt.internal.core.model.PathEntryManager;
import org.eclipse.cdt.internal.core.settings.model.ScannerInfoProviderProxy; import org.eclipse.cdt.internal.core.settings.model.ScannerInfoProviderProxy;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
@ -96,6 +98,13 @@ public class ScannerProvider extends AbstractCExtension implements IScannerInfoP
*/ */
@Override @Override
public IScannerInfo getScannerInformation(IResource resource) { public IScannerInfo getScannerInformation(IResource resource) {
// AG FIXME - temporary log to remove before CDT Juno release
if (resource instanceof IFile) {
LanguageSettingsLogger.logInfo("rc="+resource+" (ScannerProvider.getScannerInformation())");
} else {
LanguageSettingsLogger.logWarning("rc="+resource+" (ScannerProvider.getScannerInformation())");
}
IPath resPath = resource.getFullPath(); IPath resPath = resource.getFullPath();
try { try {

View file

@ -0,0 +1,32 @@
/*******************************************************************************
* Copyright (c) 2011, 2011 Andrew Gvozdev and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andrew Gvozdev - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.resources;
import java.net.URI;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.EFSExtensionProvider;
import org.eclipse.cdt.internal.core.Cygwin;
public class CygwinEFSExtensionProvider extends EFSExtensionProvider {
@Override
public String getMappedPath(URI locationURI) {
String cygwinPath = getPathFromURI(locationURI);
String windowsPath = null;
try {
windowsPath = Cygwin.cygwinToWindowsPath(cygwinPath);
} catch (Exception e) {
CCorePlugin.log(e);
}
return windowsPath;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

View file

@ -231,6 +231,7 @@ ExcludeAction.label=Exclude from Build...
BuildConfigurationActionSet.descr=Build active configuration for the current project BuildConfigurationActionSet.descr=Build active configuration for the current project
BuildLoggingPreferencePage.name=Logging BuildLoggingPreferencePage.name=Logging
LanguageSettingsProvidersPropertyPage.name=Preprocessor Include Paths, Macros etc.
# Common Editor ruler actions # Common Editor ruler actions
AddTask.label=Add &Task... AddTask.label=Add &Task...

View file

@ -3370,7 +3370,7 @@
</enabledWhen> </enabledWhen>
</page> </page>
<page <page
name="Preprocessor Include Paths, Macros etc." name="%LanguageSettingsProvidersPropertyPage.name"
id="org.eclipse.cdt.ui.language.settings" id="org.eclipse.cdt.ui.language.settings"
class="org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage" class="org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage"
category="org.eclipse.cdt.ui.newui.Page_head_general"> category="org.eclipse.cdt.ui.newui.Page_head_general">
@ -3378,7 +3378,7 @@
<adapt type="org.eclipse.core.resources.IResource"> <adapt type="org.eclipse.core.resources.IResource">
<and> <and>
<test property="org.eclipse.core.resources.projectNature" value="org.eclipse.cdt.core.cnature"/> <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.cdt.core.cnature"/>
<test property="org.eclipse.cdt.ui.checkPreference" value="org.eclipse.cdt.ui:properties.providers.tab.disable=false"/> <test property="org.eclipse.cdt.ui.checkPreference" value="org.eclipse.cdt.core:language.settings.providers.disabled=false"/>
</and> </and>
</adapt> </adapt>
</enabledWhen> </enabledWhen>
@ -4339,6 +4339,7 @@
icon="icons/obj16/ls_entries.gif" icon="icons/obj16/ls_entries.gif"
name="Entries" name="Entries"
weight="010" weight="010"
helpId="FIXME cdt_u_prop_pns_inc"
parent="org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage" parent="org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage"
tooltip="%AllLanguageSettingEntries.tooltip"/> tooltip="%AllLanguageSettingEntries.tooltip"/>
<tab <tab
@ -4346,6 +4347,7 @@
icon="icons/obj16/extension_obj.gif" icon="icons/obj16/extension_obj.gif"
name="Providers" name="Providers"
weight="020" weight="020"
helpId="FIXME cdt_u_prop_pns_inc"
parent="org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage" parent="org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage"
tooltip="%AllLanguageSettingEntries.tooltip"/> tooltip="%AllLanguageSettingEntries.tooltip"/>
</extension> </extension>

View file

@ -47,6 +47,7 @@ import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvide
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper; import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsBaseProvider; import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsBaseProvider;
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager; import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager;
import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.model.LanguageManager; import org.eclipse.cdt.core.model.LanguageManager;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
@ -56,7 +57,6 @@ import org.eclipse.cdt.core.settings.model.ICSettingEntry;
import org.eclipse.cdt.ui.CDTSharedImages; import org.eclipse.cdt.ui.CDTSharedImages;
import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab; import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
import org.eclipse.cdt.internal.ui.newui.LanguageSettingsImages; import org.eclipse.cdt.internal.ui.newui.LanguageSettingsImages;
import org.eclipse.cdt.internal.ui.newui.Messages; import org.eclipse.cdt.internal.ui.newui.Messages;
@ -1054,7 +1054,7 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab {
List<ILanguageSettingsProvider> newProviders = new ArrayList<ILanguageSettingsProvider>(oldProviders.size()); List<ILanguageSettingsProvider> newProviders = new ArrayList<ILanguageSettingsProvider>(oldProviders.size());
// clear entries for a given resource for all languages where applicable // clear entries for a given resource for all languages where applicable
providers: for (ILanguageSettingsProvider provider : oldProviders) { providers: for (ILanguageSettingsProvider provider : oldProviders) {
ILanguageSettingsEditableProvider providerCopy = null; ILanguageSettingsEditableProvider providerCopy = null;
if (provider instanceof ILanguageSettingsEditableProvider) { if (provider instanceof ILanguageSettingsEditableProvider) {
for (TreeItem langItems : treeLanguages.getItems()) { for (TreeItem langItems : treeLanguages.getItems()) {
@ -1113,7 +1113,7 @@ providers: for (ILanguageSettingsProvider provider : oldProviders) {
@Override @Override
public boolean canBeVisible() { public boolean canBeVisible() {
if (CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS)) { if (!ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(null)) {
return false; return false;
} }

View file

@ -49,6 +49,7 @@ import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvide
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper; 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.LanguageSettingsManager;
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsSerializableProvider; import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsSerializableProvider;
import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICResourceDescription; import org.eclipse.cdt.core.settings.model.ICResourceDescription;
import org.eclipse.cdt.ui.CDTSharedImages; import org.eclipse.cdt.ui.CDTSharedImages;
@ -56,7 +57,6 @@ import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.dialogs.ICOptionPage; import org.eclipse.cdt.ui.dialogs.ICOptionPage;
import org.eclipse.cdt.ui.language.settings.providers.AbstractLanguageSettingProviderOptionPage; import org.eclipse.cdt.ui.language.settings.providers.AbstractLanguageSettingProviderOptionPage;
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab; import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
import org.eclipse.cdt.utils.ui.controls.TabFolderLayout; import org.eclipse.cdt.utils.ui.controls.TabFolderLayout;
import org.eclipse.cdt.internal.ui.newui.Messages; import org.eclipse.cdt.internal.ui.newui.Messages;
@ -1161,7 +1161,7 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
@Override @Override
public boolean canBeVisible() { public boolean canBeVisible() {
if (CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS)) { if (!ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(null)) {
return false; return false;
} }

View file

@ -24,11 +24,6 @@ import org.eclipse.cdt.ui.newui.ICPropertyTab;
* @noinstantiate This class is not intended to be instantiated by clients. * @noinstantiate This class is not intended to be instantiated by clients.
*/ */
public class LanguageSettingsProvidersPage extends AbstractPage { public class LanguageSettingsProvidersPage extends AbstractPage {
/** @since 5.4 */ // temporary key, subject to removal
public static final String KEY_NO_SHOW_PROVIDERS = "properties.providers.tab.disable"; //$NON-NLS-1$
/** @since 5.4 */ // temporary key, subject to removal
public static final String KEY_NEWSD = "wizard.try.new.sd.enable"; //$NON-NLS-1$
private static boolean isLanguageSettingsProvidersEnabled = false; private static boolean isLanguageSettingsProvidersEnabled = false;
private static IProject project = null; private static IProject project = null;

View file

@ -218,6 +218,28 @@ public class CDTSharedImages {
public static final String IMG_VIEW_PIN_ACTION_B = "icons/obj16/toolbar_pinned_b.gif"; //$NON-NLS-1$ public static final String IMG_VIEW_PIN_ACTION_B = "icons/obj16/toolbar_pinned_b.gif"; //$NON-NLS-1$
public static final String IMG_VIEW_PIN_ACTION_MULTI = "icons/obj16/toolbar_pinned_multi.gif"; //$NON-NLS-1$ public static final String IMG_VIEW_PIN_ACTION_MULTI = "icons/obj16/toolbar_pinned_multi.gif"; //$NON-NLS-1$
// Language Settings Images extras
/** @since 5.4 */
public static final String IMG_OVR_GLOBAL = "icons/ovr16/global_ovr.gif"; //$NON-NLS-1$
/** @since 5.4 */
public static final String IMG_OVR_IMPORT = "icons/ovr16/import_co.gif"; //$NON-NLS-1$
/** @since 5.4 */
public static final String IMG_OVR_LINK = "icons/ovr16/link_ovr.gif"; //$NON-NLS-1$
/** @since 5.4 */
public static final String IMG_OVR_CONFIGURATION = "icons/ovr16/cfg_ovr.gif"; //$NON-NLS-1$
/** @since 5.4 */
public static final String IMG_OVR_INDEXED = "icons/ovr16/indexedFile.gif"; //$NON-NLS-1$
/** @since 5.4 */
public static final String IMG_OVR_REFERENCE = "icons/ovr16/referencedby_co.gif"; //$NON-NLS-1$
/** @since 5.4 */
public static final String IMG_OVR_PROJECT = "icons/ovr16/project_co.gif"; //$NON-NLS-1$
/** @since 5.4 */
public static final String IMG_OVR_CONTEXT = "icons/ovr16/overlay-has-context.gif"; //$NON-NLS-1$
/** @since 5.4 */
public static final String IMG_OVR_LOCK = "icons/ovr16/lock_ovr.gif"; //$NON-NLS-1$
/** @since 5.4 */
public static final String IMG_OVR_EMPTY = "icons/ovr16/empty_ovr.png"; //$NON-NLS-1$
/** /**
* The method finds URL of the image corresponding to the key which could be project-relative path * The method finds URL of the image corresponding to the key which could be project-relative path
* of the image in org.eclipse.cdt.ui plugin or a (previously registered) string representation of URL * of the image in org.eclipse.cdt.ui plugin or a (previously registered) string representation of URL

View file

@ -40,6 +40,8 @@ public class CDTPrefUtil {
public static final String KEY_EXPORT = "properties.export.page.enable"; //$NON-NLS-1$ public static final String KEY_EXPORT = "properties.export.page.enable"; //$NON-NLS-1$
/** @since 5.2 Show the "Include Files" settings entry tab */ /** @since 5.2 Show the "Include Files" settings entry tab */
public static final String KEY_SHOW_INC_FILES = "properties.includefiles.page.enable"; //$NON-NLS-1$ public static final String KEY_SHOW_INC_FILES = "properties.includefiles.page.enable"; //$NON-NLS-1$
/** @since 5.4 Show the "Scanner Discovery" tab*/
public static final String KEY_SHOW_SD = "properties.sd.page.enable"; //$NON-NLS-1$
/** @since 5.2 */ /** @since 5.2 */
public static final String KEY_TIPBOX = "properties.option.tipbox.enable"; //$NON-NLS-1$ public static final String KEY_TIPBOX = "properties.option.tipbox.enable"; //$NON-NLS-1$
// string keys // string keys
@ -47,30 +49,30 @@ public class CDTPrefUtil {
public static final String KEY_CONFSET = "workingsets.selected.configs"; //$NON-NLS-1$ public static final String KEY_CONFSET = "workingsets.selected.configs"; //$NON-NLS-1$
// integer keys // integer keys
public static final String KEY_POSSAVE = "properties.save.position"; //$NON-NLS-1$ public static final String KEY_POSSAVE = "properties.save.position"; //$NON-NLS-1$
public static final int POSITION_SAVE_SIZE = 0; public static final int POSITION_SAVE_SIZE = 0;
public static final int POSITION_SAVE_NONE = 2; public static final int POSITION_SAVE_NONE = 2;
public static final int POSITION_SAVE_BOTH = 3; public static final int POSITION_SAVE_BOTH = 3;
public static final String KEY_DISC_NAMES = "properties.discovery.naming"; //$NON-NLS-1$ public static final String KEY_DISC_NAMES = "properties.discovery.naming"; //$NON-NLS-1$
public static final int DISC_NAMING_UNIQUE_OR_BOTH = 0; public static final int DISC_NAMING_UNIQUE_OR_BOTH = 0;
public static final int DISC_NAMING_UNIQUE_OR_IDS = 1; public static final int DISC_NAMING_UNIQUE_OR_IDS = 1;
public static final int DISC_NAMING_ALWAYS_BOTH = 2; public static final int DISC_NAMING_ALWAYS_BOTH = 2;
public static final int DISC_NAMING_ALWAYS_IDS = 3; public static final int DISC_NAMING_ALWAYS_IDS = 3;
public static final int DISC_NAMING_DEFAULT = DISC_NAMING_UNIQUE_OR_BOTH; public static final int DISC_NAMING_DEFAULT = DISC_NAMING_UNIQUE_OR_BOTH;
/** Property key used for string list display mode for multi-configuration edits (conjunction/disjunction) */ /** Property key used for string list display mode for multi-configuration edits (conjunction/disjunction) */
public static final String KEY_DMODE = "properties.multi.displ.mode"; //$NON-NLS-1$ public static final String KEY_DMODE = "properties.multi.displ.mode"; //$NON-NLS-1$
/** Conjunction implies showing only common elements (intersection) */ /** Conjunction implies showing only common elements (intersection) */
public static final int DMODE_CONJUNCTION = 1; public static final int DMODE_CONJUNCTION = 1;
/** Disjunction implies showing all elements (union) */ /** Disjunction implies showing all elements (union) */
public static final int DMODE_DISJUNCTION = 2; public static final int DMODE_DISJUNCTION = 2;
/** Property key used for string list write mode for multi-configuration edits (modify/replace) */ /** Property key used for string list write mode for multi-configuration edits (modify/replace) */
public static final String KEY_WMODE = "properties.multi.write.mode"; //$NON-NLS-1$ public static final String KEY_WMODE = "properties.multi.write.mode"; //$NON-NLS-1$
/** Modify implies changing only given elements and not changing any others */ /** Modify implies changing only given elements and not changing any others */
public static final int WMODE_MODIFY = 4; public static final int WMODE_MODIFY = 4;
/** Replace implies replacing the whole list with the given one, overwriting old entries */ /** Replace implies replacing the whole list with the given one, overwriting old entries */
public static final int WMODE_REPLACE = 8; public static final int WMODE_REPLACE = 8;
public static final String NULL = "NULL"; //$NON-NLS-1$ public static final String NULL = "NULL"; //$NON-NLS-1$
private static final IPreferenceStore pref = CUIPlugin.getDefault().getPreferenceStore(); private static final IPreferenceStore pref = CUIPlugin.getDefault().getPreferenceStore();
@ -261,18 +263,16 @@ public class CDTPrefUtil {
private static final Object[] getListForDisplay(Object[][] input, int mode, Comparator<Object> cmp) { private static final Object[] getListForDisplay(Object[][] input, int mode, Comparator<Object> cmp) {
if (input == null || input.length == 0) if (input == null || input.length == 0)
return EMPTY_ARRAY; return EMPTY_ARRAY;
if (input.length == 1) { if (input.length == 1) {
return (input[0] == null) ? return (input[0] == null) ? EMPTY_ARRAY : input[0];
EMPTY_ARRAY :
input[0];
} }
Object[] s1 = input[0]; Object[] s1 = input[0];
if (s1 == null || if (s1 == null || s1.length == 0)
s1.length == 0)
return EMPTY_ARRAY; return EMPTY_ARRAY;
if (getMultiCfgStringListDisplayMode() == DMODE_CONJUNCTION)
{ if (getMultiCfgStringListDisplayMode() == DMODE_CONJUNCTION) {
ArrayList<Object> lst = new ArrayList<Object>(); ArrayList<Object> lst = new ArrayList<Object>();
for (int i=0; i<s1.length; i++) { for (int i=0; i<s1.length; i++) {
if (s1[i] == null) if (s1[i] == null)
@ -280,10 +280,12 @@ public class CDTPrefUtil {
boolean found = true; boolean found = true;
for (int k = 1; k<input.length; k++) { for (int k = 1; k<input.length; k++) {
Object[] s2 = input[k]; Object[] s2 = input[k];
if (s2 == null || s2.length == 0) if (s2 == null || s2.length == 0) {
return EMPTY_ARRAY; return EMPTY_ARRAY;
if (i == 0) }
if (i == 0) {
Arrays.sort(s2, cmp); Arrays.sort(s2, cmp);
}
if (Arrays.binarySearch(s2, s1[i], cmp) < 0) { if (Arrays.binarySearch(s2, s1[i], cmp) < 0) {
found = false; found = false;
break; break;
@ -297,11 +299,12 @@ public class CDTPrefUtil {
} }
TreeSet<Object> lst = new TreeSet<Object>(cmp); // set, to avoid doubles TreeSet<Object> lst = new TreeSet<Object>(cmp); // set, to avoid doubles
for (Object[] element : input) { for (Object[] element : input) {
if (element == null || if (element == null || element.length == 0) {
element.length == 0)
continue; continue;
for (Object element2 : element) }
for (Object element2 : element) {
lst.add(element2); lst.add(element2);
}
} }
s1 = lst.toArray(); s1 = lst.toArray();
Arrays.sort(s1, cmp); Arrays.sort(s1, cmp);

View file

@ -522,18 +522,19 @@
name="%TargetName.xlc.exe" name="%TargetName.xlc.exe"
projectMacroSupplier="org.eclipse.cdt.managedbuilder.xlc.ui.XLCProjectMacroSupplier"> projectMacroSupplier="org.eclipse.cdt.managedbuilder.xlc.ui.XLCProjectMacroSupplier">
<configuration <configuration
name="%ConfigName.Dbg" artifactExtension="exe"
artifactExtension="exe" cleanCommand="rm -rf"
cleanCommand="rm -rf" errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser" id="cdt.managedbuild.config.xlc.exe.debug"
id="cdt.managedbuild.config.xlc.exe.debug"> languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser"
name="%ConfigName.Dbg">
<toolChain <toolChain
archList="all" archList="all"
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.xlc.aix.AixConfigurationEnvironmentSupplier" configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.xlc.aix.AixConfigurationEnvironmentSupplier"
id="cdt.managedbuild.toolchain.xlc.exe.debug" id="cdt.managedbuild.toolchain.xlc.exe.debug"
name="%ToolChainName.Dbg" name="%ToolChainName.Dbg"
osList="all" osList="all"
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP" languageSettingsProviders="org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser;org.eclipse.cdt.managedbuilder.xlc.core.XlcBuiltinSpecsDetector"
targetTool="cdt.managedbuild.tool.xlc.c.linker.exe.debug;cdt.managedbuild.tool.xlc.cpp.linker.exe.debug"> targetTool="cdt.managedbuild.tool.xlc.c.linker.exe.debug;cdt.managedbuild.tool.xlc.cpp.linker.exe.debug">
<targetPlatform <targetPlatform
id="cdt.managedbuild.target.xlc.platform.exe.debug" id="cdt.managedbuild.target.xlc.platform.exe.debug"
@ -588,17 +589,18 @@
</toolChain> </toolChain>
</configuration> </configuration>
<configuration <configuration
name="%ConfigName.Rel" name="%ConfigName.Rel"
artifactExtension="exe" artifactExtension="exe"
cleanCommand="rm -rf" cleanCommand="rm -rf"
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser" errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
id="cdt.managedbuild.config.xlc.exe.release"> languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser"
id="cdt.managedbuild.config.xlc.exe.release">
<toolChain <toolChain
archList="all" archList="all"
id="cdt.managedbuild.toolchain.xlc.exe.release" id="cdt.managedbuild.toolchain.xlc.exe.release"
name="%ToolChainName.Rel" name="%ToolChainName.Rel"
osList="all" osList="all"
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP" languageSettingsProviders="org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser;org.eclipse.cdt.managedbuilder.xlc.core.XlcBuiltinSpecsDetector"
targetTool="cdt.managedbuild.tool.xlc.c.linker.exe.release;cdt.managedbuild.tool.xlc.cpp.linker.exe.release"> targetTool="cdt.managedbuild.tool.xlc.c.linker.exe.release;cdt.managedbuild.tool.xlc.cpp.linker.exe.release">
<targetPlatform <targetPlatform
id="cdt.managedbuild.target.xlc.platform.exe.release" id="cdt.managedbuild.target.xlc.platform.exe.release"
@ -661,15 +663,17 @@
name="%TargetName.xlc.so" name="%TargetName.xlc.so"
projectMacroSupplier="org.eclipse.cdt.managedbuilder.xlc.ui.XLCProjectMacroSupplier"> projectMacroSupplier="org.eclipse.cdt.managedbuilder.xlc.ui.XLCProjectMacroSupplier">
<configuration <configuration
name="%ConfigName.Dbg" name="%ConfigName.Dbg"
cleanCommand="rm -rf" cleanCommand="rm -rf"
artifactExtension="so" artifactExtension="so"
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser" errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
id="cdt.managedbuild.config.xlc.so.debug"> languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser"
id="cdt.managedbuild.config.xlc.so.debug">
<toolChain <toolChain
name="%ToolChainName.Dbg" id="cdt.managedbuild.toolchain.xlc.so.debug"
targetTool="cdt.managedbuild.tool.xlc.c.linker.so.debug;cdt.managedbuild.tool.xlc.cpp.linker.so.debug" languageSettingsProviders="org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser;org.eclipse.cdt.managedbuilder.xlc.core.XlcBuiltinSpecsDetector"
id="cdt.managedbuild.toolchain.xlc.so.debug"> name="%ToolChainName.Dbg"
targetTool="cdt.managedbuild.tool.xlc.c.linker.so.debug;cdt.managedbuild.tool.xlc.cpp.linker.so.debug">
<targetPlatform <targetPlatform
id="cdt.managedbuild.target.xlc.platform.so.debug" id="cdt.managedbuild.target.xlc.platform.so.debug"
name="%PlatformName.Dbg" name="%PlatformName.Dbg"
@ -723,15 +727,17 @@
</toolChain> </toolChain>
</configuration> </configuration>
<configuration <configuration
name="%ConfigName.Rel" name="%ConfigName.Rel"
cleanCommand="rm -rf" cleanCommand="rm -rf"
artifactExtension="so" artifactExtension="so"
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser" errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
id="cdt.managedbuild.config.xlc.so.release"> languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser"
id="cdt.managedbuild.config.xlc.so.release">
<toolChain <toolChain
name="%ToolChainName.Rel" id="cdt.managedbuild.toolchain.xlc.so.release"
targetTool="cdt.managedbuild.tool.xlc.c.linker.so.release;cdt.managedbuild.tool.xlc.cpp.linker.so.release" languageSettingsProviders="org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser;org.eclipse.cdt.managedbuilder.xlc.core.XlcBuiltinSpecsDetector"
id="cdt.managedbuild.toolchain.xlc.so.release"> name="%ToolChainName.Rel"
targetTool="cdt.managedbuild.tool.xlc.c.linker.so.release;cdt.managedbuild.tool.xlc.cpp.linker.so.release">
<targetPlatform <targetPlatform
id="cdt.managedbuild.target.xlc.platform.so.release" id="cdt.managedbuild.target.xlc.platform.so.release"
name="%PlatformName.Rel" name="%PlatformName.Rel"
@ -793,15 +799,17 @@
name="%TargetName.xlc.lib" name="%TargetName.xlc.lib"
projectMacroSupplier="org.eclipse.cdt.managedbuilder.xlc.ui.XLCProjectMacroSupplier"> projectMacroSupplier="org.eclipse.cdt.managedbuilder.xlc.ui.XLCProjectMacroSupplier">
<configuration <configuration
name="%ConfigName.Dbg" name="%ConfigName.Dbg"
cleanCommand="rm -rf" cleanCommand="rm -rf"
artifactExtension="lib" artifactExtension="lib"
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser" errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
id="cdt.managedbuild.config.xlc.lib.debug"> languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser"
id="cdt.managedbuild.config.xlc.lib.debug">
<toolChain <toolChain
name="%ToolChainName.Dbg" id="cdt.managedbuild.toolchain.xlc.lib.debug"
targetTool="cdt.managedbuild.tool.xlc.archiver.lib.debug" languageSettingsProviders="org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser;org.eclipse.cdt.managedbuilder.xlc.core.XlcBuiltinSpecsDetector"
id="cdt.managedbuild.toolchain.xlc.lib.debug"> name="%ToolChainName.Dbg"
targetTool="cdt.managedbuild.tool.xlc.archiver.lib.debug">
<targetPlatform <targetPlatform
id="cdt.managedbuild.target.xlc.platform.lib.debug" id="cdt.managedbuild.target.xlc.platform.lib.debug"
name="%PlatformName.Dbg" name="%PlatformName.Dbg"
@ -851,15 +859,17 @@
</toolChain> </toolChain>
</configuration> </configuration>
<configuration <configuration
name="%ConfigName.Rel" name="%ConfigName.Rel"
cleanCommand="rm -rf" cleanCommand="rm -rf"
artifactExtension="lib" artifactExtension="lib"
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser" errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
id="cdt.managedbuild.config.xlc.lib.release"> languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser"
id="cdt.managedbuild.config.xlc.lib.release">
<toolChain <toolChain
name="%ToolChainName.Rel" id="cdt.managedbuild.toolchain.xlc.lib.release"
targetTool="cdt.managedbuild.tool.xlc.archiver.lib.release" languageSettingsProviders="org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser;org.eclipse.cdt.managedbuilder.xlc.core.XlcBuiltinSpecsDetector"
id="cdt.managedbuild.toolchain.xlc.lib.release"> name="%ToolChainName.Rel"
targetTool="cdt.managedbuild.tool.xlc.archiver.lib.release">
<targetPlatform <targetPlatform
id="cdt.managedbuild.target.xlc.platform.lib.release" id="cdt.managedbuild.target.xlc.platform.lib.release"
name="%PlatformName.Rel" name="%PlatformName.Rel"
@ -3732,7 +3742,6 @@
id="cdt.managedbuild.tool.xlc.c.compiler.input" id="cdt.managedbuild.tool.xlc.c.compiler.input"
name="%inputType.c.name" name="%inputType.c.name"
primaryInput="true" primaryInput="true"
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"
sourceContentType="org.eclipse.cdt.core.cSource" sourceContentType="org.eclipse.cdt.core.cSource"
sources="c"> sources="c">
</inputType> </inputType>
@ -3753,7 +3762,6 @@
id="cdt.managedbuild.tool.xlc.cpp.c.compiler.input" id="cdt.managedbuild.tool.xlc.cpp.c.compiler.input"
name="%inputType.c.name.2" name="%inputType.c.name.2"
primaryInput="true" primaryInput="true"
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"
sourceContentType="org.eclipse.cdt.core.cSource" sourceContentType="org.eclipse.cdt.core.cSource"
sources="c"> sources="c">
</inputType> </inputType>
@ -3763,7 +3771,6 @@
id="cdt.managedbuild.tool.xlc.cpp.compiler.input" id="cdt.managedbuild.tool.xlc.cpp.compiler.input"
name="%inputType.cpp.name" name="%inputType.cpp.name"
primaryInput="true" primaryInput="true"
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"
sourceContentType="org.eclipse.cdt.core.cxxSource" sourceContentType="org.eclipse.cdt.core.cxxSource"
sources="c,C,cc,cxx,cpp"> sources="c,C,cc,cxx,cpp">
</inputType> </inputType>