bug 328007: [sd90] Design user interface for new scanner discovery
|
@ -461,6 +461,7 @@
|
|||
helpId="cdt_u_prop_pns_sym"
|
||||
parent="org.eclipse.cdt.make.internal.ui.properties.PathAndSymbolPage"
|
||||
tooltip="%Symbols.tooltip"/>
|
||||
<!-- AG FIXME - rather use managedbuilder page ??? -->
|
||||
<tab
|
||||
class="org.eclipse.cdt.ui.newui.ErrorParsTab"
|
||||
helpId="cdt_u_prop_build_setting_errparser"
|
||||
|
|
|
@ -25,6 +25,7 @@ public class AllLanguageSettingsProvidersMBSTests extends TestSuite {
|
|||
public AllLanguageSettingsProvidersMBSTests() {
|
||||
super(AllLanguageSettingsProvidersMBSTests.class.getName());
|
||||
|
||||
addTestSuite(LanguageSettingsProvidersMBSTest.class);
|
||||
addTestSuite(GCCBuildCommandParserTest.class);
|
||||
addTestSuite(BuiltinSpecsDetectorTest.class);
|
||||
addTestSuite(GCCBuiltinSpecsDetectorTest.class);
|
||||
|
|
|
@ -14,16 +14,23 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
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.CMacroEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
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.testplugin.ResourceHelper;
|
||||
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.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
|
||||
/**
|
||||
* 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
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
@ -55,6 +76,21 @@ public class GCCBuiltinSpecsDetectorTest extends BaseTestCase {
|
|||
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.
|
||||
*/
|
||||
|
@ -363,4 +399,68 @@ public class GCCBuiltinSpecsDetectorTest extends BaseTestCase {
|
|||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,190 @@
|
|||
/*******************************************************************************
|
||||
* 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);
|
||||
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, true);
|
||||
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgDescription);
|
||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(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());
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -308,13 +308,14 @@
|
|||
</managedBuildRevision>
|
||||
<configuration
|
||||
id="org.eclipse.cdt.build.core.emptycfg"
|
||||
languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;${Toolchain}"
|
||||
name="%cfg1_empty">
|
||||
</configuration>
|
||||
|
||||
<configuration
|
||||
id="org.eclipse.cdt.build.core.prefbase.cfg"
|
||||
name="%cfg1_base"
|
||||
>
|
||||
id="org.eclipse.cdt.build.core.prefbase.cfg"
|
||||
languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;${Toolchain}"
|
||||
name="%cfg1_base">
|
||||
<toolChain
|
||||
id="org.eclipse.cdt.build.core.prefbase.toolchain"
|
||||
name="%toolChain.name"
|
||||
|
@ -612,6 +613,14 @@
|
|||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</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
|
||||
class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser"
|
||||
id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"
|
||||
|
|
|
@ -263,7 +263,16 @@ Specifying this attribute is fully equivalent to specifying the "org.eclips
|
|||
<attribute name="errorParsers" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The semi-colon separated list of the default error parsers to be used with this configuration. The list is ordered with the first error parser on the list invoked first, the second error parser second, and so on. The list may contain the error parsers defined by CDT and/or other installed error parser extensions. The list of error parsers to be used may be changed by the user on a per-configuration basis. When specified, this overrides the tool-chain errorParsers attribute.
|
||||
The semi-colon separated list of the default error parsers to be used with this configuration. The list is ordered with the first error parser on the list invoked first, the second error parser second, and so on. The list may contain the error parsers defined by CDT and/or other installed error parser extensions. The list of error parsers to be used may be changed by the user on a per-configuration basis. When specified, this overrides the tool-chain errorParsers attribute.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="languageSettingsProviders" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Semicolon-separated list of providers ID implementing ILanguageSettingProvider interface.
|
||||
This field could be amended with toolchain-level providers list by using ${Toolchain} keyword. Provider ID can be prefixed with "*", in this case shared instance of the provider defined on workspace level is used. Also provider ID can be prefixed with "-" which will cause id to be removed from the preceeding list including providers defined with ${Toolchain} keyword.
|
||||
If this field is not specified, "*org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" (MBS Language Settings Provider) is used by default.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
|
@ -405,7 +414,15 @@ Specifying this attribute is fully equivalent to specifying the "org.eclips
|
|||
<attribute name="errorParsers" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The semi-colon separated list of the default error parsers to be used with this tool-chain. The list is ordered with the first error parser on the list invoked first, the second error parser second, and so on. The list may contain the error parsers defined by CDT and/or other installed error parser extensions. When specified, this overrides the tool errorParsers attributes of the tool children of the tool-chain and the builder child of the tool-chain.
|
||||
The semi-colon separated list of the default error parsers to be used with this tool-chain. The list is ordered with the first error parser on the list invoked first, the second error parser second, and so on. The list may contain the error parsers defined by CDT and/or other installed error parser extensions. When specified, this overrides the tool errorParsers attributes of the tool children of the tool-chain and the builder child of the tool-chain.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="languageSettingsProviders" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Semicolon-separated list of providers ID implementing ILanguageSettingProvider interface. Provider ID can be prefixed with "*", in this case shared instance of the provider defined on workspace level is used.
|
||||
This list could be adjusted on configuration level in the corresponding attribute.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
|
@ -732,14 +749,14 @@ The pathConverter of a toolchain applies for all tools of the toolchain except i
|
|||
<attribute name="customBuildStep" type="boolean">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies whether this Tool represents a user-define custom build step. The default is false. When True, the default value of the commandLinePattern attribute changes to “$(command)”.
|
||||
Specifies whether this Tool represents a user-define custom build step. The default is false. When True, the default value of the commandLinePattern attribute changes to “$(command)�.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="announcement" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies a string that is written to the build output prior to each invocation of the tool. The default value is “Invoking tool-name (tool-id)…”
|
||||
Specifies a string that is written to the build output prior to each invocation of the tool. The default value is “Invoking tool-name (tool-id)…�
|
||||
</documentation>
|
||||
<appInfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
|
@ -1066,7 +1083,7 @@ Overrides language id specified with the languageId attribute.
|
|||
<attribute name="primaryInputType" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The id of the input type that is used in determining the build “rules” for the output type and for the default name of the output file. The default is the input type with primaryInput == true.
|
||||
The id of the input type that is used in determining the build “rules� for the output type and for the default name of the output file. The default is the input type with primaryInput == true.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
|
@ -1080,7 +1097,7 @@ Overrides language id specified with the languageId attribute.
|
|||
<attribute name="outputPrefix" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Some tools produce files with a special prefix that must be specified. For example, a librarian on POSIX systems expects the output to be libtarget.a, so 'lib' 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 'lib' 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.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
|
@ -2035,11 +2052,11 @@ If the "buildPathResolver" attribute is specified, the "pathDelim
|
|||
<documentation>
|
||||
Represents the applicability type for this enablement.
|
||||
Can contain the following values:
|
||||
UI_VISIBILITY – the given enablement expression specifies whether the option is to be visible in UI,
|
||||
UI_ENABLEMENT – the given enablement expression specifies the enable state of the controls that represent the option in UI,
|
||||
CMD_USAGE – the given enablement expression specifies whether the option is to be used in command line
|
||||
UI_VISIBILITY – the given enablement expression specifies whether the option is to be visible in UI,
|
||||
UI_ENABLEMENT – the given enablement expression specifies the enable state of the controls that represent the option in UI,
|
||||
CMD_USAGE – the given enablement expression specifies whether the option is to be used in command line
|
||||
CONTAINER_ATTRIBUTE - the given enablement expressions specifies thecontainer attribute value
|
||||
ALL – this value means the combination of all the above values.
|
||||
ALL – this value means the combination of all the above values.
|
||||
|
||||
Several types could be specified simultaneously using the "|" as a delimiter, e.g.:
|
||||
type="UI_VISIBILITY|CMD_USAGE"
|
||||
|
@ -2173,7 +2190,7 @@ Default value is true.
|
|||
<attribute name="value" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies the expected value. If the current option value matches the value specified in this attribute, the checkOption element is treated as true, otherwise – as false.
|
||||
Specifies the expected value. If the current option value matches the value specified in this attribute, the checkOption element is treated as true, otherwise – as false.
|
||||
The expected value could be specified either as a string that may contain build macros or as a regular expression. During the comparison, the build macros are resolved and the option value is checked to match the resulting string or regular expression. The way the expected value is specified and treated depends on the value of the isRegex attribute
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
@ -2188,14 +2205,14 @@ The expected value could be specified either as a string that may contain build
|
|||
<attribute name="otherOptionId" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The id of the option which is to be compared with the option specified with the “optionId” attribute. The default is the id of the option that holds this expression. If the “value” attribute is specified, both the “otherOptionId” and the “otherHolderId” attributes are ignored. When searching for the option to be checked, MBS will examine all the options the holder contains along with all superclasses of each option to find the option with the specified id.
|
||||
The id of the option which is to be compared with the option specified with the “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.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="otherHolderId" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The option holder id that holds the option specified with the “otherOptionId” attribute. The default is the id of the holder that holds the container of this expression. If the “value” attribute is specified, both the “otherOptionId” and the “otherHolderId” attributes are ingnored. When searching for the needed holder, MBS will examine all the holders the current configuration contains along with all superclasses of each holder in order to find the holder with the specified id.
|
||||
The option holder id that holds the option specified with the “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.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
|
@ -2219,7 +2236,7 @@ The expected value could be specified either as a string that may contain build
|
|||
<attribute name="value" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies the expected value. If the current string specified in the “string” attribute matches the value specified in this attribute, the checkString element is treated as true, otherwise – as false.
|
||||
Specifies the expected value. If the current string specified in the “string� attribute matches the value specified in this attribute, the checkString element is treated as true, otherwise – as false.
|
||||
The expected value could be specified either as a string that might contain the build macros or as a regular expression.
|
||||
The way the value is specified and treated depends on the value of the isRegex attribute.
|
||||
</documentation>
|
||||
|
|
|
@ -159,7 +159,12 @@ public class CfgScannerConfigUtil {
|
|||
Set<String> profiles = new TreeSet<String>();
|
||||
|
||||
if (toolchain!=null) {
|
||||
String toolchainProfileId = toolchain.getScannerConfigDiscoveryProfileId();
|
||||
String toolchainProfileId = null;
|
||||
if (toolchain instanceof ToolChain) {
|
||||
toolchainProfileId = ((ToolChain) toolchain).getLegacyScannerConfigDiscoveryProfileId();
|
||||
} else {
|
||||
toolchainProfileId = toolchain.getScannerConfigDiscoveryProfileId();
|
||||
}
|
||||
if (toolchainProfileId!=null && toolchainProfileId.length()>0) {
|
||||
profiles.add(toolchainProfileId);
|
||||
}
|
||||
|
@ -227,7 +232,7 @@ public class CfgScannerConfigUtil {
|
|||
|
||||
Set<String> profiles = new TreeSet<String>();
|
||||
|
||||
String attribute = ((InputType) inputType).getDiscoveryProfileIdAttribute();
|
||||
String attribute = ((InputType) inputType).getLegacyDiscoveryProfileIdAttribute();
|
||||
if (attribute!=null) {
|
||||
// FIXME: temporary; we should add new method to IInputType instead of that
|
||||
for (String profileId : attribute.split("\\|")) { //$NON-NLS-1$
|
||||
|
|
|
@ -24,14 +24,14 @@ import org.eclipse.core.runtime.IPath;
|
|||
|
||||
/**
|
||||
* A tool-integrator defines default configurations as children of the project type.
|
||||
* These provide a template for the configurations added to the user's project,
|
||||
* which are stored in the project's .cproject file.
|
||||
* These provide a template for the configurations added to the user's project,
|
||||
* which are stored in the project's .cproject file.
|
||||
* <p>
|
||||
* The configuration contains one child of type tool-chain. This describes how the
|
||||
* The configuration contains one child of type tool-chain. This describes how the
|
||||
* project's resources are transformed into the build artifact. The configuration can
|
||||
* contain one or more children of type resourceConfiguration. These describe build
|
||||
* settings of individual resources that are different from the configuration as a whole.
|
||||
*
|
||||
*
|
||||
* @since 2.1
|
||||
* @noextend This class is not intended to be subclassed by clients.
|
||||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
|
@ -39,33 +39,35 @@ import org.eclipse.core.runtime.IPath;
|
|||
public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesContainer {
|
||||
public static final String ARTIFACT_NAME = "artifactName"; //$NON-NLS-1$
|
||||
public static final String CLEAN_COMMAND = "cleanCommand"; //$NON-NLS-1$
|
||||
public static final String PREBUILD_STEP = "prebuildStep"; //$NON-NLS-1$
|
||||
public static final String POSTBUILD_STEP = "postbuildStep"; //$NON-NLS-1$
|
||||
public static final String PREANNOUNCEBUILD_STEP = "preannouncebuildStep"; //$NON-NLS-1$
|
||||
public static final String POSTANNOUNCEBUILD_STEP = "postannouncebuildStep"; //$NON-NLS-1$
|
||||
public static final String PREBUILD_STEP = "prebuildStep"; //$NON-NLS-1$
|
||||
public static final String POSTBUILD_STEP = "postbuildStep"; //$NON-NLS-1$
|
||||
public static final String PREANNOUNCEBUILD_STEP = "preannouncebuildStep"; //$NON-NLS-1$
|
||||
public static final String POSTANNOUNCEBUILD_STEP = "postannouncebuildStep"; //$NON-NLS-1$
|
||||
// Schema element names
|
||||
public static final String CONFIGURATION_ELEMENT_NAME = "configuration"; //$NON-NLS-1$
|
||||
public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$
|
||||
/** @since 8.1 */
|
||||
public static final String LANGUAGE_SETTINGS_PROVIDERS = "languageSettingsProviders";
|
||||
public static final String EXTENSION = "artifactExtension"; //$NON-NLS-1$
|
||||
public static final String PARENT = "parent"; //$NON-NLS-1$
|
||||
|
||||
|
||||
public static final String DESCRIPTION = "description"; //$NON-NLS-1$
|
||||
|
||||
|
||||
public static final String BUILD_PROPERTIES = "buildProperties"; //$NON-NLS-1$
|
||||
public static final String BUILD_ARTEFACT_TYPE = "buildArtefactType"; //$NON-NLS-1$
|
||||
public static final String IS_SYSTEM = "isSystem"; //$NON-NLS-1$
|
||||
|
||||
public static final String SOURCE_ENTRIES = "sourceEntries"; //$NON-NLS-1$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the description of the configuration.
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getDescription();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the description of the receiver to the value specified in the argument
|
||||
*/
|
||||
|
@ -84,204 +86,212 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
* @param name - The name for the new tool chain
|
||||
* @param isExtensionElement - set {@code true} if the toolchain being created
|
||||
* represents extension point toolchain
|
||||
*
|
||||
*
|
||||
* @return IToolChain
|
||||
*/
|
||||
public IToolChain createToolChain(IToolChain superClass, String Id, String name, boolean isExtensionElement);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the extension that should be applied to build artifacts created by
|
||||
* Returns the extension that should be applied to build artifacts created by
|
||||
* this configuration.
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getArtifactExtension();
|
||||
public String getArtifactExtension();
|
||||
|
||||
/**
|
||||
* Returns the name of the final build artifact.
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getArtifactName();
|
||||
|
||||
/**
|
||||
* Returns the build arguments from this configuration's builder
|
||||
*
|
||||
* Returns the build arguments from this configuration's builder
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getBuildArguments();
|
||||
|
||||
/**
|
||||
* Returns the build command from this configuration's builder
|
||||
*
|
||||
* Returns the build command from this configuration's builder
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getBuildCommand();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the prebuild step command
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPrebuildStep();
|
||||
|
||||
/**
|
||||
* Returns the postbuild step command
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPostbuildStep();
|
||||
|
||||
/**
|
||||
* Returns the display string associated with the prebuild step
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPreannouncebuildStep();
|
||||
|
||||
/**
|
||||
* Returns the display string associated with the postbuild step
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPostannouncebuildStep();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPrebuildStep();
|
||||
|
||||
/**
|
||||
* Returns the postbuild step command
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPostbuildStep();
|
||||
|
||||
/**
|
||||
* Returns the display string associated with the prebuild step
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPreannouncebuildStep();
|
||||
|
||||
/**
|
||||
* Returns the display string associated with the postbuild step
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPostannouncebuildStep();
|
||||
|
||||
/**
|
||||
* Answers the OS-specific command to remove files created by the build
|
||||
* of this configuration.
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getCleanCommand();
|
||||
|
||||
/**
|
||||
* Answers the semicolon separated list of unique IDs of the error parsers associated
|
||||
* Answers the semicolon separated list of unique IDs of the error parsers associated
|
||||
* with this configuration.
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getErrorParserIds();
|
||||
|
||||
/**
|
||||
* Answers the ordered list of unique IDs of the error parsers associated
|
||||
* Answers the ordered list of unique IDs of the error parsers associated
|
||||
* with this configuration.
|
||||
*
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getErrorParserList();
|
||||
|
||||
|
||||
/**
|
||||
* Projects have C or CC natures. Tools can specify a filter so they are not
|
||||
* misapplied to a project. This method allows the caller to retrieve a list
|
||||
* of tools from a project that are correct for a project's nature.
|
||||
*
|
||||
* @return an array of <code>ITools</code> that have compatible filters
|
||||
* Returns default language settings providers IDs specified for the configuration.
|
||||
* @return default language settings providers IDs.
|
||||
*
|
||||
* @since 8.1
|
||||
*/
|
||||
public String[] getDefaultLanguageSettingsProvidersIds();
|
||||
|
||||
/**
|
||||
* Projects have C or CC natures. Tools can specify a filter so they are not
|
||||
* misapplied to a project. This method allows the caller to retrieve a list
|
||||
* of tools from a project that are correct for a project's nature.
|
||||
*
|
||||
* @return an array of <code>ITools</code> that have compatible filters
|
||||
* for this configuration.
|
||||
*/
|
||||
ITool[] getFilteredTools();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the managed-project parent of this configuration, if this is a
|
||||
* project configuration. Otherwise, returns <code>null</code>.
|
||||
*
|
||||
*
|
||||
* @return IManagedProject
|
||||
*/
|
||||
public IManagedProject getManagedProject();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the Eclipse project that owns the configuration.
|
||||
*
|
||||
*
|
||||
* @return IResource
|
||||
*/
|
||||
public IResource getOwner();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the configuration that this configuration is based on.
|
||||
*
|
||||
* Returns the configuration that this configuration is based on.
|
||||
*
|
||||
* @return IConfiguration
|
||||
*/
|
||||
public IConfiguration getParent();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the project-type parent of this configuration, if this is an
|
||||
* extension configuration. Otherwise, returns <code>null</code>.
|
||||
*
|
||||
*
|
||||
* @return IProjectType
|
||||
*/
|
||||
public IProjectType getProjectType();
|
||||
|
||||
|
||||
/**
|
||||
* @param path - path of the resource
|
||||
*
|
||||
*
|
||||
* @return the resource configuration child of this configuration
|
||||
* that is associated with the project resource, or <code>null</code> if none.
|
||||
*/
|
||||
public IResourceConfiguration getResourceConfiguration(String path);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the resource configuration children of this configuration.
|
||||
*
|
||||
*
|
||||
* @return IResourceConfigurations[]
|
||||
*/
|
||||
public IResourceConfiguration[] getResourceConfigurations();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the <code>ITool</code> in this configuration's tool-chain with
|
||||
* the same id as the argument, or <code>null</code>.
|
||||
*
|
||||
* the same id as the argument, or <code>null</code>.
|
||||
*
|
||||
* @param id unique identifier to search for
|
||||
* @return ITool
|
||||
*/
|
||||
public ITool getTool(String id);
|
||||
|
||||
/**
|
||||
* Returns the <code>ITool</code> in this configuration's tool-chain with
|
||||
* the specified ID, or the tool(s) with a superclass with this id.
|
||||
*
|
||||
* <p>If the tool-chain does not have a tool with that ID, the method
|
||||
* returns an empty array. It is the responsibility of the caller to
|
||||
* verify the return value.
|
||||
*
|
||||
* Returns the <code>ITool</code> in this configuration's tool-chain with
|
||||
* the specified ID, or the tool(s) with a superclass with this id.
|
||||
*
|
||||
* <p>If the tool-chain does not have a tool with that ID, the method
|
||||
* returns an empty array. It is the responsibility of the caller to
|
||||
* verify the return value.
|
||||
*
|
||||
* @param id unique identifier of the tool to search for
|
||||
* @return <code>ITool[]</code>
|
||||
* @since 3.0.2
|
||||
*/
|
||||
public ITool[] getToolsBySuperClassId(String id);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the <code>IToolChain</code> child of this configuration.
|
||||
*
|
||||
*
|
||||
* @return IToolChain
|
||||
*/
|
||||
public IToolChain getToolChain();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the command-line invocation command for the specified tool.
|
||||
*
|
||||
*
|
||||
* @param tool The tool that will have its command retrieved.
|
||||
* @return String The command
|
||||
*/
|
||||
public String getToolCommand(ITool tool);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the tools that are used in this configuration's tool-chain.
|
||||
*
|
||||
*
|
||||
* @return ITool[]
|
||||
*/
|
||||
public ITool[] getTools();
|
||||
|
||||
/**
|
||||
* Returns the tool in this configuration specified with
|
||||
* Returns the tool in this configuration specified with
|
||||
* the toolChain#targetTool attribute that creates the build artifact
|
||||
*
|
||||
* NOTE: This method returns null in case the toolChain definition
|
||||
*
|
||||
* NOTE: This method returns null in case the toolChain definition
|
||||
* does not have the targetTool attribute or if the attribute does not
|
||||
* refer to the appropriate tool.
|
||||
* For the target tool calculation the IConfiguration#calculateTargetTool()
|
||||
* method should be used
|
||||
*
|
||||
*
|
||||
* @see IConfiguration#calculateTargetTool()
|
||||
*
|
||||
*
|
||||
* @return ITool
|
||||
*/
|
||||
public ITool getTargetTool();
|
||||
|
@ -289,42 +299,42 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
/**
|
||||
* Returns <code>true</code> if this configuration has overridden the default build
|
||||
* build command in this configuration, otherwise <code>false</code>.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean hasOverriddenBuildCommand();
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the extension matches one of the special
|
||||
* file extensions the tools for the configuration consider to be a header file.
|
||||
*
|
||||
* Returns <code>true</code> if the extension matches one of the special
|
||||
* file extensions the tools for the configuration consider to be a header file.
|
||||
*
|
||||
* @param ext the file extension of the resource
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isHeaderFile(String ext);
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this configuration has changes that need to
|
||||
* be saved in the project file, else <code>false</code>.
|
||||
* Returns <code>true</code> if this configuration has changes that need to
|
||||
* be saved in the project file, else <code>false</code>.
|
||||
* Should not be called for an extension configuration.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isDirty();
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this configuration was loaded from a manifest file,
|
||||
* and <code>false</code> if it was loaded from a project (.cdtbuild) file.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isExtensionElement();
|
||||
|
||||
/**
|
||||
* Returns whether this configuration has been changed and requires the
|
||||
* Returns whether this configuration has been changed and requires the
|
||||
* project to be rebuilt.
|
||||
*
|
||||
* @return <code>true</code> if the configuration contains a change
|
||||
*
|
||||
* @return <code>true</code> if the configuration contains a change
|
||||
* that needs the project to be rebuilt.
|
||||
* Should not be called for an extension configuration.
|
||||
*/
|
||||
|
@ -332,13 +342,13 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
|
||||
/**
|
||||
* Removes a resource configuration from the configuration's list.
|
||||
*
|
||||
*
|
||||
* @param resConfig - resource configuration to remove
|
||||
*/
|
||||
public void removeResourceConfiguration(IResourceInfo resConfig);
|
||||
|
||||
|
||||
public void removeResourceInfo(IPath path);
|
||||
|
||||
|
||||
/**
|
||||
* Set (override) the extension that should be appended to the build artifact
|
||||
* for the receiver.
|
||||
|
@ -352,7 +362,7 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
public void setArtifactName(String name);
|
||||
|
||||
/**
|
||||
* Sets the arguments to be passed to the build utility used by the
|
||||
* Sets the arguments to be passed to the build utility used by the
|
||||
* receiver to produce a build goal.
|
||||
*/
|
||||
public void setBuildArguments(String makeArgs);
|
||||
|
@ -363,26 +373,26 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
public void setBuildCommand(String command);
|
||||
|
||||
/**
|
||||
* Sets the prebuild step for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPrebuildStep(String step);
|
||||
|
||||
/**
|
||||
* Sets the postbuild step for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPostbuildStep(String step);
|
||||
|
||||
/**
|
||||
* Sets the prebuild step display string for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPreannouncebuildStep(String announceStep);
|
||||
|
||||
/**
|
||||
* Sets the postbuild step display string for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPostannouncebuildStep(String announceStep);
|
||||
|
||||
/**
|
||||
* Sets the prebuild step for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPrebuildStep(String step);
|
||||
|
||||
/**
|
||||
* Sets the postbuild step for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPostbuildStep(String step);
|
||||
|
||||
/**
|
||||
* Sets the prebuild step display string for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPreannouncebuildStep(String announceStep);
|
||||
|
||||
/**
|
||||
* Sets the postbuild step display string for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPostannouncebuildStep(String announceStep);
|
||||
|
||||
/**
|
||||
* Sets the command used to clean the outputs of this configuration.
|
||||
* @param command - the command to clean outputs
|
||||
*/
|
||||
|
@ -404,46 +414,46 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
* Sets the name of the receiver to the value specified in the argument
|
||||
*/
|
||||
public void setName(String name);
|
||||
|
||||
|
||||
/**
|
||||
* Sets the value of a boolean option for this configuration.
|
||||
*
|
||||
*
|
||||
* @param parent The holder/parent of the option.
|
||||
* @param option The option to change.
|
||||
* @param value The value to apply to the option.
|
||||
*
|
||||
*
|
||||
* @return IOption The modified option. This can be the same option or a newly created option.
|
||||
*
|
||||
*
|
||||
* @since 3.0 - The type of parent has changed from ITool to IHoldsOptions.
|
||||
* Code assuming ITool as type, will continue to work unchanged.
|
||||
*/
|
||||
public IOption setOption(IHoldsOptions parent, IOption option, boolean value)
|
||||
throws BuildException;
|
||||
public IOption setOption(IHoldsOptions parent, IOption option, boolean value)
|
||||
throws BuildException;
|
||||
|
||||
/**
|
||||
* Sets the value of a string option for this configuration.
|
||||
*
|
||||
*
|
||||
* @param parent The holder/parent of the option.
|
||||
* @param option The option that will be effected by change.
|
||||
* @param value The value to apply to the option.
|
||||
*
|
||||
*
|
||||
* @return IOption The modified option. This can be the same option or a newly created option.
|
||||
*
|
||||
*
|
||||
* @since 3.0 - The type of parent has changed from ITool to IHoldsOptions.
|
||||
* Code assuming ITool as type, will continue to work unchanged.
|
||||
*/
|
||||
public IOption setOption(IHoldsOptions parent, IOption option, String value)
|
||||
throws BuildException;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the value of a list option for this configuration.
|
||||
*
|
||||
*
|
||||
* @param parent The holder/parent of the option.
|
||||
* @param option The option to change.
|
||||
* @param value The values to apply to the option.
|
||||
*
|
||||
*
|
||||
* @return IOption The modified option. This can be the same option or a newly created option.
|
||||
*
|
||||
*
|
||||
* @since 3.0 - The type of parent has changed from ITool to IHoldsOptions.
|
||||
* Code assuming ITool as type, will continue to work unchanged.
|
||||
*/
|
||||
|
@ -452,7 +462,7 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
|
||||
/**
|
||||
* Sets the rebuild state in this configuration.
|
||||
*
|
||||
*
|
||||
* @param rebuild <code>true</code> will force a rebuild the next time the project builds
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setRebuildState(boolean)
|
||||
*/
|
||||
|
@ -460,93 +470,93 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
|
||||
/**
|
||||
* Overrides the tool command for a tool defined in this configuration's tool-chain.
|
||||
*
|
||||
*
|
||||
* @param tool The tool that will have its command modified.
|
||||
* @param command The command
|
||||
*/
|
||||
public void setToolCommand(ITool tool, String command);
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the configuration's tool-chain is supported on the system
|
||||
* otherwise returns <code>false</code>
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isSupported();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the implementation of the IConfigurationEnvironmentVariableSupplier provided
|
||||
* by the tool-integrator or <code>null</code> if none.
|
||||
*
|
||||
* @return IConfigurationEnvironmentVariableSupplier
|
||||
*/
|
||||
*
|
||||
* @return IConfigurationEnvironmentVariableSupplier
|
||||
*/
|
||||
public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the tool-integrator provided implementation of the configuration build macro supplier
|
||||
* or <code>null</code> if none.
|
||||
*
|
||||
* or <code>null</code> if none.
|
||||
*
|
||||
* @return IConfigurationBuildMacroSupplier
|
||||
*/
|
||||
public IConfigurationBuildMacroSupplier getBuildMacroSupplier();
|
||||
|
||||
|
||||
/**
|
||||
* answers true if the configuration is temporary, otherwise - false
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isTemporary();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this configuration requires a full rebuild
|
||||
*
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean needsFullRebuild();
|
||||
|
||||
/**
|
||||
* Calculates the configuration target tool.
|
||||
*
|
||||
*
|
||||
* @return ITool or null if not found
|
||||
*
|
||||
*
|
||||
* @since 3.1
|
||||
*/
|
||||
public ITool calculateTargetTool();
|
||||
|
||||
|
||||
/**
|
||||
* Returns a <code>ITool</code> for the tool associated with the
|
||||
* Returns a <code>ITool</code> for the tool associated with the
|
||||
* output extension.
|
||||
*
|
||||
*
|
||||
* @param extension the file extension of the output file
|
||||
* @return ITool
|
||||
*
|
||||
*
|
||||
* @since 3.1
|
||||
*/
|
||||
public ITool getToolFromOutputExtension(String extension);
|
||||
|
||||
|
||||
/**
|
||||
* Returns a <code>ITool</code> for the tool associated with the
|
||||
* Returns a <code>ITool</code> for the tool associated with the
|
||||
* input extension.
|
||||
*
|
||||
*
|
||||
* @param sourceExtension the file extension of the input file
|
||||
* @return ITool
|
||||
*
|
||||
*
|
||||
* @since 3.1
|
||||
*/
|
||||
public ITool getToolFromInputExtension(String sourceExtension);
|
||||
|
||||
|
||||
IResourceInfo getResourceInfo(IPath path, boolean exactPath);
|
||||
|
||||
|
||||
IResourceInfo[] getResourceInfos();
|
||||
|
||||
|
||||
IResourceInfo getResourceInfoById(String id);
|
||||
|
||||
IFolderInfo getRootFolderInfo();
|
||||
|
||||
|
||||
IFolderInfo getRootFolderInfo();
|
||||
|
||||
IFileInfo createFileInfo(IPath path);
|
||||
|
||||
IFileInfo createFileInfo(IPath path, String id, String name);
|
||||
|
||||
|
||||
IFileInfo createFileInfo(IPath path, IFolderInfo base, ITool baseTool, String id, String name);
|
||||
|
||||
IFileInfo createFileInfo(IPath path, IFileInfo base, String id, String name);
|
||||
|
@ -554,49 +564,49 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
IFolderInfo createFolderInfo(IPath path);
|
||||
|
||||
IFolderInfo createFolderInfo(IPath path, String id, String name);
|
||||
|
||||
|
||||
IFolderInfo createFolderInfo(IPath path, IFolderInfo base, String id, String name);
|
||||
|
||||
|
||||
CConfigurationData getConfigurationData();
|
||||
|
||||
|
||||
ICSourceEntry[] getSourceEntries();
|
||||
|
||||
void setSourceEntries(ICSourceEntry[] entries);
|
||||
|
||||
|
||||
CBuildData getBuildData();
|
||||
|
||||
|
||||
IBuilder getBuilder();
|
||||
|
||||
|
||||
IBuilder getEditableBuilder();
|
||||
|
||||
|
||||
String getOutputPrefix(String outputExtension);
|
||||
|
||||
|
||||
boolean isSystemObject();
|
||||
|
||||
|
||||
String getOutputExtension(String resourceExtension);
|
||||
|
||||
|
||||
String getOutputFlag(String outputExt);
|
||||
|
||||
IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
|
||||
|
||||
IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
|
||||
String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation, IPath outputLocation );
|
||||
|
||||
|
||||
String[] getUserObjects(String extension);
|
||||
|
||||
|
||||
String[] getLibs(String extension);
|
||||
|
||||
|
||||
boolean buildsFileType(String srcExt);
|
||||
|
||||
|
||||
boolean supportsBuild(boolean managed);
|
||||
|
||||
|
||||
boolean isManagedBuildOn();
|
||||
|
||||
void setManagedBuildOn(boolean on) throws BuildException;
|
||||
|
||||
|
||||
boolean isBuilderCompatible(IBuilder builder);
|
||||
|
||||
|
||||
void changeBuilder(IBuilder newBuilder, String id, String name);
|
||||
|
||||
|
||||
IBuildPropertyValue getBuildArtefactType();
|
||||
|
||||
|
||||
void setBuildArtefactType(String id) throws BuildException;
|
||||
}
|
||||
|
|
|
@ -16,19 +16,19 @@ import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier;
|
|||
|
||||
|
||||
/**
|
||||
* This interface represents a tool-integrator-defined, ordered set of tools
|
||||
* that transform the project's input into the project's outputs. A
|
||||
* tool-chain can be defined as part of a configuration, or as an
|
||||
* This interface represents a tool-integrator-defined, ordered set of tools
|
||||
* that transform the project's input into the project's outputs. A
|
||||
* tool-chain can be defined as part of a configuration, or as an
|
||||
* independent specification that is referenced in a separate configuration
|
||||
* via the toolChain superclass attribute.
|
||||
* <p>
|
||||
* The toolChain contains one or more children of type tool. These define
|
||||
* the tools used in the tool-chain. The toolChain contains one child of
|
||||
* the tools used in the tool-chain. The toolChain contains one child of
|
||||
* type targetPlatform. This defines the architecture/os combination where
|
||||
* the outputs of the project can be deployed. The toolChain contains one
|
||||
* the outputs of the project can be deployed. The toolChain contains one
|
||||
* child of type builder. This defines the "build" or "make" utility that
|
||||
* is used to drive the transformation of the inputs into outputs.
|
||||
*
|
||||
*
|
||||
* @since 2.1
|
||||
* @noextend This class is not intended to be subclassed by clients.
|
||||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
|
@ -49,13 +49,16 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
public static final String IS_SYSTEM= "isSystem"; //$NON-NLS-1$
|
||||
public static final String NON_INTERNAL_BUILDER_ID = "nonInternalBuilderId"; //$NON-NLS-1$
|
||||
public static final String RESOURCE_TYPE_BASED_DISCOVERY = "resourceTypeBasedDiscovery"; //$NON-NLS-1$
|
||||
|
||||
|
||||
// The attribute name for the scanner info collector
|
||||
public static final String SCANNER_CONFIG_PROFILE_ID = "scannerConfigDiscoveryProfileId"; //$NON-NLS-1$
|
||||
|
||||
/** @since 8.1 */
|
||||
public static final String LANGUAGE_SETTINGS_PROVIDERS = "languageSettingsProviders";
|
||||
|
||||
/**
|
||||
* Returns the configuration that is the parent of this tool-chain.
|
||||
*
|
||||
*
|
||||
* @return IConfiguration
|
||||
*/
|
||||
public IConfiguration getParent();
|
||||
|
@ -67,14 +70,14 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
* @param Id The id for the new tool chain
|
||||
* @param name The name for the new tool chain
|
||||
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
|
||||
*
|
||||
*
|
||||
* @return ITargetPlatform
|
||||
*/
|
||||
public ITargetPlatform createTargetPlatform(ITargetPlatform superClass, String Id, String name, boolean isExtensionElement);
|
||||
|
||||
/**
|
||||
* Returns the target-platform child of this tool-chain
|
||||
*
|
||||
*
|
||||
* @return ITargetPlatform
|
||||
*/
|
||||
public ITargetPlatform getTargetPlatform();
|
||||
|
@ -87,30 +90,30 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
|
||||
/**
|
||||
* Returns the 'versionsSupported' of this tool-chain
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
|
||||
public String getVersionsSupported();
|
||||
/**
|
||||
* Returns the 'convertToId' of this tool-chain
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
|
||||
public String getConvertToId();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the 'versionsSupported' attribute of the tool-chain.
|
||||
* Sets the 'versionsSupported' attribute of the tool-chain.
|
||||
*/
|
||||
|
||||
|
||||
public void setVersionsSupported(String versionsSupported);
|
||||
|
||||
|
||||
/**
|
||||
* Sets the 'convertToId' attribute of the tool-chain.
|
||||
* Sets the 'convertToId' attribute of the tool-chain.
|
||||
*/
|
||||
public void setConvertToId(String convertToId);
|
||||
|
||||
|
||||
/**
|
||||
* Creates the <code>Builder</code> child of this tool-chain.
|
||||
*
|
||||
|
@ -118,7 +121,7 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
* @param Id The id for the new tool chain
|
||||
* @param name The name for the new tool chain
|
||||
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
|
||||
*
|
||||
*
|
||||
* @return IBuilder
|
||||
*/
|
||||
public IBuilder createBuilder(IBuilder superClass, String Id, String name, boolean isExtensionElement);
|
||||
|
@ -131,7 +134,7 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
|
||||
/**
|
||||
* Returns the builder child of this tool-chain.
|
||||
*
|
||||
*
|
||||
* @return IBuilder
|
||||
*/
|
||||
public IBuilder getBuilder();
|
||||
|
@ -143,35 +146,35 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
* @param Id The id for the new tool chain
|
||||
* @param name The name for the new tool chain
|
||||
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
|
||||
*
|
||||
*
|
||||
* @return ITool
|
||||
*/
|
||||
public ITool createTool(ITool superClass, String Id, String name, boolean isExtensionElement);
|
||||
|
||||
/**
|
||||
* Returns an array of tool children of this tool-chain
|
||||
*
|
||||
*
|
||||
* @return ITool[]
|
||||
*/
|
||||
public ITool[] getTools();
|
||||
|
||||
/**
|
||||
* Returns the tool in this tool-chain with the ID specified in the argument,
|
||||
* or <code>null</code>
|
||||
*
|
||||
* Returns the tool in this tool-chain with the ID specified in the argument,
|
||||
* or <code>null</code>
|
||||
*
|
||||
* @param id The ID of the requested tool
|
||||
* @return ITool
|
||||
*/
|
||||
public ITool getTool(String id);
|
||||
|
||||
/**
|
||||
* Returns the <code>ITool</code> in the tool-chain with the specified
|
||||
* ID, or the tool(s) with a superclass with this id.
|
||||
*
|
||||
* <p>If the tool-chain does not have a tool with that ID, the method
|
||||
* returns an empty array. It is the responsibility of the caller to
|
||||
* verify the return value.
|
||||
*
|
||||
* Returns the <code>ITool</code> in the tool-chain with the specified
|
||||
* ID, or the tool(s) with a superclass with this id.
|
||||
*
|
||||
* <p>If the tool-chain does not have a tool with that ID, the method
|
||||
* returns an empty array. It is the responsibility of the caller to
|
||||
* verify the return value.
|
||||
*
|
||||
* @param id unique identifier of the tool to search for
|
||||
* @return <code>ITool[]</code>
|
||||
* @since 3.0.2
|
||||
|
@ -181,55 +184,55 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
/**
|
||||
* Returns the <code>IToolChain</code> that is the superclass of this
|
||||
* tool-chain, or <code>null</code> if the attribute was not specified.
|
||||
*
|
||||
*
|
||||
* @return IToolChain
|
||||
*/
|
||||
public IToolChain getSuperClass();
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this element is abstract. Returns <code>false</code>
|
||||
* if the attribute was not specified.
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isAbstract();
|
||||
|
||||
/**
|
||||
* Sets the isAbstract attribute of the tool-chain.
|
||||
* Sets the isAbstract attribute of the tool-chain.
|
||||
*/
|
||||
public void setIsAbstract(boolean b);
|
||||
|
||||
|
||||
/**
|
||||
* Returns a semi-colon delimited list of child Ids of the superclass'
|
||||
* children that should not be automatically inherited by this element.
|
||||
* Returns an empty string if the attribute was not specified.
|
||||
* @return String
|
||||
* Returns an empty string if the attribute was not specified.
|
||||
* @return String
|
||||
*/
|
||||
public String getUnusedChildren();
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array of operating systems the tool-chain outputs can run on.
|
||||
*
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getOSList();
|
||||
|
||||
/**
|
||||
* Sets the OS list.
|
||||
*
|
||||
*
|
||||
* @param OSs The list of OS names
|
||||
*/
|
||||
public void setOSList(String[] OSs);
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array of architectures the tool-chain outputs can run on.
|
||||
*
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getArchList();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the architecture list.
|
||||
*
|
||||
*
|
||||
* @param archs The list of architecture names
|
||||
*/
|
||||
public void setArchList(String[] archs);
|
||||
|
@ -237,7 +240,7 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
/**
|
||||
* Returns the semicolon separated list of unique IDs of the error parsers associated
|
||||
* with the tool-chain.
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getErrorParserIds();
|
||||
|
@ -249,9 +252,9 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
public String getErrorParserIds(IConfiguration config);
|
||||
|
||||
/**
|
||||
* Returns the ordered list of unique IDs of the error parsers associated with the
|
||||
* Returns the ordered list of unique IDs of the error parsers associated with the
|
||||
* tool-chain.
|
||||
*
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getErrorParserList();
|
||||
|
@ -262,8 +265,17 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
public void setErrorParserIds(String ids);
|
||||
|
||||
/**
|
||||
* Returns the scanner config discovery profile id or <code>null</code> if none.
|
||||
*
|
||||
* Returns the default language settings providers IDs.
|
||||
*
|
||||
* @return the default language settings providers IDs separated by semicolon or {@code null} if none.
|
||||
*
|
||||
* @since 8.1
|
||||
*/
|
||||
public String getDefaultLanguageSettingsProvidersIds();
|
||||
|
||||
/**
|
||||
* Returns the scanner config discovery profile id or <code>null</code> if none.
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getScannerConfigDiscoveryProfileId();
|
||||
|
@ -274,93 +286,93 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
public void setScannerConfigDiscoveryProfileId(String profileId);
|
||||
|
||||
/**
|
||||
* Returns the sem-colon separated list of Tool ids containing each
|
||||
* tool that can create the final build artifact (the end target of
|
||||
* the build). MBS will use the first ID in the list that matches
|
||||
* a Tool in the ToolChain. One reason for specifying a list, is
|
||||
* that different versions of a tool can be selected based upon the
|
||||
* Returns the sem-colon separated list of Tool ids containing each
|
||||
* tool that can create the final build artifact (the end target of
|
||||
* the build). MBS will use the first ID in the list that matches
|
||||
* a Tool in the ToolChain. One reason for specifying a list, is
|
||||
* that different versions of a tool can be selected based upon the
|
||||
* project nature (e.g. different tool definitions for a linker for C vs. C++).
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getTargetToolIds();
|
||||
|
||||
/**
|
||||
* Sets the sem-colon separated list of Tool ids containing each
|
||||
* tool that can create the final build artifact (the end target of
|
||||
* the build).
|
||||
* Sets the sem-colon separated list of Tool ids containing each
|
||||
* tool that can create the final build artifact (the end target of
|
||||
* the build).
|
||||
*/
|
||||
public void setTargetToolIds(String targetToolIds);
|
||||
|
||||
/**
|
||||
* Returns the list of Tool ids containing each
|
||||
* tool that can create the final build artifact (the end target of
|
||||
* the build). MBS will use the first ID in the list that matches
|
||||
* a Tool in the ToolChain. One reason for specifying a list, is
|
||||
* that different versions of a tool can be selected based upon the
|
||||
* Returns the list of Tool ids containing each
|
||||
* tool that can create the final build artifact (the end target of
|
||||
* the build). MBS will use the first ID in the list that matches
|
||||
* a Tool in the ToolChain. One reason for specifying a list, is
|
||||
* that different versions of a tool can be selected based upon the
|
||||
* project nature (e.g. different tool definitions for a linker for C vs. C++).
|
||||
*
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getTargetToolList();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the OutputTypes in this tool-chain, besides the primary
|
||||
* output of the targetTool, that are also considered to be build
|
||||
* artifacts.
|
||||
*
|
||||
* Returns the OutputTypes in this tool-chain, besides the primary
|
||||
* output of the targetTool, that are also considered to be build
|
||||
* artifacts.
|
||||
*
|
||||
* @return IOutputType[]
|
||||
*/
|
||||
public IOutputType[] getSecondaryOutputs();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the semicolon separated list of OutputType identifiers in
|
||||
* Sets the semicolon separated list of OutputType identifiers in
|
||||
* this tool-chain, besides the primary output of the targetTool,
|
||||
* that are also considered to be build artifacts.
|
||||
* that are also considered to be build artifacts.
|
||||
*/
|
||||
public void setSecondaryOutputs(String ids);
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this tool-chain has changes that need to
|
||||
* Returns <code>true</code> if this tool-chain has changes that need to
|
||||
* be saved in the project file, else <code>false</code>.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isDirty();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the element's "dirty" (have I been modified?) flag.
|
||||
*/
|
||||
public void setDirty(boolean isDirty);
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this tool-chain was loaded from a manifest file,
|
||||
* and <code>false</code> if it was loaded from a project (.cdtbuild) file.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isExtensionElement();
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the tool-chain support is installed on the system
|
||||
* otherwise returns <code>false</code>
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isSupported();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the tool-integrator provided implementation of the configuration environment variable supplier
|
||||
* or <code>null</code> if none.
|
||||
*
|
||||
* or <code>null</code> if none.
|
||||
*
|
||||
* @return IConfigurationEnvironmentVariableSupplier
|
||||
*/
|
||||
public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the tool-integrator provided implementation of the configuration build macro supplier
|
||||
* or <code>null</code> if none.
|
||||
*
|
||||
* or <code>null</code> if none.
|
||||
*
|
||||
* @return IConfigurationBuildMacroSupplier
|
||||
*/
|
||||
public IConfigurationBuildMacroSupplier getBuildMacroSupplier();
|
||||
|
@ -370,16 +382,16 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
* or null, if no conversion is required
|
||||
*/
|
||||
public IOptionPathConverter getOptionPathConverter() ;
|
||||
|
||||
|
||||
IFolderInfo getParentFolderInfo();
|
||||
|
||||
|
||||
CTargetPlatformData getTargetPlatformData();
|
||||
|
||||
|
||||
boolean supportsBuild(boolean managed);
|
||||
|
||||
|
||||
boolean isSystemObject();
|
||||
|
||||
|
||||
boolean matches(IToolChain tc);
|
||||
|
||||
|
||||
String getUniqueRealName();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2003, 2011 IBM Corporation and others.
|
||||
* Copyright (c) 2003, 2012 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -26,6 +26,7 @@ import java.util.Vector;
|
|||
|
||||
import org.eclipse.cdt.build.core.scannerconfig.ICfgScannerConfigBuilderInfo2Set;
|
||||
import org.eclipse.cdt.build.internal.core.scannerconfig.CfgDiscoveredPathManager.PathInfoCache;
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.ErrorParserManager;
|
||||
import org.eclipse.cdt.core.settings.model.CSourceEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
|
@ -83,8 +84,10 @@ import org.eclipse.core.resources.IResource;
|
|||
import org.eclipse.core.resources.IResourceDelta;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
import org.osgi.framework.Version;
|
||||
|
||||
|
@ -92,6 +95,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
|||
|
||||
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
||||
private static final String EMPTY_CFG_ID = "org.eclipse.cdt.build.core.emptycfg"; //$NON-NLS-1$
|
||||
private static final String LANGUAGE_SETTINGS_PROVIDER_DELIMITER = ";"; //$NON-NLS-1$
|
||||
|
||||
// Parent and children
|
||||
private String parentId;
|
||||
|
@ -102,6 +106,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
|||
private String cleanCommand;
|
||||
private String artifactExtension;
|
||||
private String errorParserIds;
|
||||
private String defaultLanguageSettingsProvidersAttribute;
|
||||
private String[] defaultLanguageSettingsProvidersIds;
|
||||
private String prebuildStep;
|
||||
private String postbuildStep;
|
||||
private String preannouncebuildStep;
|
||||
|
@ -781,6 +787,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
|||
// Get the semicolon separated list of IDs of the error parsers
|
||||
errorParserIds = SafeStringInterner.safeIntern(element.getAttribute(ERROR_PARSERS));
|
||||
|
||||
// Get the initial/default language setttings providers IDs
|
||||
defaultLanguageSettingsProvidersAttribute = SafeStringInterner.safeIntern(element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS));
|
||||
|
||||
// Get the artifact extension
|
||||
artifactExtension = SafeStringInterner.safeIntern(element.getAttribute(EXTENSION));
|
||||
|
||||
|
@ -1453,6 +1462,55 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
|||
return set;
|
||||
}
|
||||
|
||||
private String getDefaultLanguageSettingsProvidersAttribute() {
|
||||
if (defaultLanguageSettingsProvidersAttribute == null && parent instanceof Configuration) {
|
||||
defaultLanguageSettingsProvidersAttribute = ((Configuration) parent).getDefaultLanguageSettingsProvidersAttribute();
|
||||
}
|
||||
|
||||
return defaultLanguageSettingsProvidersAttribute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getDefaultLanguageSettingsProvidersIds() {
|
||||
defaultLanguageSettingsProvidersIds = null;
|
||||
if (defaultLanguageSettingsProvidersIds == null) {
|
||||
getDefaultLanguageSettingsProvidersAttribute();
|
||||
if (defaultLanguageSettingsProvidersAttribute != null) {
|
||||
List<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("-")) {
|
||||
id = id.substring(1);
|
||||
ids.remove(id);
|
||||
} else if (!ids.contains(id)){
|
||||
if (id.contains("${Toolchain}")) {
|
||||
IToolChain toolchain = getToolChain();
|
||||
if (toolchain != null) {
|
||||
String toolchainProvidersIds = toolchain.getDefaultLanguageSettingsProvidersIds();
|
||||
if (toolchainProvidersIds != null) {
|
||||
ids.addAll(Arrays.asList(toolchainProvidersIds.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER)));
|
||||
} else {
|
||||
String message = "Invalid use of ${Toolchain} tag, toolchain does not specify language settings providers. cfg=" + getId();
|
||||
ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, IStatus.ERROR, message, new Exception()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ids.add(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
defaultLanguageSettingsProvidersIds = ids.toArray(new String[ids.size()]);
|
||||
} else if (parent != null) {
|
||||
defaultLanguageSettingsProvidersIds = parent.getDefaultLanguageSettingsProvidersIds();
|
||||
}
|
||||
}
|
||||
|
||||
return defaultLanguageSettingsProvidersIds;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setArtifactExtension(java.lang.String)
|
||||
*/
|
||||
|
|
|
@ -17,6 +17,7 @@ import java.util.List;
|
|||
import java.util.StringTokenizer;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
|
||||
import org.eclipse.cdt.core.model.ILanguage;
|
||||
import org.eclipse.cdt.core.model.LanguageManager;
|
||||
import org.eclipse.cdt.core.settings.model.ICStorageElement;
|
||||
|
@ -24,6 +25,7 @@ import org.eclipse.cdt.core.settings.model.util.CDataUtil;
|
|||
import org.eclipse.cdt.internal.core.SafeStringInterner;
|
||||
import org.eclipse.cdt.managedbuilder.core.IAdditionalInput;
|
||||
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IFileInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.IInputOrder;
|
||||
import org.eclipse.cdt.managedbuilder.core.IInputType;
|
||||
|
@ -37,6 +39,7 @@ import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
|||
import org.eclipse.cdt.managedbuilder.internal.enablement.OptionEnablementExpression;
|
||||
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
@ -1838,9 +1841,56 @@ public class InputType extends BuildObject implements IInputType {
|
|||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Temporary method to support compatibility during SD transition.
|
||||
*/
|
||||
private boolean isLanguageSettingsProvidersFunctionalityEnabled() {
|
||||
boolean isLanguageSettingsProvidersEnabled = false;
|
||||
ITool tool = getParent();
|
||||
if (tool!=null) {
|
||||
IBuildObject bo = tool.getParent();
|
||||
if (bo instanceof IToolChain) {
|
||||
IConfiguration cfg = ((IToolChain) bo).getParent();
|
||||
if (cfg!=null) {
|
||||
IResource rc = cfg.getOwner();
|
||||
if (rc!=null) {
|
||||
IProject project = rc.getProject();
|
||||
isLanguageSettingsProvidersEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return isLanguageSettingsProvidersEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Temporary method to support compatibility during SD transition.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
public String getLegacyDiscoveryProfileIdAttribute(){
|
||||
String profileId = buildInfoDicsoveryProfileId;
|
||||
if (profileId == null) {
|
||||
profileId = ScannerDiscoveryLegacySupport.getDeprecatedLegacyProfiles(id);
|
||||
if (profileId == null && superClass instanceof InputType) {
|
||||
profileId = ((InputType)superClass).getLegacyDiscoveryProfileIdAttribute();
|
||||
}
|
||||
}
|
||||
return profileId;
|
||||
}
|
||||
|
||||
public String getDiscoveryProfileIdAttribute(){
|
||||
if(buildInfoDicsoveryProfileId == null && superClass != null)
|
||||
return ((InputType)superClass).getDiscoveryProfileIdAttribute();
|
||||
if (!isLanguageSettingsProvidersFunctionalityEnabled())
|
||||
return getLegacyDiscoveryProfileIdAttribute();
|
||||
|
||||
return getDiscoveryProfileIdAttributeInternal();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method extracted temporarily to support compatibility during SD transition.
|
||||
*/
|
||||
private String getDiscoveryProfileIdAttributeInternal(){
|
||||
if(buildInfoDicsoveryProfileId == null && superClass instanceof InputType)
|
||||
return ((InputType)superClass).getDiscoveryProfileIdAttributeInternal();
|
||||
return buildInfoDicsoveryProfileId;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,16 +50,16 @@ import org.eclipse.core.runtime.IPath;
|
|||
import org.osgi.framework.Version;
|
||||
|
||||
/**
|
||||
* This class represents a set of configurations
|
||||
* This class represents a set of configurations
|
||||
* to be edited simultaneously on property pages.
|
||||
*/
|
||||
public class MultiConfiguration extends MultiItemsHolder implements
|
||||
IMultiConfiguration {
|
||||
private static final String[] EMPTY_STR_ARRAY = new String[0];
|
||||
|
||||
|
||||
protected IConfiguration[] fCfgs = null;
|
||||
private int curr = 0;
|
||||
|
||||
|
||||
public MultiConfiguration(IConfiguration[] cfs) {
|
||||
fCfgs = cfs;
|
||||
for (int i=0; i<fCfgs.length; i++)
|
||||
|
@ -68,19 +68,19 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public MultiConfiguration(ICConfigurationDescription[] cfds) {
|
||||
this(cfds2cfs(cfds));
|
||||
}
|
||||
|
||||
|
||||
public static IConfiguration[] cfds2cfs(ICConfigurationDescription[] cfgds) {
|
||||
IConfiguration[] cfs = new IConfiguration[cfgds.length];
|
||||
for (int i=0; i<cfgds.length; i++)
|
||||
cfs[i] = ManagedBuildManager.getConfigurationForDescription(cfgds[i]);
|
||||
return cfs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.settings.model.MultiItemsHolder#getItems()
|
||||
*/
|
||||
|
@ -211,24 +211,24 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
*/
|
||||
@Override
|
||||
public IManagedCommandLineInfo generateToolCommandLineInfo(
|
||||
String sourceExtension,
|
||||
String[] flags,
|
||||
String sourceExtension,
|
||||
String[] flags,
|
||||
String outputFlag,
|
||||
String outputPrefix,
|
||||
String outputName,
|
||||
String outputPrefix,
|
||||
String outputName,
|
||||
String[] inputResources,
|
||||
IPath inputLocation,
|
||||
IPath inputLocation,
|
||||
IPath outputLocation) {
|
||||
if (DEBUG)
|
||||
System.out.println("Strange multi access: MultiConfiguration.generateToolCommandLineInfo()"); //$NON-NLS-1$
|
||||
return curr().generateToolCommandLineInfo(
|
||||
sourceExtension,
|
||||
flags,
|
||||
outputFlag,
|
||||
outputPrefix,
|
||||
outputName,
|
||||
inputResources,
|
||||
inputLocation,
|
||||
sourceExtension,
|
||||
flags,
|
||||
outputFlag,
|
||||
outputPrefix,
|
||||
outputName,
|
||||
inputResources,
|
||||
inputLocation,
|
||||
outputLocation);
|
||||
}
|
||||
|
||||
|
@ -243,7 +243,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
return EMPTY_STR;
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
public String[] getArtifactExtensions() {
|
||||
String[] s = new String[fCfgs.length];
|
||||
for (int i=0; i<fCfgs.length; i++)
|
||||
|
@ -278,7 +278,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
String args0 = fCfgs[0].getBuildArguments();
|
||||
if (args0 == null)
|
||||
args0 = EMPTY_STR;
|
||||
|
||||
|
||||
for (IConfiguration cfg : fCfgs) {
|
||||
String args = cfg.getBuildArguments();
|
||||
if (args == null)
|
||||
|
@ -294,7 +294,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
*/
|
||||
@Override
|
||||
public IBuildPropertyValue getBuildArtefactType() {
|
||||
IBuildPropertyValue b = fCfgs[0].getBuildArtefactType();
|
||||
IBuildPropertyValue b = fCfgs[0].getBuildArtefactType();
|
||||
if (b == null)
|
||||
return null;
|
||||
for (int i=1; i<fCfgs.length; i++)
|
||||
|
@ -414,7 +414,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getErrorParserIds()
|
||||
*/
|
||||
|
||||
|
||||
@Override
|
||||
public String getErrorParserIds() {
|
||||
String s = fCfgs[0].getErrorParserIds();
|
||||
|
@ -440,6 +440,12 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getDefaultLanguageSettingsProvidersIds() {
|
||||
ManagedBuilderCorePlugin.error("Default Language Settings Providers are not supported in multiconfiguration mode");
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getFilteredTools()
|
||||
*/
|
||||
|
@ -842,9 +848,9 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public boolean[] isManagedBuildOnMulti() {
|
||||
boolean[] b = new boolean[fCfgs.length];
|
||||
boolean[] b = new boolean[fCfgs.length];
|
||||
for (int i=0; i<fCfgs.length; i++)
|
||||
b[i] = fCfgs[i].isManagedBuildOn();
|
||||
return b;
|
||||
|
@ -1026,7 +1032,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setName(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setName(String name) {} // do nothing
|
||||
public void setName(String name) {} // do nothing
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, boolean)
|
||||
|
@ -1209,7 +1215,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
}
|
||||
return true; // all cfgs report true
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setParallelDef(boolean parallel) {
|
||||
for (IConfiguration cfg : fCfgs) {
|
||||
|
@ -1217,7 +1223,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
((Configuration)cfg).setParallelDef(parallel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getParallelNumber() {
|
||||
int res = 0;
|
||||
|
@ -1226,7 +1232,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
int num = ((Configuration)cfg).getParallelNumber();
|
||||
Assert.isTrue(num != 0); // can't be 0, see IMakeCommonBuildInfo.getParallelizationNum()
|
||||
|
||||
if (res == 0)
|
||||
if (res == 0)
|
||||
res = num;
|
||||
else if (res != num)
|
||||
return 0; // values are different !
|
||||
|
@ -1235,7 +1241,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
}
|
||||
return res; // all cfgs report same value
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setParallelNumber(int num) {
|
||||
for (IConfiguration cfg : fCfgs) {
|
||||
|
@ -1243,12 +1249,12 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
((Configuration)cfg).setParallelNumber(num);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean getInternalBuilderParallel() {
|
||||
return getParallelDef();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isInternalBuilderEnabled() {
|
||||
for (int i=0; i<fCfgs.length; i++)
|
||||
|
@ -1270,14 +1276,14 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
return false;
|
||||
return true; // all cfgs report true
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void enableInternalBuilder(boolean v) {
|
||||
for (int i=0; i<fCfgs.length; i++)
|
||||
if (fCfgs[i] instanceof Configuration)
|
||||
((Configuration)fCfgs[i]).enableInternalBuilder(v);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns "default" configuration.
|
||||
*/
|
||||
|
@ -1362,7 +1368,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
ManagedBuilderCorePlugin.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String getBuildAttribute(String name, String defValue) {
|
||||
String res = defValue;
|
||||
IBuilder b = fCfgs[0].getBuilder();
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.SortedMap;
|
|||
import java.util.StringTokenizer;
|
||||
|
||||
import org.eclipse.cdt.build.internal.core.scannerconfig.CfgDiscoveredPathManager.PathInfoCache;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
|
||||
import org.eclipse.cdt.core.settings.model.ICStorageElement;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CTargetPlatformData;
|
||||
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
|
||||
|
@ -50,6 +51,8 @@ import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSu
|
|||
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
|
||||
import org.eclipse.cdt.managedbuilder.internal.enablement.OptionEnablementExpression;
|
||||
import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtension;
|
||||
|
@ -85,6 +88,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
|||
private String targetToolIds;
|
||||
private String secondaryOutputIds;
|
||||
private Boolean isAbstract;
|
||||
private String defaultLanguageSettingsProvidersIds;
|
||||
private String scannerConfigDiscoveryProfileId;
|
||||
private String versionsSupported;
|
||||
private String convertToId;
|
||||
|
@ -554,6 +558,9 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
|||
// Get the target tool id
|
||||
targetToolIds = SafeStringInterner.safeIntern(element.getAttribute(TARGET_TOOL));
|
||||
|
||||
// Get the initial/default language setttings providers IDs
|
||||
defaultLanguageSettingsProvidersIds = element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS);
|
||||
|
||||
// Get the scanner config discovery profile id
|
||||
scannerConfigDiscoveryProfileId = SafeStringInterner.safeIntern(element.getAttribute(SCANNER_CONFIG_PROFILE_ID));
|
||||
String tmp = element.getAttribute(RESOURCE_TYPE_BASED_DISCOVERY);
|
||||
|
@ -1529,18 +1536,72 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
|||
setDirty(true);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#getScannerConfigDiscoveryProfileId()
|
||||
*/
|
||||
@Override
|
||||
@Override
|
||||
public String getDefaultLanguageSettingsProvidersIds() {
|
||||
if (defaultLanguageSettingsProvidersIds == null) {
|
||||
if (superClass instanceof IToolChain) {
|
||||
defaultLanguageSettingsProvidersIds = ((IToolChain) superClass).getDefaultLanguageSettingsProvidersIds();
|
||||
}
|
||||
}
|
||||
return defaultLanguageSettingsProvidersIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Temporary method to support compatibility during SD transition.
|
||||
*/
|
||||
private boolean isLanguageSettingsProvidersFunctionalityEnabled() {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Temporary method to support compatibility during SD transition.
|
||||
* @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;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#getScannerConfigDiscoveryProfileId()
|
||||
*/
|
||||
@Override
|
||||
public String getScannerConfigDiscoveryProfileId() {
|
||||
if (scannerConfigDiscoveryProfileId == null) {
|
||||
if (getSuperClass() != null) {
|
||||
return getSuperClass().getScannerConfigDiscoveryProfileId();
|
||||
}
|
||||
}
|
||||
return scannerConfigDiscoveryProfileId;
|
||||
}
|
||||
if (!isLanguageSettingsProvidersFunctionalityEnabled())
|
||||
return getLegacyScannerConfigDiscoveryProfileId();
|
||||
|
||||
return getScannerConfigDiscoveryProfileIdInternal();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method extracted temporarily to support compatibility during SD transition.
|
||||
*/
|
||||
private String getScannerConfigDiscoveryProfileIdInternal() {
|
||||
if (scannerConfigDiscoveryProfileId == null && superClass instanceof ToolChain) {
|
||||
return ((ToolChain) getSuperClass()).getScannerConfigDiscoveryProfileIdInternal();
|
||||
}
|
||||
return scannerConfigDiscoveryProfileId;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#setScannerConfigDiscoveryProfileId(java.lang.String)
|
||||
|
|
|
@ -20,6 +20,10 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
import org.eclipse.cdt.build.internal.core.scannerconfig2.CfgScannerConfigInfoFactory2;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
|
||||
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
|
||||
import org.eclipse.cdt.core.model.ILanguageDescriptor;
|
||||
import org.eclipse.cdt.core.model.LanguageManager;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
|
@ -492,9 +496,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
|||
}
|
||||
|
||||
@Override
|
||||
public CConfigurationData loadConfiguration(ICConfigurationDescription cfgDescription,
|
||||
IProgressMonitor monitor)
|
||||
throws CoreException {
|
||||
public CConfigurationData loadConfiguration(ICConfigurationDescription cfgDescription, IProgressMonitor monitor) throws CoreException {
|
||||
if(cfgDescription.isPreferenceConfiguration())
|
||||
return loadPreferences(cfgDescription);
|
||||
|
||||
|
@ -509,11 +511,56 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
|||
// Update the ManagedBuildInfo in the ManagedBuildManager map. Doing this creates a barrier for subsequent
|
||||
// ManagedBuildManager#getBuildInfo(...) see Bug 305146 for more
|
||||
ManagedBuildManager.setLoaddedBuildInfo(cfgDescription.getProjectDescription().getProject(), info);
|
||||
setDefaultLanguageSettingsProvidersIds(cfg, cfgDescription);
|
||||
return cfg.getConfigurationData();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static List<ILanguageSettingsProvider> getDefaultLanguageSettingsProviders(IConfiguration cfg) {
|
||||
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
|
||||
String[] ids = cfg.getDefaultLanguageSettingsProvidersIds();
|
||||
if (ids != null) {
|
||||
for (String id : ids) {
|
||||
ILanguageSettingsProvider provider = null;
|
||||
if (!LanguageSettingsManager.isPreferShared(id)) {
|
||||
provider = LanguageSettingsManager.getExtensionProviderCopy(id, false);
|
||||
}
|
||||
if (provider == null) {
|
||||
provider = LanguageSettingsManager.getWorkspaceProvider(id);
|
||||
}
|
||||
providers.add(provider);
|
||||
}
|
||||
}
|
||||
|
||||
// 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(IConfiguration cfg, ICConfigurationDescription cfgDescription) {
|
||||
setDefaultLanguageSettingsProvidersIds(cfg, cfgDescription);
|
||||
List<ILanguageSettingsProvider> providers = getDefaultLanguageSettingsProviders(cfg);
|
||||
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
|
||||
}
|
||||
|
||||
|
||||
private boolean isPersistedCfg(ICConfigurationDescription cfgDescription){
|
||||
return cfgDescription.getSessionProperty(CFG_PERSISTED_PROPERTY) != null;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
|
@ -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.LanguageSettingsManager;
|
||||
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.IResource;
|
||||
|
||||
|
@ -167,6 +168,11 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting
|
|||
}
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,6 +37,7 @@ import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
|
|||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||
import org.eclipse.cdt.internal.core.BuildRunnerHelper;
|
||||
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.internal.core.ManagedMakeMessages;
|
||||
import org.eclipse.cdt.utils.CommandLineUtil;
|
||||
|
@ -317,12 +318,17 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
|
|||
|
||||
@Override
|
||||
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;
|
||||
execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterListener() {
|
||||
// AG FIXME - temporary log to remove before CDT Juno release
|
||||
LanguageSettingsLogger.logInfo(getPrefixForLog() + "unregisterListener [" + System.identityHashCode(this) + "] " + this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -347,6 +353,8 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
|
|||
*/
|
||||
protected void execute() {
|
||||
if (isExecuted) {
|
||||
// AG FIXME - temporary log to remove before CDT Juno release
|
||||
// LanguageSettingsLogger.logInfo(getPrefixForLog() + "Already executed [" + System.identityHashCode(this) + "] " + this);
|
||||
return;
|
||||
}
|
||||
isExecuted = true;
|
||||
|
@ -385,6 +393,9 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
|
|||
}
|
||||
job.setRule(rule);
|
||||
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() {
|
||||
if (detectedSettingEntries != null && detectedSettingEntries.size() > 0) {
|
||||
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);
|
||||
}
|
||||
detectedSettingEntries = null;
|
||||
|
|
|
@ -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.util.CDataUtil;
|
||||
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.utils.EFSExtensionManager;
|
||||
import org.eclipse.core.filesystem.EFS;
|
||||
|
@ -556,6 +557,19 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
|
|||
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
|
||||
* and current language ID.
|
||||
|
@ -564,6 +578,10 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
|
|||
*/
|
||||
protected void setSettingEntries(List<ICLanguageSettingEntry> 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1269,7 +1269,6 @@
|
|||
dependencyExtensions="h"
|
||||
dependencyCalculator="org.eclipse.cdt.managedbuilder.makegen.gnu.DefaultGCCDependencyCalculator2"
|
||||
id="cdt.managedbuild.tool.gnu.c.compiler.input"
|
||||
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC|org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"
|
||||
languageId="org.eclipse.cdt.core.gcc">
|
||||
</inputType>
|
||||
<outputType
|
||||
|
@ -1591,7 +1590,6 @@
|
|||
dependencyExtensions="h,H,hpp"
|
||||
dependencyCalculator="org.eclipse.cdt.managedbuilder.makegen.gnu.DefaultGCCDependencyCalculator2"
|
||||
id="cdt.managedbuild.tool.gnu.cpp.compiler.input"
|
||||
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP|org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"
|
||||
languageId="org.eclipse.cdt.core.g++">
|
||||
</inputType>
|
||||
<outputType
|
||||
|
@ -1658,7 +1656,7 @@
|
|||
<inputType
|
||||
id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"
|
||||
superClass="cdt.managedbuild.tool.gnu.c.compiler.input"
|
||||
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"/>
|
||||
/>
|
||||
</tool>
|
||||
<tool
|
||||
id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin"
|
||||
|
@ -1672,7 +1670,7 @@
|
|||
<inputType
|
||||
id="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin"
|
||||
superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"
|
||||
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"/>
|
||||
/>
|
||||
</tool>
|
||||
|
||||
<builder
|
||||
|
@ -1705,10 +1703,11 @@
|
|||
|
||||
<toolChain
|
||||
archList="all"
|
||||
osList="linux,hpux,aix,qnx"
|
||||
id="cdt.managedbuild.toolchain.gnu.base"
|
||||
languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
|
||||
name="%ToolChainName.Linux"
|
||||
targetTool="cdt.managedbuild.tool.gnu.c.linker;cdt.managedbuild.tool.gnu.cpp.linker;cdt.managedbuild.tool.gnu.archiver"
|
||||
id="cdt.managedbuild.toolchain.gnu.base">
|
||||
osList="linux,hpux,aix,qnx"
|
||||
targetTool="cdt.managedbuild.tool.gnu.c.linker;cdt.managedbuild.tool.gnu.cpp.linker;cdt.managedbuild.tool.gnu.archiver">
|
||||
<targetPlatform
|
||||
id="cdt.managedbuild.target.gnu.platform.base"
|
||||
name="%PlatformName.Dbg"
|
||||
|
@ -1773,6 +1772,7 @@
|
|||
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.cygwin.GnuCygwinConfigurationEnvironmentSupplier"
|
||||
id="cdt.managedbuild.toolchain.gnu.cygwin.base"
|
||||
isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.cygwin.IsGnuCygwinToolChainSupported"
|
||||
languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorCygwin"
|
||||
name="%ToolChainName.Cygwin"
|
||||
osList="win32"
|
||||
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base;cdt.managedbuild.tool.gnu.c.linker.cygwin.base;cdt.managedbuild.tool.gnu.archiver">
|
||||
|
@ -1842,6 +1842,7 @@
|
|||
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwEnvironmentVariableSupplier"
|
||||
id="cdt.managedbuild.toolchain.gnu.mingw.base"
|
||||
isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwIsToolChainSupported"
|
||||
languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
|
||||
name="%ToolChainName.MinGW"
|
||||
osList="win32"
|
||||
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base;cdt.managedbuild.tool.gnu.c.linker.mingw.base;cdt.managedbuild.tool.gnu.archiver">
|
||||
|
@ -2083,9 +2084,9 @@
|
|||
</toolChain>
|
||||
|
||||
<configuration
|
||||
id="cdt.managedbuild.config.gnu.base"
|
||||
cleanCommand="rm -rf"
|
||||
>
|
||||
id="cdt.managedbuild.config.gnu.base"
|
||||
languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser">
|
||||
<enablement type="CONTAINER_ATTRIBUTE"
|
||||
attribute="artifactExtension"
|
||||
value="so"
|
||||
|
@ -2480,10 +2481,10 @@
|
|||
</projectType>
|
||||
|
||||
<configuration
|
||||
id="cdt.managedbuild.config.gnu.cygwin.base"
|
||||
cleanCommand="rm -rf"
|
||||
artifactExtension="exe"
|
||||
>
|
||||
cleanCommand="rm -rf"
|
||||
id="cdt.managedbuild.config.gnu.cygwin.base"
|
||||
languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser">
|
||||
<enablement type="CONTAINER_ATTRIBUTE"
|
||||
attribute="artifactExtension"
|
||||
value="dll"
|
||||
|
@ -2878,10 +2879,10 @@
|
|||
</projectType>
|
||||
|
||||
<configuration
|
||||
id="cdt.managedbuild.config.gnu.mingw.base"
|
||||
cleanCommand="rm -rf"
|
||||
artifactExtension="exe"
|
||||
>
|
||||
cleanCommand="rm -rf"
|
||||
id="cdt.managedbuild.config.gnu.mingw.base"
|
||||
languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser">
|
||||
<enablement type="CONTAINER_ATTRIBUTE"
|
||||
attribute="artifactExtension"
|
||||
value="dll"
|
||||
|
|
|
@ -207,6 +207,12 @@ public class TestConfiguration implements IConfiguration {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getDefaultLanguageSettingsProvidersIds() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITool[] getFilteredTools() {
|
||||
// TODO Auto-generated method stub
|
||||
|
|
|
@ -363,7 +363,11 @@ public class TestToolchain extends HoldsOptions implements IToolChain {
|
|||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getDefaultLanguageSettingsProvidersIds() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
package org.eclipse.cdt.managedbuilder.ui.preferences;
|
||||
|
||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
|
||||
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||
|
@ -22,7 +23,7 @@ import org.eclipse.swt.widgets.Composite;
|
|||
|
||||
/**
|
||||
* @since 5.1
|
||||
*
|
||||
*
|
||||
* @noextend This class is not intended to be subclassed by clients.
|
||||
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||
*/
|
||||
|
@ -30,6 +31,7 @@ public class WizardDefaultsTab extends AbstractCPropertyTab {
|
|||
|
||||
private Button show_sup;
|
||||
private Button show_oth;
|
||||
private Button checkBoxTryNewSD;
|
||||
|
||||
@Override
|
||||
public void createControls(Composite parent) {
|
||||
|
@ -37,27 +39,34 @@ public class WizardDefaultsTab extends AbstractCPropertyTab {
|
|||
usercomp.setLayout(new GridLayout(1, false));
|
||||
|
||||
show_sup = new Button(usercomp, SWT.CHECK);
|
||||
show_sup.setText(Messages.WizardDefaultsTab_0);
|
||||
show_sup.setText(Messages.WizardDefaultsTab_0);
|
||||
show_sup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
|
||||
show_oth = new Button(usercomp, SWT.CHECK);
|
||||
show_oth.setText(Messages.WizardDefaultsTab_1);
|
||||
show_oth.setText(Messages.WizardDefaultsTab_1);
|
||||
show_oth.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
|
||||
checkBoxTryNewSD = new Button(usercomp, SWT.CHECK);
|
||||
checkBoxTryNewSD.setText(org.eclipse.cdt.internal.ui.newui.Messages.LanguageSettingsProviders_EnableForProject);
|
||||
checkBoxTryNewSD.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
|
||||
show_sup.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOSUPP));
|
||||
show_oth.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_OTHERS));
|
||||
checkBoxTryNewSD.setSelection(CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NEWSD));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void performOK() {
|
||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOSUPP, !show_sup.getSelection());
|
||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_OTHERS, show_oth.getSelection());
|
||||
CDTPrefUtil.setBool(LanguageSettingsProvidersPage.KEY_NEWSD, checkBoxTryNewSD.getSelection());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void performDefaults() {
|
||||
show_sup.setSelection(true);
|
||||
show_oth.setSelection(false);
|
||||
checkBoxTryNewSD.setSelection(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -23,6 +23,9 @@ import java.util.SortedMap;
|
|||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
|
||||
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.ScannerDiscoveryLegacySupport;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||
|
@ -41,8 +44,9 @@ import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
|||
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
|
||||
import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
|
||||
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
|
||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||
import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
|
||||
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||
import org.eclipse.cdt.ui.templateengine.IWizardDataPage;
|
||||
import org.eclipse.cdt.ui.templateengine.Template;
|
||||
|
@ -73,10 +77,10 @@ import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
|
|||
|
||||
/**
|
||||
* This object is created per each Project type
|
||||
*
|
||||
*
|
||||
* It is responsible for:
|
||||
* - corresponding line in left pane of 1st wizard page
|
||||
* - whole view of right pane, including
|
||||
* - whole view of right pane, including
|
||||
*
|
||||
* @noextend This class is not intended to be subclassed by clients.
|
||||
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||
|
@ -84,16 +88,17 @@ import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
|
|||
public class MBSWizardHandler extends CWizardHandler {
|
||||
public static final String ARTIFACT = "org.eclipse.cdt.build.core.buildArtefactType"; //$NON-NLS-1$
|
||||
public static final String EMPTY_STR = ""; //$NON-NLS-1$
|
||||
|
||||
|
||||
private static final String PROPERTY = "org.eclipse.cdt.build.core.buildType"; //$NON-NLS-1$
|
||||
private static final String PROP_VAL = PROPERTY + ".debug"; //$NON-NLS-1$
|
||||
private static final String tooltip =
|
||||
Messages.CWizardHandler_1 +
|
||||
Messages.CWizardHandler_2 +
|
||||
Messages.CWizardHandler_3 +
|
||||
Messages.CWizardHandler_4 +
|
||||
Messages.CWizardHandler_5;
|
||||
|
||||
|
||||
private static final String tooltip =
|
||||
Messages.CWizardHandler_1 +
|
||||
Messages.CWizardHandler_2 +
|
||||
Messages.CWizardHandler_3 +
|
||||
Messages.CWizardHandler_4 +
|
||||
Messages.CWizardHandler_5;
|
||||
|
||||
protected SortedMap<String, IToolChain> full_tcs = new TreeMap<String, IToolChain>();
|
||||
private String propertyId = null;
|
||||
private IProjectType pt = null;
|
||||
|
@ -106,12 +111,12 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
private EntryInfo entryInfo;
|
||||
protected CfgHolder[] cfgs = null;
|
||||
protected IWizardPage[] customPages;
|
||||
|
||||
|
||||
/**
|
||||
* Current list of preferred toolchains
|
||||
*/
|
||||
private List<String> preferredTCs = new ArrayList<String>();
|
||||
|
||||
|
||||
protected static final class EntryInfo {
|
||||
private SortedMap<String, IToolChain> tcs;
|
||||
private EntryDescriptor entryDescriptor;
|
||||
|
@ -124,12 +129,12 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
private IWizardPage predatingPage;
|
||||
private IWizardPage followingPage;
|
||||
private IWizard wizard;
|
||||
|
||||
|
||||
public EntryInfo(EntryDescriptor dr, SortedMap<String, IToolChain> _tcs){
|
||||
entryDescriptor = dr;
|
||||
tcs = _tcs;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 5.1
|
||||
*/
|
||||
|
@ -137,7 +142,7 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
this(dr, _tcs);
|
||||
wizard = w;
|
||||
}
|
||||
|
||||
|
||||
public boolean isValid(){
|
||||
initialize();
|
||||
return isValid;
|
||||
|
@ -147,7 +152,7 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
initialize();
|
||||
return template;
|
||||
}
|
||||
|
||||
|
||||
public EntryDescriptor getDescriptor(){
|
||||
return entryDescriptor;
|
||||
}
|
||||
|
@ -155,19 +160,19 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
private void initialize(){
|
||||
if(initialized)
|
||||
return;
|
||||
|
||||
|
||||
do {
|
||||
if(entryDescriptor == null)
|
||||
break;
|
||||
String path[] = entryDescriptor.getPathArray();
|
||||
if(path == null || path.length == 0)
|
||||
break;
|
||||
|
||||
|
||||
projectTypeId = path[0];
|
||||
if(!entryDescriptor.isDefaultForCategory() &&
|
||||
if(!entryDescriptor.isDefaultForCategory() &&
|
||||
path.length > 1 && (!path[0].equals(ManagedBuildWizard.OTHERS_LABEL))){
|
||||
templateId = path[path.length - 1];
|
||||
Template templates[] = null;
|
||||
templateId = path[path.length - 1];
|
||||
Template templates[] = null;
|
||||
if(wizard instanceof ICDTCommonProjectWizard) {
|
||||
ICDTCommonProjectWizard wz = (ICDTCommonProjectWizard)wizard;
|
||||
String[] langIDs = wz.getLanguageIDs();
|
||||
|
@ -176,38 +181,38 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
for (String id : langIDs) {
|
||||
lstTemplates.addAll(Arrays.asList(TemplateEngineUI.getDefault().
|
||||
getTemplates(projectTypeId, null, id)));
|
||||
}
|
||||
}
|
||||
templates = lstTemplates.toArray(new Template[lstTemplates.size()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(null == templates) {
|
||||
templates = TemplateEngineUI.getDefault().getTemplates(projectTypeId);
|
||||
}
|
||||
if((null == templates) || (templates.length == 0))
|
||||
break;
|
||||
|
||||
|
||||
for (Template t : templates) {
|
||||
if(t.getTemplateId().equals(templateId)){
|
||||
template = t;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(template == null)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
isValid = true;
|
||||
} while(false);
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
|
||||
public Template getInitializedTemplate(IWizardPage predatingPage, IWizardPage followingPage, Map<String, String> map){
|
||||
getNextPage(predatingPage, followingPage);
|
||||
|
||||
|
||||
Template template = getTemplate();
|
||||
|
||||
|
||||
if(template != null){
|
||||
Map<String, String> valueStore = template.getValueStore();
|
||||
// valueStore.clear();
|
||||
|
@ -223,11 +228,11 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
}
|
||||
return template;
|
||||
}
|
||||
|
||||
|
||||
public IWizardPage getNextPage(IWizardPage predatingPage, IWizardPage followingPage) {
|
||||
initialize();
|
||||
if(this.templatePages == null
|
||||
|| this.predatingPage != predatingPage
|
||||
if(this.templatePages == null
|
||||
|| this.predatingPage != predatingPage
|
||||
|| this.followingPage != followingPage){
|
||||
this.predatingPage = predatingPage;
|
||||
this.followingPage = followingPage;
|
||||
|
@ -238,12 +243,12 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
followingPage.setPreviousPage(predatingPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(templatePages.length != 0)
|
||||
return templatePages[0];
|
||||
return followingPage;
|
||||
}
|
||||
|
||||
|
||||
private boolean canFinish(IWizardPage predatingPage, IWizardPage followingPage){
|
||||
getNextPage(predatingPage, followingPage);
|
||||
for(int i = 0; i < templatePages.length; i++){
|
||||
|
@ -252,47 +257,47 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Filters toolchains
|
||||
*
|
||||
* Filters toolchains
|
||||
*
|
||||
* @return - set of compatible toolchain's IDs
|
||||
*/
|
||||
protected Set<String> tc_filter() {
|
||||
Set<String> full = tcs.keySet();
|
||||
if (entryDescriptor == null)
|
||||
if (entryDescriptor == null)
|
||||
return full;
|
||||
Set<String> out = new LinkedHashSet<String>(full.size());
|
||||
for (String s : full)
|
||||
if (isToolChainAcceptable(s))
|
||||
if (isToolChainAcceptable(s))
|
||||
out.add(s);
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether given toolchain can be displayed
|
||||
*
|
||||
*
|
||||
* @param tcId - toolchain _NAME_ to check
|
||||
* @return - true if toolchain can be displayed
|
||||
*/
|
||||
public boolean isToolChainAcceptable(String tcId) {
|
||||
if (template == null || template.getTemplateInfo() == null)
|
||||
if (template == null || template.getTemplateInfo() == null)
|
||||
return true;
|
||||
|
||||
|
||||
String[] toolChainIds = template.getTemplateInfo().getToolChainIds();
|
||||
if (toolChainIds == null || toolChainIds.length == 0)
|
||||
if (toolChainIds == null || toolChainIds.length == 0)
|
||||
return true;
|
||||
|
||||
|
||||
Object ob = tcs.get(tcId);
|
||||
if (ob == null)
|
||||
return true; // sic ! This can occur with Other Toolchain only
|
||||
if (!(ob instanceof IToolChain))
|
||||
return false;
|
||||
|
||||
|
||||
String id1 = ((IToolChain)ob).getId();
|
||||
IToolChain sup = ((IToolChain)ob).getSuperClass();
|
||||
String id2 = sup == null ? null : sup.getId();
|
||||
|
||||
|
||||
for (String id : toolChainIds) {
|
||||
if ((id != null && id.equals(id1)) ||
|
||||
(id != null && id.equals(id2)))
|
||||
|
@ -305,20 +310,20 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
return tc_filter().size();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public MBSWizardHandler(IProjectType _pt, Composite p, IWizard w) {
|
||||
super(p, Messages.CWizardHandler_0, _pt.getName());
|
||||
super(p, Messages.CWizardHandler_0, _pt.getName());
|
||||
pt = _pt;
|
||||
setWizard(w);
|
||||
}
|
||||
|
||||
public MBSWizardHandler(String name, Composite p, IWizard w) {
|
||||
super(p, Messages.CWizardHandler_0, name);
|
||||
super(p, Messages.CWizardHandler_0, name);
|
||||
setWizard(w);
|
||||
}
|
||||
|
||||
public MBSWizardHandler(IBuildPropertyValue val, Composite p, IWizard w) {
|
||||
super(p, Messages.CWizardHandler_0, val.getName());
|
||||
super(p, Messages.CWizardHandler_0, val.getName());
|
||||
propertyId = val.getId();
|
||||
setWizard(w);
|
||||
}
|
||||
|
@ -330,16 +335,16 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
startingPage = w.getStartingPage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected IWizardPage getStartingPage(){
|
||||
return startingPage;
|
||||
}
|
||||
|
||||
|
||||
public Map<String, String> getMainPageData() {
|
||||
WizardNewProjectCreationPage page = (WizardNewProjectCreationPage)getStartingPage();
|
||||
Map<String, String> data = new HashMap<String, String>();
|
||||
String projName = page.getProjectName();
|
||||
projName = projName != null ? projName.trim() : EMPTY_STR;
|
||||
projName = projName != null ? projName.trim() : EMPTY_STR;
|
||||
data.put("projectName", projName); //$NON-NLS-1$
|
||||
data.put("baseName", getBaseName(projName)); //$NON-NLS-1$
|
||||
data.put("baseNameUpper", getBaseName(projName).toUpperCase() ); //$NON-NLS-1$
|
||||
|
@ -350,7 +355,7 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
data.put("location", location); //getProjectLocation().toPortableString()); //$NON-NLS-1$
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
private String getBaseName(String name) {
|
||||
String baseName = name;
|
||||
int dot = baseName.lastIndexOf('.');
|
||||
|
@ -363,11 +368,11 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
}
|
||||
return baseName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void handleSelection() {
|
||||
List<String> preferred = CDTPrefUtil.getPreferredTCs();
|
||||
|
||||
|
||||
if (table == null) {
|
||||
table = new Table(parent, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
|
||||
table.getAccessible().addAccessibleListener(
|
||||
|
@ -400,7 +405,7 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
counter++;
|
||||
}
|
||||
if (counter > 0) table.select(position);
|
||||
}
|
||||
}
|
||||
table.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
|
@ -421,11 +426,11 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
if (listener != null)
|
||||
listener.toolChainListChanged(table.getSelectionCount());
|
||||
}
|
||||
|
||||
|
||||
private void loadCustomPages() {
|
||||
if (! (getWizard() instanceof ICDTCommonProjectWizard))
|
||||
return; // not probable
|
||||
|
||||
if (! (getWizard() instanceof ICDTCommonProjectWizard))
|
||||
return; // not probable
|
||||
|
||||
ICDTCommonProjectWizard wz = (ICDTCommonProjectWizard)getWizard();
|
||||
MBSCustomPageManager.init();
|
||||
MBSCustomPageManager.addStockPage(getStartingPage(), CDTMainWizardPage.PAGE_ID);
|
||||
|
@ -438,9 +443,9 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
|
||||
customPages = MBSCustomPageManager.getCustomPages();
|
||||
|
||||
if (customPages == null)
|
||||
if (customPages == null)
|
||||
customPages = new IWizardPage[0];
|
||||
|
||||
|
||||
for (IWizardPage customPage : customPages)
|
||||
customPage.setWizard(wz);
|
||||
setCustomPagesFilter(wz);
|
||||
|
@ -463,13 +468,13 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
boolean ptIsNull = (getProjectType() == null);
|
||||
if (!ptIsNull)
|
||||
MBSCustomPageManager.addPageProperty(
|
||||
MBSCustomPageManager.PAGE_ID,
|
||||
MBSCustomPageManager.PROJECT_TYPE,
|
||||
MBSCustomPageManager.PAGE_ID,
|
||||
MBSCustomPageManager.PROJECT_TYPE,
|
||||
getProjectType().getId()
|
||||
);
|
||||
|
||||
IToolChain[] tcs = getSelectedToolChains();
|
||||
ArrayList<IToolChain> x = new ArrayList<IToolChain>();
|
||||
ArrayList<IToolChain> x = new ArrayList<IToolChain>();
|
||||
TreeSet<String> y = new TreeSet<String>();
|
||||
if (tcs!=null) {
|
||||
int n = tcs.length;
|
||||
|
@ -477,7 +482,7 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
if (tcs[i] == null) // --- NO TOOLCHAIN ---
|
||||
continue; // has no custom pages.
|
||||
x.add(tcs[i]);
|
||||
|
||||
|
||||
IConfiguration cfg = tcs[i].getParent();
|
||||
if (cfg == null)
|
||||
continue;
|
||||
|
@ -487,24 +492,24 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
}
|
||||
}
|
||||
MBSCustomPageManager.addPageProperty(
|
||||
MBSCustomPageManager.PAGE_ID,
|
||||
MBSCustomPageManager.TOOLCHAIN,
|
||||
MBSCustomPageManager.PAGE_ID,
|
||||
MBSCustomPageManager.TOOLCHAIN,
|
||||
x);
|
||||
|
||||
|
||||
if (ptIsNull) {
|
||||
if (y.size() > 0)
|
||||
MBSCustomPageManager.addPageProperty(
|
||||
MBSCustomPageManager.PAGE_ID,
|
||||
MBSCustomPageManager.PROJECT_TYPE,
|
||||
MBSCustomPageManager.PAGE_ID,
|
||||
MBSCustomPageManager.PROJECT_TYPE,
|
||||
y);
|
||||
else
|
||||
MBSCustomPageManager.addPageProperty(
|
||||
MBSCustomPageManager.PAGE_ID,
|
||||
MBSCustomPageManager.PROJECT_TYPE,
|
||||
MBSCustomPageManager.PAGE_ID,
|
||||
MBSCustomPageManager.PROJECT_TYPE,
|
||||
null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void handleUnSelection() {
|
||||
if (table != null) {
|
||||
|
@ -517,16 +522,16 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
if (tc.isAbstract() || tc.isSystemObject()) return;
|
||||
IConfiguration[] cfgs = null;
|
||||
// New style managed project type. Configurations are referenced via propertyId.
|
||||
if (propertyId != null) {
|
||||
if (propertyId != null) {
|
||||
cfgs = ManagedBuildManager.getExtensionConfigurations(tc, ARTIFACT, propertyId);
|
||||
// Old style managewd project type. Configs are obtained via projectType
|
||||
} else if (pt != null) {
|
||||
cfgs = ManagedBuildManager.getExtensionConfigurations(tc, pt);
|
||||
}
|
||||
}
|
||||
if (cfgs == null || cfgs.length == 0) return;
|
||||
full_tcs.put(tc.getUniqueRealName(), tc);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void createProject(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException {
|
||||
try {
|
||||
|
@ -544,20 +549,20 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
public void convertProject(IProject proj, IProgressMonitor monitor) throws CoreException {
|
||||
setProjectDescription(proj, true, true, monitor);
|
||||
}
|
||||
|
||||
|
||||
private void setProjectDescription(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException {
|
||||
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
|
||||
ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
|
||||
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
|
||||
monitor.worked(10);
|
||||
cfgs = getCfgItems(false);
|
||||
if (cfgs == null || cfgs.length == 0)
|
||||
if (cfgs == null || cfgs.length == 0)
|
||||
cfgs = CDTConfigWizardPage.getDefaultCfgs(this);
|
||||
|
||||
|
||||
if (cfgs == null || cfgs.length == 0 || cfgs[0].getConfiguration() == null) {
|
||||
throw new CoreException(new Status(IStatus.ERROR,
|
||||
throw new CoreException(new Status(IStatus.ERROR,
|
||||
ManagedBuilderUIPlugin.getUniqueIdentifier(),
|
||||
Messages.CWizardHandler_6));
|
||||
Messages.CWizardHandler_6));
|
||||
}
|
||||
Configuration cf = (Configuration)cfgs[0].getConfiguration();
|
||||
ManagedProject mProj = new ManagedProject(project, cf.getProjectType());
|
||||
|
@ -565,12 +570,12 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
monitor.worked(10);
|
||||
cfgs = CfgHolder.unique(cfgs);
|
||||
cfgs = CfgHolder.reorder(cfgs);
|
||||
|
||||
|
||||
ICConfigurationDescription cfgDebug = null;
|
||||
ICConfigurationDescription cfgFirst = null;
|
||||
|
||||
|
||||
int work = 50/cfgs.length;
|
||||
|
||||
|
||||
for (CfgHolder cfg : cfgs) {
|
||||
cf = (Configuration)cfg.getConfiguration();
|
||||
String id = ManagedBuildManager.calculateChildId(cf.getId(), null);
|
||||
|
@ -582,32 +587,53 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
|
||||
IBuilder bld = config.getEditableBuilder();
|
||||
if (bld != null) { bld.setManagedBuildOn(true); }
|
||||
|
||||
|
||||
config.setName(cfg.getName());
|
||||
config.setArtifactName(mProj.getDefaultArtifactName());
|
||||
|
||||
|
||||
IBuildProperty b = config.getBuildProperties().getProperty(PROPERTY);
|
||||
if (cfgDebug == null && b != null && b.getValue() != null && PROP_VAL.equals(b.getValue().getId()))
|
||||
cfgDebug = cfgDes;
|
||||
if (cfgFirst == null) // select at least first configuration
|
||||
cfgFirst = cfgDes;
|
||||
if (cfgFirst == null) // select at least first configuration
|
||||
cfgFirst = cfgDes;
|
||||
|
||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||
boolean isTryingNewSD = false;
|
||||
IWizardPage page = getStartingPage();
|
||||
if (page instanceof CDTMainWizardPage) {
|
||||
isTryingNewSD = ((CDTMainWizardPage)page).isTryingNewSD();
|
||||
}
|
||||
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isTryingNewSD);
|
||||
List<ILanguageSettingsProvider> providers;
|
||||
if (isTryingNewSD) {
|
||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(config, cfgDes);
|
||||
} else {
|
||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
||||
}
|
||||
|
||||
monitor.worked(work);
|
||||
}
|
||||
mngr.setProjectDescription(project, des);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void doTemplatesPostProcess(IProject prj) {
|
||||
if(entryInfo == null)
|
||||
return;
|
||||
|
||||
|
||||
Template template = entryInfo.getInitializedTemplate(getStartingPage(), getConfigPage(), getMainPageData());
|
||||
if(template == null)
|
||||
return;
|
||||
|
||||
List<IConfiguration> configs = new ArrayList<IConfiguration>();
|
||||
for (CfgHolder cfg : cfgs) {
|
||||
configs.add((IConfiguration)cfg.getConfiguration());
|
||||
configs.add(cfg.getConfiguration());
|
||||
}
|
||||
template.getTemplateInfo().setConfigurations(configs);
|
||||
|
||||
|
@ -616,19 +642,19 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
TemplateEngineUIUtil.showError(statuses[0].getMessage(), statuses[0].getException());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected CDTConfigWizardPage getConfigPage() {
|
||||
if (fConfigPage == null) {
|
||||
fConfigPage = new CDTConfigWizardPage(this);
|
||||
}
|
||||
return fConfigPage;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IWizardPage getSpecificPage() {
|
||||
return entryInfo.getNextPage(getStartingPage(), getConfigPage());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Mark preferred toolchains with specific images
|
||||
*/
|
||||
|
@ -647,11 +673,11 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<String> getPreferredTCNames() {
|
||||
return preferredTCs;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getHeader() { return head; }
|
||||
public boolean isDummy() { return false; }
|
||||
|
@ -659,11 +685,11 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
public boolean supportsPreferred() { return true; }
|
||||
|
||||
@Override
|
||||
public boolean isChanged() {
|
||||
public boolean isChanged() {
|
||||
if (savedToolChains == null)
|
||||
return true;
|
||||
IToolChain[] tcs = getSelectedToolChains();
|
||||
if (savedToolChains.length != tcs.length)
|
||||
if (savedToolChains.length != tcs.length)
|
||||
return true;
|
||||
for (IToolChain savedToolChain : savedToolChains) {
|
||||
boolean found = false;
|
||||
|
@ -678,12 +704,12 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void saveState() {
|
||||
savedToolChains = getSelectedToolChains();
|
||||
}
|
||||
|
||||
|
||||
// Methods specific for MBSWizardHandler
|
||||
|
||||
public IToolChain[] getSelectedToolChains() {
|
||||
|
@ -699,7 +725,7 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
public int getToolChainsCount() {
|
||||
if (entryInfo == null)
|
||||
return full_tcs.size();
|
||||
else
|
||||
else
|
||||
return entryInfo.tc_filter().size();
|
||||
}
|
||||
public String getPropertyId() {
|
||||
|
@ -716,13 +742,13 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
return fConfigPage.getCfgItems(defaults);
|
||||
}
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
public String getErrorMessage() {
|
||||
TableItem[] tis = table.getSelection();
|
||||
if (tis == null || tis.length == 0)
|
||||
return Messages.MBSWizardHandler_0;
|
||||
return Messages.MBSWizardHandler_0;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void doCustom(IProject newProject) {
|
||||
IRunnableWithProgress[] operations = MBSCustomPageManager.getOperations();
|
||||
|
@ -736,7 +762,7 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
ManagedBuilderUIPlugin.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void postProcess(IProject newProject, boolean created) {
|
||||
deleteExtraConfigs(newProject);
|
||||
|
@ -747,17 +773,17 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
doCustom(newProject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes configurations
|
||||
*
|
||||
* Deletes configurations
|
||||
*
|
||||
* @param newProject - affected project
|
||||
*/
|
||||
private void deleteExtraConfigs(IProject newProject) {
|
||||
if (isChanged()) return; // no need to delete
|
||||
if (isChanged()) return; // no need to delete
|
||||
if (listener != null && listener.isCurrent()) return; // nothing to delete
|
||||
if (fConfigPage == null || !fConfigPage.pagesLoaded) return;
|
||||
|
||||
|
||||
ICProjectDescription prjd = CoreModel.getDefault().getProjectDescription(newProject, true);
|
||||
if (prjd == null) return;
|
||||
ICConfigurationDescription[] all = prjd.getConfigurations();
|
||||
|
@ -781,19 +807,19 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
CoreModel.getDefault().setProjectDescription(newProject, prjd);
|
||||
} catch (CoreException e) {}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isApplicable(EntryDescriptor data) {
|
||||
public boolean isApplicable(EntryDescriptor data) {
|
||||
EntryInfo info = new EntryInfo(data, full_tcs, wizard);
|
||||
return info.isValid() && (info.getToolChainsCount() > 0);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initialize(EntryDescriptor data) throws CoreException {
|
||||
EntryInfo info = new EntryInfo(data, full_tcs, wizard);
|
||||
if(!info.isValid())
|
||||
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderUIPlugin.getUniqueIdentifier(), "inappropriate descriptor")); //$NON-NLS-1$
|
||||
|
||||
|
||||
entryInfo = info;
|
||||
}
|
||||
|
||||
|
@ -819,20 +845,19 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
public boolean canFinish() {
|
||||
if(entryInfo == null)
|
||||
return false;
|
||||
|
||||
|
||||
if (!getConfigPage().isCustomPageComplete())
|
||||
return false;
|
||||
|
||||
|
||||
if(!entryInfo.canFinish(startingPage, getConfigPage()))
|
||||
return false;
|
||||
|
||||
|
||||
if (customPages != null)
|
||||
for (int i=0; i<customPages.length; i++)
|
||||
if (!customPages[i].isPageComplete())
|
||||
return false;
|
||||
|
||||
|
||||
return super.canFinish();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,10 @@ import java.lang.reflect.InvocationTargetException;
|
|||
|
||||
import org.eclipse.cdt.core.CCProjectNature;
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
|
||||
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.settings.model.ICProjectDescriptionManager;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||
|
@ -25,6 +28,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
|
|||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
|
||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||
import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
|
@ -69,6 +73,7 @@ public class NewMakeProjFromExisting extends Wizard implements IImportWizard, IN
|
|||
final String locationStr = page.getLocation();
|
||||
final boolean isCPP = page.isCPP();
|
||||
final IToolChain toolChain = page.getToolChain();
|
||||
final boolean isTryingNewSD = page.isTryingNewSD();
|
||||
|
||||
IRunnableWithProgress op = new WorkspaceModifyOperation() {
|
||||
@Override
|
||||
|
@ -110,7 +115,21 @@ public class NewMakeProjFromExisting extends Wizard implements IImportWizard, IN
|
|||
IBuilder builder = config.getEditableBuilder();
|
||||
builder.setManagedBuildOn(false);
|
||||
CConfigurationData data = config.getConfigurationData();
|
||||
projDesc.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
||||
ICConfigurationDescription cfgDes = projDesc.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
||||
|
||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isTryingNewSD);
|
||||
if (isTryingNewSD) {
|
||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(config, cfgDes);
|
||||
} else {
|
||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
||||
}
|
||||
|
||||
monitor.worked(1);
|
||||
|
||||
pdMgr.setProjectDescription(project, projDesc);
|
||||
|
|
|
@ -16,9 +16,12 @@ import java.util.Collections;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||
|
@ -59,8 +62,8 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
|||
IWorkspaceRoot root;
|
||||
List tcList;
|
||||
Map<String, IToolChain> tcMap = new HashMap<String, IToolChain>();
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* True if the user entered a non-empty string in the project name field. In that state, we avoid
|
||||
* automatically filling the project name field with the directory name (last segment of the location) he
|
||||
|
@ -68,6 +71,9 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
|||
*/
|
||||
boolean projectNameSetByUser;
|
||||
|
||||
private Button checkBoxTryNewSD;
|
||||
|
||||
|
||||
protected NewMakeProjFromExistingPage() {
|
||||
super(Messages.NewMakeProjFromExistingPage_0);
|
||||
setTitle(Messages.NewMakeProjFromExistingPage_1);
|
||||
|
@ -87,6 +93,22 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
|||
addSourceSelector(comp);
|
||||
addLanguageSelector(comp);
|
||||
addToolchainSelector(comp);
|
||||
|
||||
checkBoxTryNewSD = new Button(comp, SWT.CHECK);
|
||||
checkBoxTryNewSD.setText(org.eclipse.cdt.internal.ui.newui.Messages.LanguageSettingsProviders_EnableForProject);
|
||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.horizontalSpan = 2;
|
||||
checkBoxTryNewSD.setLayoutData(gd);
|
||||
|
||||
|
||||
// restore settings from preferences
|
||||
boolean isTryNewSD = true;
|
||||
boolean contains = CUIPlugin.getDefault().getPreferenceStore().contains(LanguageSettingsProvidersPage.KEY_NEWSD);
|
||||
if (contains) {
|
||||
isTryNewSD = CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NEWSD);
|
||||
}
|
||||
checkBoxTryNewSD.setSelection(isTryNewSD);
|
||||
|
||||
setControl(comp);
|
||||
}
|
||||
|
||||
|
@ -109,7 +131,7 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Note that the modify listener gets called not only when the user enters text but also when we
|
||||
// programatically set the field. This listener only gets called when the user modifies the field
|
||||
projectName.addKeyListener(new KeyAdapter() {
|
||||
|
@ -119,17 +141,17 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validates the contents of the page, setting the page error message and Finish button state accordingly
|
||||
*
|
||||
*
|
||||
* @since 8.1
|
||||
*/
|
||||
protected void validatePage() {
|
||||
// Don't generate an error if project name or location is empty, but do disable Finish button.
|
||||
// Don't generate an error if project name or location is empty, but do disable Finish button.
|
||||
String msg = null;
|
||||
boolean complete = true; // ultimately treated as false if msg != null
|
||||
|
||||
|
||||
String name = getProjectName();
|
||||
if (name.isEmpty()) {
|
||||
complete = false;
|
||||
|
@ -257,11 +279,11 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
|||
|
||||
tcList = new List(group, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL);
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
|
||||
|
||||
// Base the List control size on the number of total toolchains, up to 15 entries, but allocate for no
|
||||
// less than five (small list boxes look strange). A vertical scrollbar will appear as needed
|
||||
updateTcMap(false);
|
||||
gd.heightHint = tcList.getItemHeight() * (1 + Math.max(Math.min(tcMap.size(), 15), 5)); // +1 for <none>
|
||||
gd.heightHint = tcList.getItemHeight() * (1 + Math.max(Math.min(tcMap.size(), 15), 5)); // +1 for <none>
|
||||
tcList.setLayoutData(gd);
|
||||
tcList.add(Messages.NewMakeProjFromExistingPage_11);
|
||||
|
||||
|
@ -279,11 +301,11 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
|||
|
||||
supportedOnly.setSelection(true);
|
||||
updateTcWidget(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load our map and with the suitable toolchains and then populate the List control
|
||||
*
|
||||
*
|
||||
* @param supportedOnly
|
||||
* if true, consider only supported toolchains
|
||||
*/
|
||||
|
@ -302,7 +324,7 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
|||
|
||||
/**
|
||||
* Load our map with the suitable toolchains.
|
||||
*
|
||||
*
|
||||
* @param supportedOnly
|
||||
* if true, add only toolchains that are available and which support the host platform
|
||||
*/
|
||||
|
@ -342,4 +364,11 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
|||
return selection.length != 0 ? tcMap.get(selection[0]) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* AG FIXME temporary method to be removed before CDT Juno release.
|
||||
* @since 8.1
|
||||
*/
|
||||
public boolean isTryingNewSD() {
|
||||
return checkBoxTryNewSD.getSelection();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,10 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.ui.wizards;
|
||||
|
||||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
|
||||
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.settings.model.ICProjectDescriptionManager;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||
|
@ -23,11 +26,14 @@ import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
|
|||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
|
||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||
import org.eclipse.cdt.ui.wizards.CDTMainWizardPage;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jface.wizard.IWizard;
|
||||
import org.eclipse.jface.wizard.IWizardPage;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
/**
|
||||
|
@ -37,13 +43,13 @@ import org.eclipse.swt.widgets.Composite;
|
|||
public class STDWizardHandler extends MBSWizardHandler {
|
||||
|
||||
public STDWizardHandler(Composite p, IWizard w) {
|
||||
super(Messages.StdBuildWizard_0, p, w);
|
||||
super(Messages.StdBuildWizard_0, p, w);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTc(IToolChain tc) {
|
||||
if (tc == null) {
|
||||
full_tcs.put(Messages.StdProjectTypeHandler_0, null);
|
||||
full_tcs.put(Messages.StdProjectTypeHandler_0, null);
|
||||
} else {
|
||||
if (tc.isAbstract() || tc.isSystemObject()) return;
|
||||
// unlike CWizardHandler, we don't check for configs
|
||||
|
@ -58,9 +64,9 @@ public class STDWizardHandler extends MBSWizardHandler {
|
|||
public void createProject(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException {
|
||||
try {
|
||||
monitor.beginTask("", 100);//$NON-NLS-1$
|
||||
|
||||
|
||||
setProjectDescription(project, defaults, onFinish, monitor);
|
||||
|
||||
|
||||
doTemplatesPostProcess(project);
|
||||
doCustom(project);
|
||||
monitor.worked(30);
|
||||
|
@ -71,6 +77,7 @@ public class STDWizardHandler extends MBSWizardHandler {
|
|||
|
||||
private void setProjectDescription(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor)
|
||||
throws CoreException {
|
||||
|
||||
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
|
||||
ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
|
||||
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
|
||||
|
@ -95,28 +102,51 @@ public class STDWizardHandler extends MBSWizardHandler {
|
|||
}
|
||||
bld.setManagedBuildOn(false);
|
||||
} else {
|
||||
System.out.println(Messages.StdProjectTypeHandler_3);
|
||||
System.out.println(Messages.StdProjectTypeHandler_3);
|
||||
}
|
||||
cfg.setArtifactName(mProj.getDefaultArtifactName());
|
||||
CConfigurationData data = cfg.getConfigurationData();
|
||||
des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
||||
ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
||||
|
||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||
boolean isTryingNewSD = false;
|
||||
IWizardPage page = getStartingPage();
|
||||
if (page instanceof CDTMainWizardPage) {
|
||||
isTryingNewSD = ((CDTMainWizardPage)page).isTryingNewSD();
|
||||
}
|
||||
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isTryingNewSD);
|
||||
if (isTryingNewSD) {
|
||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(cfg, cfgDes);
|
||||
} else {
|
||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
||||
}
|
||||
|
||||
monitor.worked(work);
|
||||
}
|
||||
mngr.setProjectDescription(project, des);
|
||||
}
|
||||
public boolean canCreateWithoutToolchain() { return true; }
|
||||
|
||||
|
||||
public boolean canCreateWithoutToolchain() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void convertProject(IProject proj, IProgressMonitor monitor) throws CoreException {
|
||||
setProjectDescription(proj, true, true, monitor);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If no toolchains selected by user, use default toolchain
|
||||
*/
|
||||
@Override
|
||||
public IToolChain[] getSelectedToolChains() {
|
||||
if (full_tcs.size() == 0 || table.getSelection().length == 0)
|
||||
if (full_tcs.size() == 0 || table.getSelection().length == 0)
|
||||
return new IToolChain[] { null };
|
||||
else
|
||||
return super.getSelectedToolChains();
|
||||
|
|
|
@ -17,6 +17,7 @@ import java.util.List;
|
|||
import junit.framework.TestSuite;
|
||||
|
||||
import org.eclipse.cdt.core.AbstractExecutableExtensionBase;
|
||||
import org.eclipse.cdt.core.dom.ast.gnu.cpp.GPPLanguage;
|
||||
import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
|
||||
import org.eclipse.cdt.core.settings.model.CMacroEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
|
@ -55,6 +56,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
|
|||
private static final String PROVIDER_NAME_2 = "test.provider.2.name";
|
||||
private static final String CFG_ID = "test.configuration.id";
|
||||
private static final String LANG_ID = "test.lang.id";
|
||||
private static final String LANG_CPP = GPPLanguage.ID;
|
||||
private static final IFile FILE_0 = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path("/project/path0"));
|
||||
|
||||
/**
|
||||
|
@ -805,4 +807,156 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
|
|||
assertSame(provider, providers.get(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO - YAGNI?
|
||||
*/
|
||||
public void testBuildResourceTree_FileInFolder() throws Exception {
|
||||
// sample entries
|
||||
CMacroEntry entry = new CMacroEntry("MACRO", null, 0);
|
||||
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
|
||||
entries.add(entry);
|
||||
|
||||
// create resources
|
||||
IProject project = ResourceHelper.createCDTProjectWithConfig(this.getName());
|
||||
IFile file = ResourceHelper.createFile(project, "file.cpp");
|
||||
assertNotNull(file);
|
||||
|
||||
// create a provider and set the entries
|
||||
LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
|
||||
provider.setSettingEntries(null, file, null, entries);
|
||||
// build the hierarchy
|
||||
LanguageSettingsProvidersSerializer.buildResourceTree(provider, null, null, project);
|
||||
|
||||
// check that entries go to highest possible level
|
||||
assertEquals(entries, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, file, null));
|
||||
assertEquals(entries, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, project, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO - YAGNI?
|
||||
*/
|
||||
public void testBuildResourceTree_FileInSubFolder() throws Exception {
|
||||
// sample entries
|
||||
CMacroEntry entry = new CMacroEntry("MACRO", null, 0);
|
||||
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
|
||||
entries.add(entry);
|
||||
|
||||
// create resources
|
||||
IProject project = ResourceHelper.createCDTProjectWithConfig(this.getName());
|
||||
IFolder folder = ResourceHelper.createFolder(project, "Folder");
|
||||
IFile file = ResourceHelper.createFile(project, "Folder/file.cpp");
|
||||
|
||||
// create a provider and set the entries
|
||||
LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
|
||||
provider.setSettingEntries(null, file, null, entries);
|
||||
// build the hierarchy
|
||||
LanguageSettingsProvidersSerializer.buildResourceTree(provider, null, null, project);
|
||||
|
||||
// check that entries go to highest possible level
|
||||
assertEquals(entries, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, file, null));
|
||||
assertEquals(entries, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, folder, null));
|
||||
assertEquals(entries, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, project, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO - YAGNI?
|
||||
*/
|
||||
public void testBuildResourceTree_TwoSubFolders() throws Exception {
|
||||
// sample entries
|
||||
List<ICLanguageSettingEntry> entries1 = new ArrayList<ICLanguageSettingEntry>();
|
||||
entries1.add(new CMacroEntry("MACRO_1", null, 0));
|
||||
List<ICLanguageSettingEntry> entries2 = new ArrayList<ICLanguageSettingEntry>();
|
||||
entries2.add(new CMacroEntry("MACRO_2", null, 0));
|
||||
|
||||
// create resources
|
||||
IProject project = ResourceHelper.createCDTProjectWithConfig(this.getName());
|
||||
IFolder folder1 = ResourceHelper.createFolder(project, "Folder1");
|
||||
IFolder folder2 = ResourceHelper.createFolder(project, "Folder2");
|
||||
IFile file1 = ResourceHelper.createFile(project, "Folder1/file1.cpp");
|
||||
IFile file2 = ResourceHelper.createFile(project, "Folder2/file2.cpp");
|
||||
|
||||
// create a provider and set the entries
|
||||
LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
|
||||
provider.setSettingEntries(null, file1, null, entries1);
|
||||
provider.setSettingEntries(null, file2, null, entries2);
|
||||
// build the hierarchy
|
||||
LanguageSettingsProvidersSerializer.buildResourceTree(provider, null, null, project);
|
||||
|
||||
// check that entries go to highest possible level
|
||||
assertEquals(entries1, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, file1, null));
|
||||
assertEquals(entries1, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, folder1, null));
|
||||
|
||||
assertEquals(entries2, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, file2, null));
|
||||
assertEquals(entries2, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, folder2, null));
|
||||
|
||||
assertEquals(0, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, project, null).size());
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO - YAGNI?
|
||||
*/
|
||||
public void testBuildResourceTree_FlippingSettings() throws Exception {
|
||||
// sample entries
|
||||
List<ICLanguageSettingEntry> entries1 = new ArrayList<ICLanguageSettingEntry>();
|
||||
entries1.add(new CMacroEntry("MACRO_1", null, 0));
|
||||
List<ICLanguageSettingEntry> entries2 = new ArrayList<ICLanguageSettingEntry>();
|
||||
entries2.add(new CMacroEntry("MACRO_2", null, 0));
|
||||
|
||||
// create resources
|
||||
IProject project = ResourceHelper.createCDTProjectWithConfig(this.getName());
|
||||
IFile file1 = ResourceHelper.createFile(project, "file1.cpp");
|
||||
IFile file2 = ResourceHelper.createFile(project, "file2.cpp");
|
||||
IFile file3 = ResourceHelper.createFile(project, "file3.cpp");
|
||||
|
||||
// create a provider
|
||||
LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
|
||||
|
||||
// set the entries for the first 2 files
|
||||
provider.setSettingEntries(null, file1, null, entries1);
|
||||
provider.setSettingEntries(null, file2, null, entries1);
|
||||
// build the hierarchy
|
||||
LanguageSettingsProvidersSerializer.buildResourceTree(provider, null, null, project);
|
||||
// double-check where the entries go
|
||||
assertEquals(entries1, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, file1, null));
|
||||
assertEquals(entries1, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, file2, null));
|
||||
assertEquals(entries1, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, project, null));
|
||||
|
||||
// set the entries for the second+third files (second file flips the settings)
|
||||
provider.setSettingEntries(null, file2, null, entries2);
|
||||
provider.setSettingEntries(null, file3, null, entries2);
|
||||
// build the hierarchy
|
||||
LanguageSettingsProvidersSerializer.buildResourceTree(provider, null, null, project);
|
||||
// check where the entries go, it should not lose entries for the first file
|
||||
assertEquals(entries1, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, file1, null));
|
||||
assertEquals(entries2, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, file2, null));
|
||||
assertEquals(entries2, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, file3, null));
|
||||
assertEquals(entries2, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, project, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO - YAGNI?
|
||||
*/
|
||||
public void testBuildResourceTree_WithLanguage() throws Exception {
|
||||
// sample entries
|
||||
CMacroEntry entry = new CMacroEntry("MACRO", null, 0);
|
||||
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
|
||||
entries.add(entry);
|
||||
|
||||
// create resources
|
||||
IProject project = ResourceHelper.createCDTProjectWithConfig(this.getName());
|
||||
IFolder folder = ResourceHelper.createFolder(project, "Folder");
|
||||
IFile file = ResourceHelper.createFile(project, "Folder/file.cpp");
|
||||
|
||||
// create a provider and set the entries
|
||||
LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
|
||||
provider.setSettingEntries(null, file, LANG_CPP, entries);
|
||||
// build the hierarchy
|
||||
LanguageSettingsProvidersSerializer.buildResourceTree(provider, null, LANG_CPP, project);
|
||||
|
||||
// check that entries go to highest possible level
|
||||
assertEquals(entries, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, file, LANG_CPP));
|
||||
assertEquals(entries, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, folder, LANG_CPP));
|
||||
assertEquals(entries, LanguageSettingsManager.getSettingEntriesUpResourceTree(provider, null, project, LANG_CPP));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,7 +12,9 @@
|
|||
package org.eclipse.cdt.core.language.settings.providers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
|
@ -47,6 +49,9 @@ public class ScannerDiscoveryLegacySupport {
|
|||
private static final String PREFERENCES_QUALIFIER = CCorePlugin.PLUGIN_ID;
|
||||
private static final String LANGUAGE_SETTINGS_PROVIDERS_NODE = "languageSettingsProviders"; //$NON-NLS-1$
|
||||
|
||||
private static Map<String, String> legacyProfiles = null;
|
||||
|
||||
|
||||
/**
|
||||
* Get preferences node for org.eclipse.cdt.core.
|
||||
*/
|
||||
|
@ -147,4 +152,37 @@ public class ScannerDiscoveryLegacySupport {
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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.DefaultVariableContextInfo;
|
||||
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.model.APathEntry;
|
||||
import org.eclipse.cdt.internal.core.model.CModelStatus;
|
||||
|
@ -2016,6 +2017,9 @@ public class PathEntryTranslator {
|
|||
public boolean visit(PathSettingsContainer container) {
|
||||
CResourceData rcData = (CResourceData)container.getValue();
|
||||
if (rcData != null) {
|
||||
// AG FIXME - temporary log to remove before CDT Juno release
|
||||
temporaryLog(cfgDescription, kinds, rcData);
|
||||
|
||||
PathEntryCollector child = collector.createChild(container.getPath());
|
||||
for (int kind : kinds) {
|
||||
List<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>();
|
||||
|
@ -2027,6 +2031,24 @@ public class PathEntryTranslator {
|
|||
}
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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.LanguageSettingsStorage;
|
||||
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.ICLanguageSettingEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||
|
@ -498,6 +500,9 @@ public class LanguageSettingsProvidersSerializer {
|
|||
* @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);
|
||||
List<LanguageSettingsSerializableProvider> serializableWorkspaceProviders = new ArrayList<LanguageSettingsSerializableProvider>();
|
||||
for (ILanguageSettingsProvider provider : rawGlobalWorkspaceProviders.values()) {
|
||||
|
@ -804,6 +809,9 @@ public class LanguageSettingsProvidersSerializer {
|
|||
*/
|
||||
public static void serializeLanguageSettings(ICProjectDescription prjDescription) throws CoreException {
|
||||
IProject project = prjDescription.getProject();
|
||||
// AG FIXME - temporary log to remove before CDT Juno release
|
||||
LanguageSettingsLogger.logWarning("LanguageSettingsProvidersSerializer.serializeLanguageSettings() for " + project);
|
||||
|
||||
try {
|
||||
// Using side effect of adding the module to the storage
|
||||
prjDescription.getStorage(CPROJECT_STORAGE_MODULE, true);
|
||||
|
@ -1229,6 +1237,35 @@ public class LanguageSettingsProvidersSerializer {
|
|||
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.
|
||||
*/
|
||||
|
@ -1320,9 +1357,13 @@ public class LanguageSettingsProvidersSerializer {
|
|||
*/
|
||||
public static void reRegisterListeners(ICProjectDescription oldPrjDescription, ICProjectDescription newPrjDescription) {
|
||||
if (oldPrjDescription == newPrjDescription) {
|
||||
assertConsistency(oldPrjDescription);
|
||||
return;
|
||||
}
|
||||
|
||||
assertConsistency(oldPrjDescription);
|
||||
assertConsistency(newPrjDescription);
|
||||
|
||||
List<ICListenerAgent> oldListeners = getListeners(oldPrjDescription);
|
||||
List<ListenerAssociation> newAssociations = getListenersAssociations(newPrjDescription);
|
||||
|
||||
|
@ -1389,6 +1430,9 @@ public class LanguageSettingsProvidersSerializer {
|
|||
* @param event - the {@link ILanguageSettingsChangeEvent} event to be broadcast.
|
||||
*/
|
||||
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()) {
|
||||
((ILanguageSettingsChangeListener) listener).handleEvent(event);
|
||||
}
|
||||
|
@ -1592,4 +1636,109 @@ public class LanguageSettingsProvidersSerializer {
|
|||
return new ArrayList<ILanguageSettingsProvider>(newProviders);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the language is applicable for the file.
|
||||
*/
|
||||
private static boolean isLanguageInScope(IResource rc, ICConfigurationDescription cfgDescription, String languageId) {
|
||||
if (rc instanceof IFile) {
|
||||
ILanguage lang = null;
|
||||
try {
|
||||
lang = LanguageManager.getInstance().getLanguageForFile((IFile) rc, cfgDescription);
|
||||
} catch (CoreException e) {
|
||||
CCorePlugin.log("Error while determining language for a file", e); //$NON-NLS-1$
|
||||
}
|
||||
if (lang == null || (languageId != null && !languageId.equals(lang.getId()))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds for the provider a nicer-looking resource tree to present hierarchical view to the user.
|
||||
*
|
||||
* Note that it is not advisable to "compact" the tree because of potential loss of information
|
||||
* which is especially important during partial or incremental builds.
|
||||
*
|
||||
* Note also that after using this method for a while for BOP parsers it appears that disadvantages
|
||||
* outweigh benefits. In particular, it doesn't result in saving memory as the language settings
|
||||
* (and the lists itself) are not duplicated in memory anyway but optimized with using WeakHashSet
|
||||
* and SafeStringInterner.
|
||||
*
|
||||
* This method is a candidate for removal.
|
||||
*
|
||||
* @param provider - language settings provider to build the tree for.
|
||||
* @param cfgDescription - configuration description.
|
||||
* @param languageId - language ID.
|
||||
* @param folder - container where the tree roots.
|
||||
*/
|
||||
public static void buildResourceTree(LanguageSettingsSerializableProvider provider,
|
||||
ICConfigurationDescription cfgDescription, String languageId, IContainer folder) {
|
||||
IResource[] members = null;
|
||||
try {
|
||||
members = folder.members();
|
||||
} catch (Exception e) {
|
||||
CCorePlugin.log(e);
|
||||
}
|
||||
if (members==null)
|
||||
return;
|
||||
|
||||
for (IResource rc : members) {
|
||||
if (rc instanceof IContainer) {
|
||||
buildResourceTree(provider, cfgDescription, languageId, (IContainer) rc);
|
||||
}
|
||||
}
|
||||
|
||||
int rcNumber = members.length;
|
||||
|
||||
Map<List<ICLanguageSettingEntry>, Integer> listMap = new HashMap<List<ICLanguageSettingEntry>, Integer>();
|
||||
|
||||
// on the first pass find majority entry list, i.e. list present most often
|
||||
List<ICLanguageSettingEntry> majorityEntries = null;
|
||||
List<ICLanguageSettingEntry> candidate = null;
|
||||
int candidateCount = 0;
|
||||
for (IResource rc : members) {
|
||||
if (!isLanguageInScope(rc, cfgDescription, languageId)) {
|
||||
rcNumber--;
|
||||
} else {
|
||||
List<ICLanguageSettingEntry> entries = provider.getSettingEntries(null, rc, languageId);
|
||||
if (entries==null && rc instanceof IContainer) {
|
||||
rcNumber--;
|
||||
} else {
|
||||
Integer count = listMap.get(entries);
|
||||
if (count==null) {
|
||||
count = 0;
|
||||
}
|
||||
count++;
|
||||
|
||||
if (count>candidateCount) {
|
||||
candidateCount = count;
|
||||
candidate = entries;
|
||||
}
|
||||
|
||||
listMap.put(entries, count);
|
||||
}
|
||||
}
|
||||
|
||||
if (candidateCount > rcNumber/2) {
|
||||
majorityEntries = candidate;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (majorityEntries!=null) {
|
||||
provider.setSettingEntries(cfgDescription, folder, languageId, majorityEntries);
|
||||
}
|
||||
|
||||
// second pass - assign the entries to the folders
|
||||
for (IResource rc : members) {
|
||||
List<ICLanguageSettingEntry> entries = provider.getSettingEntries(null, rc, languageId);
|
||||
if (entries!=null && entries==majorityEntries) {
|
||||
if (!(rc instanceof IFile)) { // preserve information which files were collected
|
||||
provider.setSettingEntries(cfgDescription, rc, languageId, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -64,6 +64,9 @@ public class LanguageSettingsScannerInfoProvider implements IScannerInfoProvider
|
|||
|
||||
@Override
|
||||
public ExtendedScannerInfo getScannerInformation(IResource rc) {
|
||||
// AG FIXME - temporary log to remove before CDT Juno release
|
||||
LanguageSettingsLogger.logScannerInfoProvider(rc, this);
|
||||
|
||||
IProject project = rc.getProject();
|
||||
if (project==null)
|
||||
return DUMMY_SCANNER_INFO;
|
||||
|
|
|
@ -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.ICSettingBase;
|
||||
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.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
|
@ -77,6 +78,9 @@ public class DescriptionScannerInfoProvider implements IScannerInfoProvider, ICP
|
|||
|
||||
@Override
|
||||
public IScannerInfo getScannerInformation(IResource resource) {
|
||||
// AG FIXME - temporary log to remove before CDT Juno release
|
||||
LanguageSettingsLogger.logScannerInfoProvider(resource, this);
|
||||
|
||||
if(!fInited)
|
||||
updateProjCfgInfo(CProjectDescriptionManager.getInstance().getProjectDescription(fProject, false));
|
||||
|
||||
|
|
|
@ -782,5 +782,12 @@
|
|||
factoryClass="org.eclipse.cdt.internal.core.resources.ResourceExclusionFactory">
|
||||
</exclusionFactory>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.cdt.core.EFSExtensionProvider">
|
||||
<EFSExtensionProvider
|
||||
class="org.eclipse.cdt.internal.core.resources.CygwinEFSExtensionProvider"
|
||||
scheme="cygwin">
|
||||
</EFSExtensionProvider>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
|
|
@ -29,8 +29,10 @@ import org.eclipse.cdt.core.model.IMacroFileEntry;
|
|||
import org.eclipse.cdt.core.parser.IScannerInfo;
|
||||
import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
|
||||
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.settings.model.ScannerInfoProviderProxy;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
@ -96,6 +98,13 @@ public class ScannerProvider extends AbstractCExtension implements IScannerInfoP
|
|||
*/
|
||||
@Override
|
||||
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();
|
||||
|
||||
try {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
BIN
core/org.eclipse.cdt.ui/icons/obj16/search.gif
Normal file
After Width: | Height: | Size: 347 B |
BIN
core/org.eclipse.cdt.ui/icons/ovr16/cfg_ovr.gif
Normal file
After Width: | Height: | Size: 155 B |
BIN
core/org.eclipse.cdt.ui/icons/ovr16/empty_ovr.png
Normal file
After Width: | Height: | Size: 335 B |
BIN
core/org.eclipse.cdt.ui/icons/ovr16/global_ovr.gif
Normal file
After Width: | Height: | Size: 271 B |
BIN
core/org.eclipse.cdt.ui/icons/ovr16/import_co.gif
Normal file
After Width: | Height: | Size: 68 B |
BIN
core/org.eclipse.cdt.ui/icons/ovr16/link_ovr.gif
Normal file
After Width: | Height: | Size: 169 B |
BIN
core/org.eclipse.cdt.ui/icons/ovr16/lock_ovr.gif
Normal file
After Width: | Height: | Size: 115 B |
BIN
core/org.eclipse.cdt.ui/icons/ovr16/overlay-has-context.gif
Normal file
After Width: | Height: | Size: 162 B |
BIN
core/org.eclipse.cdt.ui/icons/ovr16/project_co.gif
Normal file
After Width: | Height: | Size: 112 B |
|
@ -4339,6 +4339,7 @@
|
|||
icon="icons/obj16/ls_entries.gif"
|
||||
name="Entries"
|
||||
weight="010"
|
||||
helpId="FIXME cdt_u_prop_pns_inc"
|
||||
parent="org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage"
|
||||
tooltip="%AllLanguageSettingEntries.tooltip"/>
|
||||
<tab
|
||||
|
@ -4346,6 +4347,7 @@
|
|||
icon="icons/obj16/extension_obj.gif"
|
||||
name="Providers"
|
||||
weight="020"
|
||||
helpId="FIXME cdt_u_prop_pns_inc"
|
||||
parent="org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage"
|
||||
tooltip="%AllLanguageSettingEntries.tooltip"/>
|
||||
</extension>
|
||||
|
|
|
@ -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_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
|
||||
* of the image in org.eclipse.cdt.ui plugin or a (previously registered) string representation of URL
|
||||
|
|
|
@ -50,6 +50,7 @@ import org.eclipse.cdt.ui.CUIPlugin;
|
|||
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||
import org.eclipse.cdt.ui.newui.PageLayout;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
||||
import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||
|
||||
public class CDTMainWizardPage extends WizardNewProjectCreationPage implements IWizardItemsListListener {
|
||||
|
@ -67,6 +68,7 @@ import org.eclipse.cdt.internal.ui.newui.Messages;
|
|||
private Tree tree;
|
||||
private Composite right;
|
||||
private Button show_sup;
|
||||
private Button checkBoxTryNewSD;
|
||||
private Label right_label;
|
||||
|
||||
public CWizardHandler h_selected = null;
|
||||
|
@ -154,6 +156,20 @@ import org.eclipse.cdt.internal.ui.newui.Messages;
|
|||
|
||||
// restore settings from preferences
|
||||
show_sup.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOSUPP));
|
||||
|
||||
checkBoxTryNewSD = new Button(c, SWT.CHECK);
|
||||
checkBoxTryNewSD.setText(Messages.LanguageSettingsProviders_EnableForProject);
|
||||
/* GridData */gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.horizontalSpan = 2;
|
||||
checkBoxTryNewSD.setLayoutData(gd);
|
||||
|
||||
// restore settings from preferences
|
||||
boolean isTryNewSD = true;
|
||||
boolean contains = CUIPlugin.getDefault().getPreferenceStore().contains(LanguageSettingsProvidersPage.KEY_NEWSD);
|
||||
if (contains) {
|
||||
isTryNewSD = CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NEWSD);
|
||||
}
|
||||
checkBoxTryNewSD.setSelection(isTryNewSD);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -481,5 +497,13 @@ import org.eclipse.cdt.internal.ui.newui.Messages;
|
|||
public List filterItems(List items) {
|
||||
return items;
|
||||
}
|
||||
|
||||
/**
|
||||
* AG FIXME - remove before CDT Juno release.
|
||||
* @since 5.4
|
||||
*/
|
||||
public boolean isTryingNewSD() {
|
||||
return checkBoxTryNewSD.getSelection();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -522,18 +522,19 @@
|
|||
name="%TargetName.xlc.exe"
|
||||
projectMacroSupplier="org.eclipse.cdt.managedbuilder.xlc.ui.XLCProjectMacroSupplier">
|
||||
<configuration
|
||||
name="%ConfigName.Dbg"
|
||||
artifactExtension="exe"
|
||||
cleanCommand="rm -rf"
|
||||
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
|
||||
id="cdt.managedbuild.config.xlc.exe.debug">
|
||||
artifactExtension="exe"
|
||||
cleanCommand="rm -rf"
|
||||
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
|
||||
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
|
||||
archList="all"
|
||||
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.xlc.aix.AixConfigurationEnvironmentSupplier"
|
||||
id="cdt.managedbuild.toolchain.xlc.exe.debug"
|
||||
name="%ToolChainName.Dbg"
|
||||
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">
|
||||
<targetPlatform
|
||||
id="cdt.managedbuild.target.xlc.platform.exe.debug"
|
||||
|
@ -588,17 +589,18 @@
|
|||
</toolChain>
|
||||
</configuration>
|
||||
<configuration
|
||||
name="%ConfigName.Rel"
|
||||
artifactExtension="exe"
|
||||
cleanCommand="rm -rf"
|
||||
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
|
||||
id="cdt.managedbuild.config.xlc.exe.release">
|
||||
name="%ConfigName.Rel"
|
||||
artifactExtension="exe"
|
||||
cleanCommand="rm -rf"
|
||||
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
|
||||
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
|
||||
archList="all"
|
||||
id="cdt.managedbuild.toolchain.xlc.exe.release"
|
||||
name="%ToolChainName.Rel"
|
||||
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">
|
||||
<targetPlatform
|
||||
id="cdt.managedbuild.target.xlc.platform.exe.release"
|
||||
|
@ -661,15 +663,17 @@
|
|||
name="%TargetName.xlc.so"
|
||||
projectMacroSupplier="org.eclipse.cdt.managedbuilder.xlc.ui.XLCProjectMacroSupplier">
|
||||
<configuration
|
||||
name="%ConfigName.Dbg"
|
||||
cleanCommand="rm -rf"
|
||||
artifactExtension="so"
|
||||
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
|
||||
id="cdt.managedbuild.config.xlc.so.debug">
|
||||
name="%ConfigName.Dbg"
|
||||
cleanCommand="rm -rf"
|
||||
artifactExtension="so"
|
||||
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
|
||||
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
|
||||
name="%ToolChainName.Dbg"
|
||||
targetTool="cdt.managedbuild.tool.xlc.c.linker.so.debug;cdt.managedbuild.tool.xlc.cpp.linker.so.debug"
|
||||
id="cdt.managedbuild.toolchain.xlc.so.debug">
|
||||
id="cdt.managedbuild.toolchain.xlc.so.debug"
|
||||
languageSettingsProviders="org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser;org.eclipse.cdt.managedbuilder.xlc.core.XlcBuiltinSpecsDetector"
|
||||
name="%ToolChainName.Dbg"
|
||||
targetTool="cdt.managedbuild.tool.xlc.c.linker.so.debug;cdt.managedbuild.tool.xlc.cpp.linker.so.debug">
|
||||
<targetPlatform
|
||||
id="cdt.managedbuild.target.xlc.platform.so.debug"
|
||||
name="%PlatformName.Dbg"
|
||||
|
@ -723,15 +727,17 @@
|
|||
</toolChain>
|
||||
</configuration>
|
||||
<configuration
|
||||
name="%ConfigName.Rel"
|
||||
cleanCommand="rm -rf"
|
||||
artifactExtension="so"
|
||||
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
|
||||
id="cdt.managedbuild.config.xlc.so.release">
|
||||
name="%ConfigName.Rel"
|
||||
cleanCommand="rm -rf"
|
||||
artifactExtension="so"
|
||||
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
|
||||
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
|
||||
name="%ToolChainName.Rel"
|
||||
targetTool="cdt.managedbuild.tool.xlc.c.linker.so.release;cdt.managedbuild.tool.xlc.cpp.linker.so.release"
|
||||
id="cdt.managedbuild.toolchain.xlc.so.release">
|
||||
id="cdt.managedbuild.toolchain.xlc.so.release"
|
||||
languageSettingsProviders="org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser;org.eclipse.cdt.managedbuilder.xlc.core.XlcBuiltinSpecsDetector"
|
||||
name="%ToolChainName.Rel"
|
||||
targetTool="cdt.managedbuild.tool.xlc.c.linker.so.release;cdt.managedbuild.tool.xlc.cpp.linker.so.release">
|
||||
<targetPlatform
|
||||
id="cdt.managedbuild.target.xlc.platform.so.release"
|
||||
name="%PlatformName.Rel"
|
||||
|
@ -793,15 +799,17 @@
|
|||
name="%TargetName.xlc.lib"
|
||||
projectMacroSupplier="org.eclipse.cdt.managedbuilder.xlc.ui.XLCProjectMacroSupplier">
|
||||
<configuration
|
||||
name="%ConfigName.Dbg"
|
||||
cleanCommand="rm -rf"
|
||||
artifactExtension="lib"
|
||||
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
|
||||
id="cdt.managedbuild.config.xlc.lib.debug">
|
||||
name="%ConfigName.Dbg"
|
||||
cleanCommand="rm -rf"
|
||||
artifactExtension="lib"
|
||||
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
|
||||
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
|
||||
name="%ToolChainName.Dbg"
|
||||
targetTool="cdt.managedbuild.tool.xlc.archiver.lib.debug"
|
||||
id="cdt.managedbuild.toolchain.xlc.lib.debug">
|
||||
id="cdt.managedbuild.toolchain.xlc.lib.debug"
|
||||
languageSettingsProviders="org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser;org.eclipse.cdt.managedbuilder.xlc.core.XlcBuiltinSpecsDetector"
|
||||
name="%ToolChainName.Dbg"
|
||||
targetTool="cdt.managedbuild.tool.xlc.archiver.lib.debug">
|
||||
<targetPlatform
|
||||
id="cdt.managedbuild.target.xlc.platform.lib.debug"
|
||||
name="%PlatformName.Dbg"
|
||||
|
@ -851,15 +859,17 @@
|
|||
</toolChain>
|
||||
</configuration>
|
||||
<configuration
|
||||
name="%ConfigName.Rel"
|
||||
cleanCommand="rm -rf"
|
||||
artifactExtension="lib"
|
||||
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
|
||||
id="cdt.managedbuild.config.xlc.lib.release">
|
||||
name="%ConfigName.Rel"
|
||||
cleanCommand="rm -rf"
|
||||
artifactExtension="lib"
|
||||
errorParsers="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
|
||||
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
|
||||
name="%ToolChainName.Rel"
|
||||
targetTool="cdt.managedbuild.tool.xlc.archiver.lib.release"
|
||||
id="cdt.managedbuild.toolchain.xlc.lib.release">
|
||||
id="cdt.managedbuild.toolchain.xlc.lib.release"
|
||||
languageSettingsProviders="org.eclipse.cdt.managedbuilder.xlc.core.XlcBuildCommandParser;org.eclipse.cdt.managedbuilder.xlc.core.XlcBuiltinSpecsDetector"
|
||||
name="%ToolChainName.Rel"
|
||||
targetTool="cdt.managedbuild.tool.xlc.archiver.lib.release">
|
||||
<targetPlatform
|
||||
id="cdt.managedbuild.target.xlc.platform.lib.release"
|
||||
name="%PlatformName.Rel"
|
||||
|
@ -3732,7 +3742,6 @@
|
|||
id="cdt.managedbuild.tool.xlc.c.compiler.input"
|
||||
name="%inputType.c.name"
|
||||
primaryInput="true"
|
||||
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"
|
||||
sourceContentType="org.eclipse.cdt.core.cSource"
|
||||
sources="c">
|
||||
</inputType>
|
||||
|
@ -3753,7 +3762,6 @@
|
|||
id="cdt.managedbuild.tool.xlc.cpp.c.compiler.input"
|
||||
name="%inputType.c.name.2"
|
||||
primaryInput="true"
|
||||
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"
|
||||
sourceContentType="org.eclipse.cdt.core.cSource"
|
||||
sources="c">
|
||||
</inputType>
|
||||
|
@ -3763,7 +3771,6 @@
|
|||
id="cdt.managedbuild.tool.xlc.cpp.compiler.input"
|
||||
name="%inputType.cpp.name"
|
||||
primaryInput="true"
|
||||
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"
|
||||
sourceContentType="org.eclipse.cdt.core.cxxSource"
|
||||
sources="c,C,cc,cxx,cpp">
|
||||
</inputType>
|
||||
|
|