mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
Clean up
This commit is contained in:
parent
56f5df2f68
commit
2949c7da2f
12 changed files with 2615 additions and 2613 deletions
|
@ -307,9 +307,9 @@
|
||||||
fileVersion="4.0.0">
|
fileVersion="4.0.0">
|
||||||
</managedBuildRevision>
|
</managedBuildRevision>
|
||||||
<configuration
|
<configuration
|
||||||
id="org.eclipse.cdt.build.core.emptycfg"
|
id="org.eclipse.cdt.build.core.emptycfg"
|
||||||
languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;${Toolchain}"
|
languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;${Toolchain}"
|
||||||
name="%cfg1_empty">
|
name="%cfg1_empty">
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
||||||
<configuration
|
<configuration
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -38,7 +38,7 @@ public class CfgScannerConfigUtil {
|
||||||
IInputType inType = context.getInputType();
|
IInputType inType = context.getInputType();
|
||||||
boolean adjust = false;
|
boolean adjust = false;
|
||||||
CfgInfoContext newContext = context;
|
CfgInfoContext newContext = context;
|
||||||
|
|
||||||
if(tool != null){
|
if(tool != null){
|
||||||
if(inType != null){
|
if(inType != null){
|
||||||
if(!tool.hasScannerConfigSettings(inType)){
|
if(!tool.hasScannerConfigSettings(inType)){
|
||||||
|
@ -59,10 +59,10 @@ public class CfgScannerConfigUtil {
|
||||||
inType = null;
|
inType = null;
|
||||||
adjust = true;
|
adjust = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(rcInfo != null){
|
if(rcInfo != null){
|
||||||
ToolChain tc = getToolChain(rcInfo);
|
ToolChain tc = getToolChain(rcInfo);
|
||||||
|
|
||||||
if(tc != null){
|
if(tc != null){
|
||||||
if(!tc.hasScannerConfigSettings()){
|
if(!tc.hasScannerConfigSettings()){
|
||||||
adjust = true;
|
adjust = true;
|
||||||
|
@ -85,23 +85,23 @@ public class CfgScannerConfigUtil {
|
||||||
// adjust = true;
|
// adjust = true;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if(adjust){
|
if(adjust){
|
||||||
if(rcInfo == null)
|
if(rcInfo == null)
|
||||||
newContext = new CfgInfoContext(context.getConfiguration());
|
newContext = new CfgInfoContext(context.getConfiguration());
|
||||||
else
|
else
|
||||||
newContext = new CfgInfoContext(rcInfo, tool, inType);
|
newContext = new CfgInfoContext(rcInfo, tool, inType);
|
||||||
}
|
}
|
||||||
|
|
||||||
return newContext;
|
return newContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ToolChain getToolChain(IResourceInfo rcInfo){
|
private static ToolChain getToolChain(IResourceInfo rcInfo){
|
||||||
return rcInfo instanceof FolderInfo ?
|
return rcInfo instanceof FolderInfo ?
|
||||||
(ToolChain)((FolderInfo)rcInfo).getToolChain()
|
(ToolChain)((FolderInfo)rcInfo).getToolChain()
|
||||||
: (ToolChain)((ResourceConfiguration)rcInfo).getBaseToolChain();
|
: (ToolChain)((ResourceConfiguration)rcInfo).getBaseToolChain();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getDefaultProfileId(CfgInfoContext context, boolean searchFirstIfNone){
|
public static String getDefaultProfileId(CfgInfoContext context, boolean searchFirstIfNone){
|
||||||
String id = null;
|
String id = null;
|
||||||
if(context.getInputType() != null)
|
if(context.getInputType() != null)
|
||||||
|
@ -116,19 +116,19 @@ public class CfgScannerConfigUtil {
|
||||||
if(id == null){
|
if(id == null){
|
||||||
id = ((Configuration)context.getConfiguration()).getDiscoveryProfileId();
|
id = ((Configuration)context.getConfiguration()).getDiscoveryProfileId();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(id == null && searchFirstIfNone){
|
if(id == null && searchFirstIfNone){
|
||||||
id = getFirstProfileId(context.getConfiguration().getFilteredTools());
|
id = getFirstProfileId(context.getConfiguration().getFilteredTools());
|
||||||
}
|
}
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFirstProfileId(ITool[] tools){
|
public static String getFirstProfileId(ITool[] tools){
|
||||||
String id = null;
|
String id = null;
|
||||||
for(int i = 0; i < tools.length; i++){
|
for(int i = 0; i < tools.length; i++){
|
||||||
ITool tool = tools[i];
|
ITool tool = tools[i];
|
||||||
IInputType[] types = tool.getInputTypes();
|
IInputType[] types = tool.getInputTypes();
|
||||||
|
|
||||||
if(types.length != 0){
|
if(types.length != 0){
|
||||||
for(int k = 0; k < types.length; k++){
|
for(int k = 0; k < types.length; k++){
|
||||||
id = types[k].getDiscoveryProfileId(tool);
|
id = types[k].getDiscoveryProfileId(tool);
|
||||||
|
@ -142,25 +142,26 @@ public class CfgScannerConfigUtil {
|
||||||
if(id != null)
|
if(id != null)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search for toolchain's discovery profiles. Discovery profiles could be
|
* Search for toolchain's discovery profiles. Discovery profiles could be
|
||||||
* specified on toolchain level, input types level or in their super-classes.
|
* specified on toolchain level, input types level or in their super-classes.
|
||||||
*
|
*
|
||||||
* @param toolchain - toolchain to search for scanner discovery profiles.
|
* @param toolchain - toolchain to search for scanner discovery profiles.
|
||||||
* @return all available discovery profiles in given toolchain
|
* @return all available discovery profiles in given toolchain
|
||||||
*/
|
*/
|
||||||
public static Set<String> getAllScannerDiscoveryProfileIds(IToolChain toolchain) {
|
public static Set<String> getAllScannerDiscoveryProfileIds(IToolChain toolchain) {
|
||||||
Assert.isNotNull(toolchain);
|
Assert.isNotNull(toolchain);
|
||||||
|
|
||||||
Set<String> profiles = new TreeSet<String>();
|
Set<String> profiles = new TreeSet<String>();
|
||||||
|
|
||||||
if (toolchain!=null) {
|
if (toolchain!=null) {
|
||||||
String toolchainProfileId = null;
|
String toolchainProfileId = null;
|
||||||
if (toolchain instanceof ToolChain) {
|
if (toolchain instanceof ToolChain) {
|
||||||
|
// still allow a user a choice to select any legacy profiles
|
||||||
toolchainProfileId = ((ToolChain) toolchain).getLegacyScannerConfigDiscoveryProfileId();
|
toolchainProfileId = ((ToolChain) toolchain).getLegacyScannerConfigDiscoveryProfileId();
|
||||||
} else {
|
} else {
|
||||||
toolchainProfileId = toolchain.getScannerConfigDiscoveryProfileId();
|
toolchainProfileId = toolchain.getScannerConfigDiscoveryProfileId();
|
||||||
|
@ -177,15 +178,15 @@ public class CfgScannerConfigUtil {
|
||||||
profiles.addAll(getAllScannerDiscoveryProfileIds(superClass));
|
profiles.addAll(getAllScannerDiscoveryProfileIds(superClass));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return profiles;
|
return profiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search for tool's discovery profiles. Discovery profiles could be retrieved
|
* Search for tool's discovery profiles. Discovery profiles could be retrieved
|
||||||
* from tool/input type super-class. Input type could hold list of profiles
|
* from tool/input type super-class. Input type could hold list of profiles
|
||||||
* separated by pipe character '|'.
|
* separated by pipe character '|'.
|
||||||
*
|
*
|
||||||
* @param tool - tool to search for scanner discovery profiles
|
* @param tool - tool to search for scanner discovery profiles
|
||||||
* @return all available discovery profiles in given configuration
|
* @return all available discovery profiles in given configuration
|
||||||
*/
|
*/
|
||||||
|
@ -197,39 +198,39 @@ public class CfgScannerConfigUtil {
|
||||||
new Object[] { Tool.class.getName() });
|
new Object[] { Tool.class.getName() });
|
||||||
throw new UnsupportedOperationException(msg);
|
throw new UnsupportedOperationException(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<String> profiles = new TreeSet<String>();
|
Set<String> profiles = new TreeSet<String>();
|
||||||
|
|
||||||
for (IInputType inputType : ((Tool) tool).getAllInputTypes()) {
|
for (IInputType inputType : ((Tool) tool).getAllInputTypes()) {
|
||||||
for (String profileId : getAllScannerDiscoveryProfileIds(inputType)) {
|
for (String profileId : getAllScannerDiscoveryProfileIds(inputType)) {
|
||||||
profiles.add(profileId);
|
profiles.add(profileId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ITool superClass = tool.getSuperClass();
|
ITool superClass = tool.getSuperClass();
|
||||||
if (superClass!=null) {
|
if (superClass!=null) {
|
||||||
profiles.addAll(getAllScannerDiscoveryProfileIds(superClass));
|
profiles.addAll(getAllScannerDiscoveryProfileIds(superClass));
|
||||||
}
|
}
|
||||||
return profiles;
|
return profiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search for input type's discovery profiles. Discovery profiles could be specified
|
* Search for input type's discovery profiles. Discovery profiles could be specified
|
||||||
* on input type super-class. Input type could hold list of profiles
|
* on input type super-class. Input type could hold list of profiles
|
||||||
* separated by pipe character '|'.
|
* separated by pipe character '|'.
|
||||||
*
|
*
|
||||||
* @param inputType - input type to search for scanner discovery profiles
|
* @param inputType - input type to search for scanner discovery profiles
|
||||||
* @return all available discovery profiles in given configuration
|
* @return all available discovery profiles in given configuration
|
||||||
*/
|
*/
|
||||||
private static Set<String> getAllScannerDiscoveryProfileIds(IInputType inputType) {
|
private static Set<String> getAllScannerDiscoveryProfileIds(IInputType inputType) {
|
||||||
Assert.isNotNull(inputType);
|
Assert.isNotNull(inputType);
|
||||||
|
|
||||||
if ( ! (inputType instanceof InputType) ) {
|
if ( ! (inputType instanceof InputType) ) {
|
||||||
String msg = MessageFormat.format(ManagedMakeMessages.getString("CfgScannerConfigUtil_ErrorNotSupported"), //$NON-NLS-1$
|
String msg = MessageFormat.format(ManagedMakeMessages.getString("CfgScannerConfigUtil_ErrorNotSupported"), //$NON-NLS-1$
|
||||||
new Object[] { InputType.class.getName() });
|
new Object[] { InputType.class.getName() });
|
||||||
throw new UnsupportedOperationException(msg);
|
throw new UnsupportedOperationException(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<String> profiles = new TreeSet<String>();
|
Set<String> profiles = new TreeSet<String>();
|
||||||
|
|
||||||
String attribute = ((InputType) inputType).getLegacyDiscoveryProfileIdAttribute();
|
String attribute = ((InputType) inputType).getLegacyDiscoveryProfileIdAttribute();
|
||||||
|
|
|
@ -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 CONFIGURATION_ELEMENT_NAME = "configuration"; //$NON-NLS-1$
|
||||||
public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$
|
public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$
|
||||||
/** @since 8.1 */
|
/** @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 EXTENSION = "artifactExtension"; //$NON-NLS-1$
|
||||||
public static final String PARENT = "parent"; //$NON-NLS-1$
|
public static final String PARENT = "parent"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
||||||
public static final String SCANNER_CONFIG_PROFILE_ID = "scannerConfigDiscoveryProfileId"; //$NON-NLS-1$
|
public static final String SCANNER_CONFIG_PROFILE_ID = "scannerConfigDiscoveryProfileId"; //$NON-NLS-1$
|
||||||
|
|
||||||
/** @since 8.1 */
|
/** @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.
|
* Returns the configuration that is the parent of this tool-chain.
|
||||||
|
|
|
@ -786,7 +786,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
// Get the semicolon separated list of IDs of the error parsers
|
// Get the semicolon separated list of IDs of the error parsers
|
||||||
errorParserIds = SafeStringInterner.safeIntern(element.getAttribute(ERROR_PARSERS));
|
errorParserIds = SafeStringInterner.safeIntern(element.getAttribute(ERROR_PARSERS));
|
||||||
|
|
||||||
// Get the initial/default language setttings providers IDs
|
// Get the initial/default language settings providers IDs
|
||||||
defaultLanguageSettingsProvidersAttribute = SafeStringInterner.safeIntern(element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS));
|
defaultLanguageSettingsProvidersAttribute = SafeStringInterner.safeIntern(element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS));
|
||||||
|
|
||||||
// Get the artifact extension
|
// Get the artifact extension
|
||||||
|
@ -1475,7 +1475,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*
|
*
|
||||||
* This function will try to find default provider Ids specified in this instance.
|
* This function will try to find default provider Ids specified in this instance.
|
||||||
* It none defined, it will try to pull Ids from the parent configuration.
|
* It none defined, it will try to pull Ids from the parent configuration.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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;
|
boolean isLanguageSettingsProvidersEnabled = false;
|
||||||
ITool tool = getParent();
|
ITool tool = getParent();
|
||||||
if (tool!=null) {
|
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.
|
* Temporary method to support compatibility during SD transition.
|
||||||
* @noreference This method is not intended to be referenced by clients.
|
* @noreference This method is not intended to be referenced by clients.
|
||||||
*/
|
*/
|
||||||
public String getLegacyDiscoveryProfileIdAttribute(){
|
public String getLegacyDiscoveryProfileIdAttribute() {
|
||||||
String profileId = buildInfoDicsoveryProfileId;
|
String profileId = buildInfoDicsoveryProfileId;
|
||||||
if (profileId == null) {
|
if (profileId == null) {
|
||||||
profileId = ScannerDiscoveryLegacySupport.getDeprecatedLegacyProfiles(id);
|
profileId = ScannerDiscoveryLegacySupport.getDeprecatedLegacyProfiles(id);
|
||||||
|
@ -1878,19 +1878,21 @@ public class InputType extends BuildObject implements IInputType {
|
||||||
return profileId;
|
return profileId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDiscoveryProfileIdAttribute(){
|
public String getDiscoveryProfileIdAttribute() {
|
||||||
if (!isLanguageSettingsProvidersFunctionalityEnabled())
|
if (isLegacyScannerDiscovery()) {
|
||||||
return getLegacyDiscoveryProfileIdAttribute();
|
return getLegacyDiscoveryProfileIdAttribute();
|
||||||
|
}
|
||||||
|
|
||||||
return getDiscoveryProfileIdAttributeInternal();
|
return getDiscoveryProfileIdAttributeInternal();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method extracted temporarily to support compatibility during SD transition.
|
* Do not inline! This method needs to call itself recursively.
|
||||||
*/
|
*/
|
||||||
private String getDiscoveryProfileIdAttributeInternal(){
|
private String getDiscoveryProfileIdAttributeInternal() {
|
||||||
if(buildInfoDicsoveryProfileId == null && superClass instanceof InputType)
|
if (buildInfoDicsoveryProfileId == null && superClass instanceof InputType) {
|
||||||
return ((InputType)superClass).getDiscoveryProfileIdAttributeInternal();
|
return ((InputType)superClass).getDiscoveryProfileIdAttributeInternal();
|
||||||
|
}
|
||||||
return buildInfoDicsoveryProfileId;
|
return buildInfoDicsoveryProfileId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -442,7 +442,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getDefaultLanguageSettingsProviderIds() {
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -558,7 +558,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
||||||
// Get the target tool id
|
// Get the target tool id
|
||||||
targetToolIds = SafeStringInterner.safeIntern(element.getAttribute(TARGET_TOOL));
|
targetToolIds = SafeStringInterner.safeIntern(element.getAttribute(TARGET_TOOL));
|
||||||
|
|
||||||
// Get the initial/default language setttings providers IDs
|
// Get the initial/default language settings providers IDs
|
||||||
defaultLanguageSettingsProviderIds = element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS);
|
defaultLanguageSettingsProviderIds = element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS);
|
||||||
|
|
||||||
// Get the scanner config discovery profile id
|
// 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;
|
boolean isLanguageSettingsProvidersEnabled = false;
|
||||||
IConfiguration cfg = getParent();
|
IConfiguration cfg = getParent();
|
||||||
if (cfg != null) {
|
if (cfg != null) {
|
||||||
|
@ -1557,13 +1557,13 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
||||||
isLanguageSettingsProvidersEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
|
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)
|
* @see ScannerDiscoveryLegacySupport#getDeprecatedLegacyProfiles(String)
|
||||||
*
|
*
|
||||||
* @noreference This method is not intended to be referenced by clients.
|
* @noreference This method is not intended to be referenced by clients.
|
||||||
*/
|
*/
|
||||||
public String getLegacyScannerConfigDiscoveryProfileId() {
|
public String getLegacyScannerConfigDiscoveryProfileId() {
|
||||||
|
@ -1580,21 +1580,17 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
||||||
return profileId;
|
return profileId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#getScannerConfigDiscoveryProfileId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String getScannerConfigDiscoveryProfileId() {
|
public String getScannerConfigDiscoveryProfileId() {
|
||||||
if (!isLanguageSettingsProvidersFunctionalityEnabled())
|
if (isLegacyScannerDiscovery()) {
|
||||||
return getLegacyScannerConfigDiscoveryProfileId();
|
return getLegacyScannerConfigDiscoveryProfileId();
|
||||||
|
}
|
||||||
|
|
||||||
return getScannerConfigDiscoveryProfileIdInternal();
|
return getScannerConfigDiscoveryProfileIdInternal();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method extracted temporarily to support compatibility during SD transition.
|
* Do not inline! This method needs to call itself recursively.
|
||||||
*/
|
*/
|
||||||
private String getScannerConfigDiscoveryProfileIdInternal() {
|
private String getScannerConfigDiscoveryProfileIdInternal() {
|
||||||
if (scannerConfigDiscoveryProfileId == null && superClass instanceof ToolChain) {
|
if (scannerConfigDiscoveryProfileId == null && superClass instanceof ToolChain) {
|
||||||
|
|
|
@ -100,8 +100,8 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
String bPath = b.getDefaultBuildPath();
|
String bPath = b.getDefaultBuildPath();
|
||||||
b.setBuildPathAttribute(bPath);
|
b.setBuildPathAttribute(bPath);
|
||||||
}
|
}
|
||||||
// cfg.setConfigurationDescription(des);
|
// cfg.setConfigurationDescription(des);
|
||||||
// ManagedBuildManager.performValueHandlerEvent(cfg, IManagedOptionValueHandler.EVENT_APPLY);
|
// ManagedBuildManager.performValueHandlerEvent(cfg, IManagedOptionValueHandler.EVENT_APPLY);
|
||||||
cfg.serialize(cfgElemen);
|
cfg.serialize(cfgElemen);
|
||||||
|
|
||||||
return appliedCfg;
|
return appliedCfg;
|
||||||
|
@ -129,7 +129,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
CConfigurationData base,
|
CConfigurationData base,
|
||||||
IModificationContext context,
|
IModificationContext context,
|
||||||
IProgressMonitor monitor)
|
IProgressMonitor monitor)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
if(cfgDescription.isPreferenceConfiguration())
|
if(cfgDescription.isPreferenceConfiguration())
|
||||||
return applyPreferences(cfgDescription, base);
|
return applyPreferences(cfgDescription, base);
|
||||||
|
|
||||||
|
@ -178,14 +178,14 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
|
|
||||||
protected CConfigurationData createPreferences(
|
protected CConfigurationData createPreferences(
|
||||||
ICConfigurationDescription cfgDescription, CConfigurationData base)
|
ICConfigurationDescription cfgDescription, CConfigurationData base)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
Configuration cfg = (Configuration)((BuildConfigurationData)base).getConfiguration();
|
Configuration cfg = (Configuration)((BuildConfigurationData)base).getConfiguration();
|
||||||
Configuration newCfg = new Configuration((ManagedProject)cfg.getManagedProject(), cfg, cfgDescription.getId(), true, true, true);
|
Configuration newCfg = new Configuration((ManagedProject)cfg.getManagedProject(), cfg, cfgDescription.getId(), true, true, true);
|
||||||
newCfg.setConfigurationDescription(cfgDescription);
|
newCfg.setConfigurationDescription(cfgDescription);
|
||||||
newCfg.setName(cfgDescription.getName());
|
newCfg.setName(cfgDescription.getName());
|
||||||
// if(!newCfg.getId().equals(cfg.getId())){
|
// if(!newCfg.getId().equals(cfg.getId())){
|
||||||
// newCfg.exportArtifactInfo();
|
// newCfg.exportArtifactInfo();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
return newCfg.getConfigurationData();
|
return newCfg.getConfigurationData();
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
ICConfigurationDescription baseCfgDescription,
|
ICConfigurationDescription baseCfgDescription,
|
||||||
CConfigurationData base, boolean clone,
|
CConfigurationData base, boolean clone,
|
||||||
IProgressMonitor monitor)
|
IProgressMonitor monitor)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
if(cfgDescription.isPreferenceConfiguration())
|
if(cfgDescription.isPreferenceConfiguration())
|
||||||
return createPreferences(cfgDescription, base);
|
return createPreferences(cfgDescription, base);
|
||||||
|
|
||||||
|
@ -229,9 +229,9 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
|
|
||||||
ManagedBuildManager.performValueHandlerEvent(newCfg, IManagedOptionValueHandler.EVENT_OPEN);
|
ManagedBuildManager.performValueHandlerEvent(newCfg, IManagedOptionValueHandler.EVENT_OPEN);
|
||||||
|
|
||||||
// if(!newCfg.getId().equals(cfg.getId())){
|
// if(!newCfg.getId().equals(cfg.getId())){
|
||||||
// newCfg.exportArtifactInfo();
|
// newCfg.exportArtifactInfo();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
return newCfg;
|
return newCfg;
|
||||||
}
|
}
|
||||||
|
@ -337,7 +337,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CConfigurationData loadPreferences(ICConfigurationDescription cfgDescription)
|
protected CConfigurationData loadPreferences(ICConfigurationDescription cfgDescription)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
|
|
||||||
Configuration cfg = load(cfgDescription, null, true);
|
Configuration cfg = load(cfgDescription, null, true);
|
||||||
|
|
||||||
|
@ -496,7 +496,9 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CConfigurationData loadConfiguration(ICConfigurationDescription cfgDescription, IProgressMonitor monitor) throws CoreException {
|
public CConfigurationData loadConfiguration(ICConfigurationDescription cfgDescription,
|
||||||
|
IProgressMonitor monitor)
|
||||||
|
throws CoreException {
|
||||||
if(cfgDescription.isPreferenceConfiguration())
|
if(cfgDescription.isPreferenceConfiguration())
|
||||||
return loadPreferences(cfgDescription);
|
return loadPreferences(cfgDescription);
|
||||||
|
|
||||||
|
|
|
@ -1702,10 +1702,10 @@
|
||||||
</builder>
|
</builder>
|
||||||
|
|
||||||
<toolChain
|
<toolChain
|
||||||
archList="all"
|
archList="all"
|
||||||
id="cdt.managedbuild.toolchain.gnu.base"
|
id="cdt.managedbuild.toolchain.gnu.base"
|
||||||
languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
|
languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
|
||||||
name="%ToolChainName.Linux"
|
name="%ToolChainName.Linux"
|
||||||
osList="linux,hpux,aix,qnx"
|
osList="linux,hpux,aix,qnx"
|
||||||
targetTool="cdt.managedbuild.tool.gnu.c.linker;cdt.managedbuild.tool.gnu.cpp.linker;cdt.managedbuild.tool.gnu.archiver">
|
targetTool="cdt.managedbuild.tool.gnu.c.linker;cdt.managedbuild.tool.gnu.cpp.linker;cdt.managedbuild.tool.gnu.archiver">
|
||||||
<targetPlatform
|
<targetPlatform
|
||||||
|
@ -2481,27 +2481,27 @@
|
||||||
</projectType>
|
</projectType>
|
||||||
|
|
||||||
<configuration
|
<configuration
|
||||||
artifactExtension="exe"
|
artifactExtension="exe"
|
||||||
cleanCommand="rm -rf"
|
cleanCommand="rm -rf"
|
||||||
id="cdt.managedbuild.config.gnu.cygwin.base"
|
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">
|
languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser">
|
||||||
<enablement type="CONTAINER_ATTRIBUTE"
|
<enablement type="CONTAINER_ATTRIBUTE"
|
||||||
attribute="artifactExtension"
|
attribute="artifactExtension"
|
||||||
value="dll"
|
value="dll"
|
||||||
extensionAdjustment="false">
|
extensionAdjustment="false">
|
||||||
<checkBuildProperty
|
<checkBuildProperty
|
||||||
property="org.eclipse.cdt.build.core.buildArtefactType"
|
property="org.eclipse.cdt.build.core.buildArtefactType"
|
||||||
value="org.eclipse.cdt.build.core.buildArtefactType.sharedLib"/>
|
value="org.eclipse.cdt.build.core.buildArtefactType.sharedLib"/>
|
||||||
</enablement>
|
</enablement>
|
||||||
<enablement type="CONTAINER_ATTRIBUTE"
|
<enablement type="CONTAINER_ATTRIBUTE"
|
||||||
attribute="artifactExtension"
|
attribute="artifactExtension"
|
||||||
value="a"
|
value="a"
|
||||||
extensionAdjustment="false">
|
extensionAdjustment="false">
|
||||||
<checkBuildProperty
|
<checkBuildProperty
|
||||||
property="org.eclipse.cdt.build.core.buildArtefactType"
|
property="org.eclipse.cdt.build.core.buildArtefactType"
|
||||||
value="org.eclipse.cdt.build.core.buildArtefactType.staticLib"/>
|
value="org.eclipse.cdt.build.core.buildArtefactType.staticLib"/>
|
||||||
</enablement>
|
</enablement>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
||||||
<projectType
|
<projectType
|
||||||
buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe"
|
buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe"
|
||||||
|
@ -2879,7 +2879,7 @@
|
||||||
</projectType>
|
</projectType>
|
||||||
|
|
||||||
<configuration
|
<configuration
|
||||||
artifactExtension="exe"
|
artifactExtension="exe"
|
||||||
cleanCommand="rm -rf"
|
cleanCommand="rm -rf"
|
||||||
id="cdt.managedbuild.config.gnu.mingw.base"
|
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">
|
languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser">
|
||||||
|
|
|
@ -125,10 +125,10 @@ public class CDTPrefUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns string list display mode for multi-configuration edits (conjunction/disjunction).
|
* Returns string list display mode for multi-configuration edits (conjunction/disjunction).
|
||||||
*
|
*
|
||||||
* @return the mode which can be either {@link CDTPrefUtil#DMODE_CONJUNCTION} (default value)
|
* @return the mode which can be either {@link CDTPrefUtil#DMODE_CONJUNCTION} (default value)
|
||||||
* or else {@link CDTPrefUtil#DMODE_DISJUNCTION}.
|
* or else {@link CDTPrefUtil#DMODE_DISJUNCTION}.
|
||||||
*
|
*
|
||||||
* @since 5.3
|
* @since 5.3
|
||||||
*/
|
*/
|
||||||
public static int getMultiCfgStringListDisplayMode() {
|
public static int getMultiCfgStringListDisplayMode() {
|
||||||
|
@ -141,10 +141,10 @@ public class CDTPrefUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets string list display mode for multi-configuration edits (conjunction/disjunction).
|
* Sets string list display mode for multi-configuration edits (conjunction/disjunction).
|
||||||
*
|
*
|
||||||
* @param mode must be either {@link CDTPrefUtil#DMODE_CONJUNCTION}
|
* @param mode must be either {@link CDTPrefUtil#DMODE_CONJUNCTION}
|
||||||
* or {@link CDTPrefUtil#DMODE_DISJUNCTION}.
|
* or {@link CDTPrefUtil#DMODE_DISJUNCTION}.
|
||||||
*
|
*
|
||||||
* @since 5.3
|
* @since 5.3
|
||||||
*/
|
*/
|
||||||
public static void setMultiCfgStringListDisplayMode(int mode) {
|
public static void setMultiCfgStringListDisplayMode(int mode) {
|
||||||
|
@ -153,10 +153,10 @@ public class CDTPrefUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns string list write mode for multi-configuration edits (modify/replace).
|
* Returns string list write mode for multi-configuration edits (modify/replace).
|
||||||
*
|
*
|
||||||
* @return the mode which can be either {@link CDTPrefUtil#WMODE_MODIFY} (default value)
|
* @return the mode which can be either {@link CDTPrefUtil#WMODE_MODIFY} (default value)
|
||||||
* or else {@link CDTPrefUtil#WMODE_REPLACE}.
|
* or else {@link CDTPrefUtil#WMODE_REPLACE}.
|
||||||
*
|
*
|
||||||
* @since 5.3
|
* @since 5.3
|
||||||
*/
|
*/
|
||||||
public static int getMultiCfgStringListWriteMode() {
|
public static int getMultiCfgStringListWriteMode() {
|
||||||
|
@ -169,10 +169,10 @@ public class CDTPrefUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets string list write mode for multi-configuration edits (modify/replace).
|
* Sets string list write mode for multi-configuration edits (modify/replace).
|
||||||
*
|
*
|
||||||
* @param mode must be either {@link CDTPrefUtil#WMODE_MODIFY}
|
* @param mode must be either {@link CDTPrefUtil#WMODE_MODIFY}
|
||||||
* or {@link CDTPrefUtil#WMODE_REPLACE}.
|
* or {@link CDTPrefUtil#WMODE_REPLACE}.
|
||||||
*
|
*
|
||||||
* @since 5.3
|
* @since 5.3
|
||||||
*/
|
*/
|
||||||
public static void setMultiCfgStringListWriteMode(int mode) {
|
public static void setMultiCfgStringListWriteMode(int mode) {
|
||||||
|
@ -256,25 +256,23 @@ public class CDTPrefUtil {
|
||||||
/**
|
/**
|
||||||
* Utility method forms string list
|
* Utility method forms string list
|
||||||
* according to current list display mode
|
* according to current list display mode
|
||||||
*
|
*
|
||||||
* @param input - array of string arrays
|
* @param input - array of string arrays
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private static final Object[] getListForDisplay(Object[][] input, int mode, Comparator<Object> cmp) {
|
private static final Object[] getListForDisplay(Object[][] input, int mode, Comparator<Object> cmp) {
|
||||||
if (input == null || input.length == 0)
|
if (input == null || input.length == 0)
|
||||||
return EMPTY_ARRAY;
|
return EMPTY_ARRAY;
|
||||||
|
|
||||||
if (input.length == 1) {
|
if (input.length == 1) {
|
||||||
return (input[0] == null) ?
|
return (input[0] == null) ? EMPTY_ARRAY : input[0];
|
||||||
EMPTY_ARRAY :
|
|
||||||
input[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] s1 = input[0];
|
Object[] s1 = input[0];
|
||||||
if (s1 == null ||
|
if (s1 == null || s1.length == 0)
|
||||||
s1.length == 0)
|
|
||||||
return EMPTY_ARRAY;
|
return EMPTY_ARRAY;
|
||||||
if (getMultiCfgStringListDisplayMode() == DMODE_CONJUNCTION)
|
|
||||||
{
|
if (getMultiCfgStringListDisplayMode() == DMODE_CONJUNCTION) {
|
||||||
ArrayList<Object> lst = new ArrayList<Object>();
|
ArrayList<Object> lst = new ArrayList<Object>();
|
||||||
for (int i=0; i<s1.length; i++) {
|
for (int i=0; i<s1.length; i++) {
|
||||||
if (s1[i] == null)
|
if (s1[i] == null)
|
||||||
|
@ -282,10 +280,12 @@ public class CDTPrefUtil {
|
||||||
boolean found = true;
|
boolean found = true;
|
||||||
for (int k = 1; k<input.length; k++) {
|
for (int k = 1; k<input.length; k++) {
|
||||||
Object[] s2 = input[k];
|
Object[] s2 = input[k];
|
||||||
if (s2 == null || s2.length == 0)
|
if (s2 == null || s2.length == 0) {
|
||||||
return EMPTY_ARRAY;
|
return EMPTY_ARRAY;
|
||||||
if (i == 0)
|
}
|
||||||
|
if (i == 0) {
|
||||||
Arrays.sort(s2, cmp);
|
Arrays.sort(s2, cmp);
|
||||||
|
}
|
||||||
if (Arrays.binarySearch(s2, s1[i], cmp) < 0) {
|
if (Arrays.binarySearch(s2, s1[i], cmp) < 0) {
|
||||||
found = false;
|
found = false;
|
||||||
break;
|
break;
|
||||||
|
@ -299,11 +299,12 @@ public class CDTPrefUtil {
|
||||||
}
|
}
|
||||||
TreeSet<Object> lst = new TreeSet<Object>(cmp); // set, to avoid doubles
|
TreeSet<Object> lst = new TreeSet<Object>(cmp); // set, to avoid doubles
|
||||||
for (Object[] element : input) {
|
for (Object[] element : input) {
|
||||||
if (element == null ||
|
if (element == null || element.length == 0) {
|
||||||
element.length == 0)
|
|
||||||
continue;
|
continue;
|
||||||
for (Object element2 : element)
|
}
|
||||||
|
for (Object element2 : element) {
|
||||||
lst.add(element2);
|
lst.add(element2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
s1 = lst.toArray();
|
s1 = lst.toArray();
|
||||||
Arrays.sort(s1, cmp);
|
Arrays.sort(s1, cmp);
|
||||||
|
|
Loading…
Add table
Reference in a new issue