1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00
This commit is contained in:
Andrew Gvozdev 2012-05-04 19:53:16 -04:00
parent 56f5df2f68
commit 2949c7da2f
12 changed files with 2615 additions and 2613 deletions

View file

@ -307,9 +307,9 @@
fileVersion="4.0.0">
</managedBuildRevision>
<configuration
id="org.eclipse.cdt.build.core.emptycfg"
id="org.eclipse.cdt.build.core.emptycfg"
languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;${Toolchain}"
name="%cfg1_empty">
name="%cfg1_empty">
</configuration>
<configuration

View file

@ -161,6 +161,7 @@ public class CfgScannerConfigUtil {
if (toolchain!=null) {
String toolchainProfileId = null;
if (toolchain instanceof ToolChain) {
// still allow a user a choice to select any legacy profiles
toolchainProfileId = ((ToolChain) toolchain).getLegacyScannerConfigDiscoveryProfileId();
} else {
toolchainProfileId = toolchain.getScannerConfigDiscoveryProfileId();

View file

@ -47,7 +47,7 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
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 LANGUAGE_SETTINGS_PROVIDERS = "languageSettingsProviders"; //$NON-NLS-1$
public static final String EXTENSION = "artifactExtension"; //$NON-NLS-1$
public static final String PARENT = "parent"; //$NON-NLS-1$

View file

@ -54,7 +54,7 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
public static final String SCANNER_CONFIG_PROFILE_ID = "scannerConfigDiscoveryProfileId"; //$NON-NLS-1$
/** @since 8.1 */
public static final String LANGUAGE_SETTINGS_PROVIDERS = "languageSettingsProviders";
public static final String LANGUAGE_SETTINGS_PROVIDERS = "languageSettingsProviders"; //$NON-NLS-1$
/**
* Returns the configuration that is the parent of this tool-chain.

View file

@ -786,7 +786,7 @@ 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
// Get the initial/default language settings providers IDs
defaultLanguageSettingsProvidersAttribute = SafeStringInterner.safeIntern(element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS));
// Get the artifact extension

View file

@ -1842,9 +1842,9 @@ public class InputType extends BuildObject implements IInputType {
}
/**
* Temporary method to support compatibility during SD transition.
* Check if legacy scanner discovery method should be used.
*/
private boolean isLanguageSettingsProvidersFunctionalityEnabled() {
private boolean isLegacyScannerDiscovery() {
boolean isLanguageSettingsProvidersEnabled = false;
ITool tool = getParent();
if (tool!=null) {
@ -1860,14 +1860,14 @@ public class InputType extends BuildObject implements IInputType {
}
}
}
return isLanguageSettingsProvidersEnabled;
return !isLanguageSettingsProvidersEnabled;
}
/**
* Temporary method to support compatibility during SD transition.
* @noreference This method is not intended to be referenced by clients.
*/
public String getLegacyDiscoveryProfileIdAttribute(){
public String getLegacyDiscoveryProfileIdAttribute() {
String profileId = buildInfoDicsoveryProfileId;
if (profileId == null) {
profileId = ScannerDiscoveryLegacySupport.getDeprecatedLegacyProfiles(id);
@ -1878,19 +1878,21 @@ public class InputType extends BuildObject implements IInputType {
return profileId;
}
public String getDiscoveryProfileIdAttribute(){
if (!isLanguageSettingsProvidersFunctionalityEnabled())
public String getDiscoveryProfileIdAttribute() {
if (isLegacyScannerDiscovery()) {
return getLegacyDiscoveryProfileIdAttribute();
}
return getDiscoveryProfileIdAttributeInternal();
}
/**
* Method extracted temporarily to support compatibility during SD transition.
* Do not inline! This method needs to call itself recursively.
*/
private String getDiscoveryProfileIdAttributeInternal(){
if(buildInfoDicsoveryProfileId == null && superClass instanceof InputType)
private String getDiscoveryProfileIdAttributeInternal() {
if (buildInfoDicsoveryProfileId == null && superClass instanceof InputType) {
return ((InputType)superClass).getDiscoveryProfileIdAttributeInternal();
}
return buildInfoDicsoveryProfileId;
}

View file

@ -442,7 +442,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
@Override
public String[] getDefaultLanguageSettingsProviderIds() {
ManagedBuilderCorePlugin.error("Default Language Settings Providers are not supported in multiconfiguration mode");
ManagedBuilderCorePlugin.error("Default Language Settings Providers are not supported in multiconfiguration mode"); //$NON-NLS-1$
return null;
}

View file

@ -558,7 +558,7 @@ 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
// Get the initial/default language settings providers IDs
defaultLanguageSettingsProviderIds = element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS);
// Get the scanner config discovery profile id
@ -1545,9 +1545,9 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
/**
* Temporary method to support compatibility during SD transition.
* Check if legacy scanner discovery method should be used.
*/
private boolean isLanguageSettingsProvidersFunctionalityEnabled() {
private boolean isLegacyScannerDiscovery() {
boolean isLanguageSettingsProvidersEnabled = false;
IConfiguration cfg = getParent();
if (cfg != null) {
@ -1557,11 +1557,11 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
isLanguageSettingsProvidersEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
}
}
return isLanguageSettingsProvidersEnabled;
return !isLanguageSettingsProvidersEnabled;
}
/**
* Temporary method to support compatibility during SD transition.
* Get list of scanner discovery profiles supported by previous version.
* @see ScannerDiscoveryLegacySupport#getDeprecatedLegacyProfiles(String)
*
* @noreference This method is not intended to be referenced by clients.
@ -1580,21 +1580,17 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
return profileId;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#getScannerConfigDiscoveryProfileId()
*/
@Override
public String getScannerConfigDiscoveryProfileId() {
if (!isLanguageSettingsProvidersFunctionalityEnabled())
if (isLegacyScannerDiscovery()) {
return getLegacyScannerConfigDiscoveryProfileId();
}
return getScannerConfigDiscoveryProfileIdInternal();
}
/**
* Method extracted temporarily to support compatibility during SD transition.
* Do not inline! This method needs to call itself recursively.
*/
private String getScannerConfigDiscoveryProfileIdInternal() {
if (scannerConfigDiscoveryProfileId == null && superClass instanceof ToolChain) {

View file

@ -100,8 +100,8 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
String bPath = b.getDefaultBuildPath();
b.setBuildPathAttribute(bPath);
}
// cfg.setConfigurationDescription(des);
// ManagedBuildManager.performValueHandlerEvent(cfg, IManagedOptionValueHandler.EVENT_APPLY);
// cfg.setConfigurationDescription(des);
// ManagedBuildManager.performValueHandlerEvent(cfg, IManagedOptionValueHandler.EVENT_APPLY);
cfg.serialize(cfgElemen);
return appliedCfg;
@ -129,7 +129,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
CConfigurationData base,
IModificationContext context,
IProgressMonitor monitor)
throws CoreException {
throws CoreException {
if(cfgDescription.isPreferenceConfiguration())
return applyPreferences(cfgDescription, base);
@ -178,14 +178,14 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
protected CConfigurationData createPreferences(
ICConfigurationDescription cfgDescription, CConfigurationData base)
throws CoreException {
throws CoreException {
Configuration cfg = (Configuration)((BuildConfigurationData)base).getConfiguration();
Configuration newCfg = new Configuration((ManagedProject)cfg.getManagedProject(), cfg, cfgDescription.getId(), true, true, true);
newCfg.setConfigurationDescription(cfgDescription);
newCfg.setName(cfgDescription.getName());
// if(!newCfg.getId().equals(cfg.getId())){
// newCfg.exportArtifactInfo();
// }
// if(!newCfg.getId().equals(cfg.getId())){
// newCfg.exportArtifactInfo();
// }
return newCfg.getConfigurationData();
}
@ -197,7 +197,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
ICConfigurationDescription baseCfgDescription,
CConfigurationData base, boolean clone,
IProgressMonitor monitor)
throws CoreException {
throws CoreException {
if(cfgDescription.isPreferenceConfiguration())
return createPreferences(cfgDescription, base);
@ -229,9 +229,9 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
ManagedBuildManager.performValueHandlerEvent(newCfg, IManagedOptionValueHandler.EVENT_OPEN);
// if(!newCfg.getId().equals(cfg.getId())){
// newCfg.exportArtifactInfo();
// }
// if(!newCfg.getId().equals(cfg.getId())){
// newCfg.exportArtifactInfo();
// }
return newCfg;
}
@ -337,7 +337,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
}
protected CConfigurationData loadPreferences(ICConfigurationDescription cfgDescription)
throws CoreException {
throws CoreException {
Configuration cfg = load(cfgDescription, null, true);
@ -496,7 +496,9 @@ 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);

View file

@ -1702,10 +1702,10 @@
</builder>
<toolChain
archList="all"
archList="all"
id="cdt.managedbuild.toolchain.gnu.base"
languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
name="%ToolChainName.Linux"
name="%ToolChainName.Linux"
osList="linux,hpux,aix,qnx"
targetTool="cdt.managedbuild.tool.gnu.c.linker;cdt.managedbuild.tool.gnu.cpp.linker;cdt.managedbuild.tool.gnu.archiver">
<targetPlatform
@ -2481,27 +2481,27 @@
</projectType>
<configuration
artifactExtension="exe"
artifactExtension="exe"
cleanCommand="rm -rf"
id="cdt.managedbuild.config.gnu.cygwin.base"
languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser">
<enablement type="CONTAINER_ATTRIBUTE"
attribute="artifactExtension"
value="dll"
extensionAdjustment="false">
<checkBuildProperty
property="org.eclipse.cdt.build.core.buildArtefactType"
value="org.eclipse.cdt.build.core.buildArtefactType.sharedLib"/>
</enablement>
<enablement type="CONTAINER_ATTRIBUTE"
attribute="artifactExtension"
value="a"
extensionAdjustment="false">
<checkBuildProperty
property="org.eclipse.cdt.build.core.buildArtefactType"
value="org.eclipse.cdt.build.core.buildArtefactType.staticLib"/>
</enablement>
</configuration>
<enablement type="CONTAINER_ATTRIBUTE"
attribute="artifactExtension"
value="dll"
extensionAdjustment="false">
<checkBuildProperty
property="org.eclipse.cdt.build.core.buildArtefactType"
value="org.eclipse.cdt.build.core.buildArtefactType.sharedLib"/>
</enablement>
<enablement type="CONTAINER_ATTRIBUTE"
attribute="artifactExtension"
value="a"
extensionAdjustment="false">
<checkBuildProperty
property="org.eclipse.cdt.build.core.buildArtefactType"
value="org.eclipse.cdt.build.core.buildArtefactType.staticLib"/>
</enablement>
</configuration>
<projectType
buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe"
@ -2879,7 +2879,7 @@
</projectType>
<configuration
artifactExtension="exe"
artifactExtension="exe"
cleanCommand="rm -rf"
id="cdt.managedbuild.config.gnu.mingw.base"
languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser">

View file

@ -263,18 +263,16 @@ public class CDTPrefUtil {
private static final Object[] getListForDisplay(Object[][] input, int mode, Comparator<Object> cmp) {
if (input == null || input.length == 0)
return EMPTY_ARRAY;
if (input.length == 1) {
return (input[0] == null) ?
EMPTY_ARRAY :
input[0];
return (input[0] == null) ? EMPTY_ARRAY : input[0];
}
Object[] s1 = input[0];
if (s1 == null ||
s1.length == 0)
if (s1 == null || s1.length == 0)
return EMPTY_ARRAY;
if (getMultiCfgStringListDisplayMode() == DMODE_CONJUNCTION)
{
if (getMultiCfgStringListDisplayMode() == DMODE_CONJUNCTION) {
ArrayList<Object> lst = new ArrayList<Object>();
for (int i=0; i<s1.length; i++) {
if (s1[i] == null)
@ -282,10 +280,12 @@ public class CDTPrefUtil {
boolean found = true;
for (int k = 1; k<input.length; k++) {
Object[] s2 = input[k];
if (s2 == null || s2.length == 0)
if (s2 == null || s2.length == 0) {
return EMPTY_ARRAY;
if (i == 0)
}
if (i == 0) {
Arrays.sort(s2, cmp);
}
if (Arrays.binarySearch(s2, s1[i], cmp) < 0) {
found = false;
break;
@ -299,11 +299,12 @@ public class CDTPrefUtil {
}
TreeSet<Object> lst = new TreeSet<Object>(cmp); // set, to avoid doubles
for (Object[] element : input) {
if (element == null ||
element.length == 0)
if (element == null || element.length == 0) {
continue;
for (Object element2 : element)
}
for (Object element2 : element) {
lst.add(element2);
}
}
s1 = lst.toArray();
Arrays.sort(s1, cmp);