mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-18 13:45:45 +02:00
Clean up
This commit is contained in:
parent
95886b4f65
commit
1e208208ed
17 changed files with 2615 additions and 2686 deletions
|
@ -263,7 +263,7 @@ Specifying this attribute is fully equivalent to specifying the "org.eclips
|
||||||
<attribute name="errorParsers" type="string">
|
<attribute name="errorParsers" type="string">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<documentation>
|
||||||
The semi-colon separated list of the default error parsers to be used with this configuration. The list is ordered with the first error parser on the list invoked first, the second error parser second, and so on. The list may contain the error parsers defined by CDT and/or other installed error parser extensions. The list of error parsers to be used may be changed by the user on a per-configuration basis. When specified, this overrides the tool-chain errorParsers attribute.
|
The semi-colon separated list of the default error parsers to be used with this configuration. The list is ordered with the first error parser on the list invoked first, the second error parser second, and so on. The list may contain the error parsers defined by CDT and/or other installed error parser extensions. The list of error parsers to be used may be changed by the user on a per-configuration basis. When specified, this overrides the tool-chain errorParsers attribute.
|
||||||
</documentation>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
@ -271,8 +271,8 @@ Specifying this attribute is fully equivalent to specifying the "org.eclips
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<documentation>
|
||||||
Semicolon-separated list of providers ID implementing ILanguageSettingProvider interface.
|
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.
|
This field could be amended with toolchain-level providers list by using ${Toolchain} keyword. 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.
|
If this field is not specified, "org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" (MBS Language Settings Provider) is used by default.
|
||||||
</documentation>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
@ -414,15 +414,14 @@ Specifying this attribute is fully equivalent to specifying the "org.eclips
|
||||||
<attribute name="errorParsers" type="string">
|
<attribute name="errorParsers" type="string">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<documentation>
|
||||||
The semi-colon separated list of the default error parsers to be used with this tool-chain. The list is ordered with the first error parser on the list invoked first, the second error parser second, and so on. The list may contain the error parsers defined by CDT and/or other installed error parser extensions. When specified, this overrides the tool errorParsers attributes of the tool children of the tool-chain and the builder child of the tool-chain.
|
The semi-colon separated list of the default error parsers to be used with this tool-chain. The list is ordered with the first error parser on the list invoked first, the second error parser second, and so on. The list may contain the error parsers defined by CDT and/or other installed error parser extensions. When specified, this overrides the tool errorParsers attributes of the tool children of the tool-chain and the builder child of the tool-chain.
|
||||||
</documentation>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
<attribute name="languageSettingsProviders" type="string">
|
<attribute name="languageSettingsProviders" type="string">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<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.
|
Semicolon-separated list of providers ID implementing ILanguageSettingProvider interface. This list could be adjusted on configuration level in the corresponding attribute.
|
||||||
This list could be adjusted on configuration level in the corresponding attribute.
|
|
||||||
</documentation>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
@ -749,14 +748,14 @@ The pathConverter of a toolchain applies for all tools of the toolchain except i
|
||||||
<attribute name="customBuildStep" type="boolean">
|
<attribute name="customBuildStep" type="boolean">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<documentation>
|
||||||
Specifies whether this Tool represents a user-define custom build step. The default is false. When True, the default value of the commandLinePattern attribute changes to “$(command)�.
|
Specifies whether this Tool represents a user-define custom build step. The default is false. When True, the default value of the commandLinePattern attribute changes to "$(command)".
|
||||||
</documentation>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
<attribute name="announcement" type="string">
|
<attribute name="announcement" type="string">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<documentation>
|
||||||
Specifies a string that is written to the build output prior to each invocation of the tool. The default value is “Invoking tool-name (tool-id)…�
|
Specifies a string that is written to the build output prior to each invocation of the tool. The default value is "Invoking tool-name (tool-id)..."
|
||||||
</documentation>
|
</documentation>
|
||||||
<appInfo>
|
<appInfo>
|
||||||
<meta.attribute translatable="true"/>
|
<meta.attribute translatable="true"/>
|
||||||
|
@ -1083,7 +1082,7 @@ Overrides language id specified with the languageId attribute.
|
||||||
<attribute name="primaryInputType" type="string">
|
<attribute name="primaryInputType" type="string">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<documentation>
|
||||||
The id of the input type that is used in determining the build “rules� for the output type and for the default name of the output file. The default is the input type with primaryInput == true.
|
The id of the input type that is used in determining the build "rules" for the output type and for the default name of the output file. The default is the input type with primaryInput == true.
|
||||||
</documentation>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
@ -1097,7 +1096,7 @@ Overrides language id specified with the languageId attribute.
|
||||||
<attribute name="outputPrefix" type="string">
|
<attribute name="outputPrefix" type="string">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<documentation>
|
||||||
Some tools produce files with a special prefix that must be specified. For example, a librarian on POSIX systems expects the output to be libtarget.a, so '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>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
@ -2052,11 +2051,11 @@ If the "buildPathResolver" attribute is specified, the "pathDelim
|
||||||
<documentation>
|
<documentation>
|
||||||
Represents the applicability type for this enablement.
|
Represents the applicability type for this enablement.
|
||||||
Can contain the following values:
|
Can contain the following values:
|
||||||
UI_VISIBILITY – the given enablement expression specifies whether the option is to be visible in UI,
|
UI_VISIBILITY - the given enablement expression specifies whether the option is to be visible in UI,
|
||||||
UI_ENABLEMENT – the given enablement expression specifies the enable state of the controls that represent the option in UI,
|
UI_ENABLEMENT - the given enablement expression specifies the enable state of the controls that represent the option in UI,
|
||||||
CMD_USAGE – the given enablement expression specifies whether the option is to be used in command line
|
CMD_USAGE - the given enablement expression specifies whether the option is to be used in command line
|
||||||
CONTAINER_ATTRIBUTE - the given enablement expressions specifies thecontainer attribute value
|
CONTAINER_ATTRIBUTE - the given enablement expressions specifies thecontainer attribute value
|
||||||
ALL – this value means the combination of all the above values.
|
ALL - this value means the combination of all the above values.
|
||||||
|
|
||||||
Several types could be specified simultaneously using the "|" as a delimiter, e.g.:
|
Several types could be specified simultaneously using the "|" as a delimiter, e.g.:
|
||||||
type="UI_VISIBILITY|CMD_USAGE"
|
type="UI_VISIBILITY|CMD_USAGE"
|
||||||
|
@ -2190,7 +2189,7 @@ Default value is true.
|
||||||
<attribute name="value" type="string">
|
<attribute name="value" type="string">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<documentation>
|
||||||
Specifies the expected value. If the current option value matches the value specified in this attribute, the checkOption element is treated as true, otherwise – as false.
|
Specifies the expected value. If the current option value matches the value specified in this attribute, the checkOption element is treated as true, otherwise - as false.
|
||||||
The expected value could be specified either as a string that may contain build macros or as a regular expression. During the comparison, the build macros are resolved and the option value is checked to match the resulting string or regular expression. The way the expected value is specified and treated depends on the value of the isRegex attribute
|
The expected value could be specified either as a string that may contain build macros or as a regular expression. During the comparison, the build macros are resolved and the option value is checked to match the resulting string or regular expression. The way the expected value is specified and treated depends on the value of the isRegex attribute
|
||||||
</documentation>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
|
@ -2205,14 +2204,14 @@ The expected value could be specified either as a string that may contain build
|
||||||
<attribute name="otherOptionId" type="string">
|
<attribute name="otherOptionId" type="string">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<documentation>
|
||||||
The id of the option which is to be compared with the option specified with the “optionId� attribute. The default is the id of the option that holds this expression. If the “value� attribute is specified, both the “otherOptionId� and the “otherHolderId� attributes are ignored. When searching for the option to be checked, MBS will examine all the options the holder contains along with all superclasses of each option to find the option with the specified id.
|
The id of the option which is to be compared with the option specified with the "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>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
<attribute name="otherHolderId" type="string">
|
<attribute name="otherHolderId" type="string">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<documentation>
|
||||||
The option holder id that holds the option specified with the “otherOptionId� attribute. The default is the id of the holder that holds the container of this expression. If the “value� attribute is specified, both the “otherOptionId� and the “otherHolderId� attributes are ingnored. When searching for the needed holder, MBS will examine all the holders the current configuration contains along with all superclasses of each holder in order to find the holder with the specified id.
|
The option holder id that holds the option specified with the "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>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
@ -2236,7 +2235,7 @@ The expected value could be specified either as a string that may contain build
|
||||||
<attribute name="value" type="string" use="required">
|
<attribute name="value" type="string" use="required">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<documentation>
|
||||||
Specifies the expected value. If the current string specified in the “string� attribute matches the value specified in this attribute, the checkString element is treated as true, otherwise – as false.
|
Specifies the expected value. If the current string specified in the "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 expected value could be specified either as a string that might contain the build macros or as a regular expression.
|
||||||
The way the value is specified and treated depends on the value of the isRegex attribute.
|
The way the value is specified and treated depends on the value of the isRegex attribute.
|
||||||
</documentation>
|
</documentation>
|
||||||
|
|
|
@ -174,11 +174,11 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns default language settings providers IDs specified for the configuration.
|
* Returns default language settings providers IDs specified for the configuration.
|
||||||
* @return default language settings providers IDs.
|
* @return default language settings providers IDs or {@code null}.
|
||||||
*
|
*
|
||||||
* @since 8.1
|
* @since 8.1
|
||||||
*/
|
*/
|
||||||
public String[] getDefaultLanguageSettingsProvidersIds();
|
public String[] getDefaultLanguageSettingsProviderIds();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Projects have C or CC natures. Tools can specify a filter so they are not
|
* Projects have C or CC natures. Tools can specify a filter so they are not
|
||||||
|
|
|
@ -271,7 +271,7 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
||||||
*
|
*
|
||||||
* @since 8.1
|
* @since 8.1
|
||||||
*/
|
*/
|
||||||
public String getDefaultLanguageSettingsProvidersIds();
|
public String getDefaultLanguageSettingsProviderIds();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the scanner config discovery profile id or <code>null</code> if none.
|
* Returns the scanner config discovery profile id or <code>null</code> if none.
|
||||||
|
|
|
@ -26,7 +26,6 @@ import java.util.Vector;
|
||||||
|
|
||||||
import org.eclipse.cdt.build.core.scannerconfig.ICfgScannerConfigBuilderInfo2Set;
|
import org.eclipse.cdt.build.core.scannerconfig.ICfgScannerConfigBuilderInfo2Set;
|
||||||
import org.eclipse.cdt.build.internal.core.scannerconfig.CfgDiscoveredPathManager.PathInfoCache;
|
import org.eclipse.cdt.build.internal.core.scannerconfig.CfgDiscoveredPathManager.PathInfoCache;
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
|
||||||
import org.eclipse.cdt.core.ErrorParserManager;
|
import org.eclipse.cdt.core.ErrorParserManager;
|
||||||
import org.eclipse.cdt.core.settings.model.CSourceEntry;
|
import org.eclipse.cdt.core.settings.model.CSourceEntry;
|
||||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||||
|
@ -84,10 +83,8 @@ import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.IResourceDelta;
|
import org.eclipse.core.resources.IResourceDelta;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.core.runtime.Status;
|
|
||||||
import org.eclipse.osgi.util.NLS;
|
import org.eclipse.osgi.util.NLS;
|
||||||
import org.osgi.framework.Version;
|
import org.osgi.framework.Version;
|
||||||
|
|
||||||
|
@ -96,6 +93,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
||||||
private static final String EMPTY_CFG_ID = "org.eclipse.cdt.build.core.emptycfg"; //$NON-NLS-1$
|
private static final String EMPTY_CFG_ID = "org.eclipse.cdt.build.core.emptycfg"; //$NON-NLS-1$
|
||||||
private static final String LANGUAGE_SETTINGS_PROVIDER_DELIMITER = ";"; //$NON-NLS-1$
|
private static final String LANGUAGE_SETTINGS_PROVIDER_DELIMITER = ";"; //$NON-NLS-1$
|
||||||
|
private static final String LANGUAGE_SETTINGS_PROVIDER_NEGATION_SIGN = "-"; //$NON-NLS-1$
|
||||||
|
private static final String $TOOLCHAIN = "${Toolchain}"; //$NON-NLS-1$
|
||||||
|
|
||||||
// Parent and children
|
// Parent and children
|
||||||
private String parentId;
|
private String parentId;
|
||||||
|
@ -107,7 +106,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
private String artifactExtension;
|
private String artifactExtension;
|
||||||
private String errorParserIds;
|
private String errorParserIds;
|
||||||
private String defaultLanguageSettingsProvidersAttribute;
|
private String defaultLanguageSettingsProvidersAttribute;
|
||||||
private String[] defaultLanguageSettingsProvidersIds;
|
private String[] defaultLanguageSettingsProviderIds;
|
||||||
private String prebuildStep;
|
private String prebuildStep;
|
||||||
private String postbuildStep;
|
private String postbuildStep;
|
||||||
private String preannouncebuildStep;
|
private String preannouncebuildStep;
|
||||||
|
@ -1462,6 +1461,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return set;
|
return set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get value of attribute {@link IConfiguration#LANGUAGE_SETTINGS_PROVIDERS}
|
||||||
|
* It not defined, it will try to pull the attribute from the parent configuration.
|
||||||
|
*/
|
||||||
private String getDefaultLanguageSettingsProvidersAttribute() {
|
private String getDefaultLanguageSettingsProvidersAttribute() {
|
||||||
if (defaultLanguageSettingsProvidersAttribute == null && parent instanceof Configuration) {
|
if (defaultLanguageSettingsProvidersAttribute == null && parent instanceof Configuration) {
|
||||||
defaultLanguageSettingsProvidersAttribute = ((Configuration) parent).getDefaultLanguageSettingsProvidersAttribute();
|
defaultLanguageSettingsProvidersAttribute = ((Configuration) parent).getDefaultLanguageSettingsProvidersAttribute();
|
||||||
|
@ -1470,29 +1473,32 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return defaultLanguageSettingsProvidersAttribute;
|
return defaultLanguageSettingsProvidersAttribute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*
|
||||||
|
* This function will try to find default provider Ids specified in this instance.
|
||||||
|
* It none defined, it will try to pull Ids from the parent configuration.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String[] getDefaultLanguageSettingsProvidersIds() {
|
public String[] getDefaultLanguageSettingsProviderIds() {
|
||||||
defaultLanguageSettingsProvidersIds = null;
|
defaultLanguageSettingsProviderIds = null;
|
||||||
if (defaultLanguageSettingsProvidersIds == null) {
|
if (defaultLanguageSettingsProviderIds == null) {
|
||||||
getDefaultLanguageSettingsProvidersAttribute();
|
defaultLanguageSettingsProvidersAttribute = getDefaultLanguageSettingsProvidersAttribute();
|
||||||
if (defaultLanguageSettingsProvidersAttribute != null) {
|
if (defaultLanguageSettingsProvidersAttribute != null) {
|
||||||
List<String> ids = new ArrayList<String>();
|
List<String> ids = new ArrayList<String>();
|
||||||
String[] defaultIds = defaultLanguageSettingsProvidersAttribute.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER);
|
String[] defaultIds = defaultLanguageSettingsProvidersAttribute.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER);
|
||||||
for (String id : defaultIds) {
|
for (String id : defaultIds) {
|
||||||
if (id != null && !id.isEmpty()) {
|
if (id != null && !id.isEmpty()) {
|
||||||
if (id.startsWith("-")) {
|
if (id.startsWith(LANGUAGE_SETTINGS_PROVIDER_NEGATION_SIGN)) {
|
||||||
id = id.substring(1);
|
id = id.substring(1);
|
||||||
ids.remove(id);
|
ids.remove(id);
|
||||||
} else if (!ids.contains(id)){
|
} else if (!ids.contains(id)) {
|
||||||
if (id.contains("${Toolchain}")) {
|
if (id.contains($TOOLCHAIN)) {
|
||||||
IToolChain toolchain = getToolChain();
|
IToolChain toolchain = getToolChain();
|
||||||
if (toolchain != null) {
|
if (toolchain != null) {
|
||||||
String toolchainProvidersIds = toolchain.getDefaultLanguageSettingsProvidersIds();
|
String toolchainProvidersIds = toolchain.getDefaultLanguageSettingsProviderIds();
|
||||||
if (toolchainProvidersIds != null) {
|
if (toolchainProvidersIds != null) {
|
||||||
ids.addAll(Arrays.asList(toolchainProvidersIds.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER)));
|
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 {
|
} else {
|
||||||
|
@ -1502,13 +1508,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
defaultLanguageSettingsProvidersIds = ids.toArray(new String[ids.size()]);
|
defaultLanguageSettingsProviderIds = ids.toArray(new String[ids.size()]);
|
||||||
} else if (parent != null) {
|
} else if (parent != null) {
|
||||||
defaultLanguageSettingsProvidersIds = parent.getDefaultLanguageSettingsProvidersIds();
|
defaultLanguageSettingsProviderIds = parent.getDefaultLanguageSettingsProviderIds();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return defaultLanguageSettingsProvidersIds;
|
return defaultLanguageSettingsProviderIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
|
@ -441,7 +441,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getDefaultLanguageSettingsProvidersIds() {
|
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");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
||||||
private String targetToolIds;
|
private String targetToolIds;
|
||||||
private String secondaryOutputIds;
|
private String secondaryOutputIds;
|
||||||
private Boolean isAbstract;
|
private Boolean isAbstract;
|
||||||
private String defaultLanguageSettingsProvidersIds;
|
private String defaultLanguageSettingsProviderIds;
|
||||||
private String scannerConfigDiscoveryProfileId;
|
private String scannerConfigDiscoveryProfileId;
|
||||||
private String versionsSupported;
|
private String versionsSupported;
|
||||||
private String convertToId;
|
private String convertToId;
|
||||||
|
@ -559,7 +559,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
||||||
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 setttings providers IDs
|
||||||
defaultLanguageSettingsProvidersIds = 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
|
||||||
scannerConfigDiscoveryProfileId = SafeStringInterner.safeIntern(element.getAttribute(SCANNER_CONFIG_PROFILE_ID));
|
scannerConfigDiscoveryProfileId = SafeStringInterner.safeIntern(element.getAttribute(SCANNER_CONFIG_PROFILE_ID));
|
||||||
|
@ -1537,13 +1537,11 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDefaultLanguageSettingsProvidersIds() {
|
public String getDefaultLanguageSettingsProviderIds() {
|
||||||
if (defaultLanguageSettingsProvidersIds == null) {
|
if (defaultLanguageSettingsProviderIds == null && superClass instanceof IToolChain) {
|
||||||
if (superClass instanceof IToolChain) {
|
defaultLanguageSettingsProviderIds = ((IToolChain) superClass).getDefaultLanguageSettingsProviderIds();
|
||||||
defaultLanguageSettingsProvidersIds = ((IToolChain) superClass).getDefaultLanguageSettingsProvidersIds();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return defaultLanguageSettingsProvidersIds;
|
return defaultLanguageSettingsProviderIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1552,9 +1550,9 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
||||||
private boolean isLanguageSettingsProvidersFunctionalityEnabled() {
|
private boolean isLanguageSettingsProvidersFunctionalityEnabled() {
|
||||||
boolean isLanguageSettingsProvidersEnabled = false;
|
boolean isLanguageSettingsProvidersEnabled = false;
|
||||||
IConfiguration cfg = getParent();
|
IConfiguration cfg = getParent();
|
||||||
if (cfg!=null) {
|
if (cfg != null) {
|
||||||
IResource rc = cfg.getOwner();
|
IResource rc = cfg.getOwner();
|
||||||
if (rc!=null) {
|
if (rc != null) {
|
||||||
IProject project = rc.getProject();
|
IProject project = rc.getProject();
|
||||||
isLanguageSettingsProvidersEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
|
isLanguageSettingsProvidersEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
|
||||||
}
|
}
|
||||||
|
@ -1564,11 +1562,13 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Temporary method to support compatibility during SD transition.
|
* Temporary method to support compatibility during SD transition.
|
||||||
|
* @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() {
|
||||||
String profileId = scannerConfigDiscoveryProfileId;
|
String profileId = scannerConfigDiscoveryProfileId;
|
||||||
if (profileId==null) {
|
if (profileId == null) {
|
||||||
profileId = ScannerDiscoveryLegacySupport.getDeprecatedLegacyProfiles(id);
|
profileId = ScannerDiscoveryLegacySupport.getDeprecatedLegacyProfiles(id);
|
||||||
if (profileId == null) {
|
if (profileId == null) {
|
||||||
IToolChain superClass = getSuperClass();
|
IToolChain superClass = getSuperClass();
|
||||||
|
|
|
@ -519,7 +519,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
|
|
||||||
private static List<ILanguageSettingsProvider> getDefaultLanguageSettingsProviders(IConfiguration cfg) {
|
private static List<ILanguageSettingsProvider> getDefaultLanguageSettingsProviders(IConfiguration cfg) {
|
||||||
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
|
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
|
||||||
String[] ids = cfg.getDefaultLanguageSettingsProvidersIds();
|
String[] ids = cfg.getDefaultLanguageSettingsProviderIds();
|
||||||
if (ids != null) {
|
if (ids != null) {
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
ILanguageSettingsProvider provider = null;
|
ILanguageSettingsProvider provider = null;
|
||||||
|
|
|
@ -208,7 +208,7 @@ public class TestConfiguration implements IConfiguration {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getDefaultLanguageSettingsProvidersIds() {
|
public String[] getDefaultLanguageSettingsProviderIds() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -365,7 +365,7 @@ public class TestToolchain extends HoldsOptions implements IToolChain {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDefaultLanguageSettingsProvidersIds() {
|
public String getDefaultLanguageSettingsProviderIds() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -274,7 +274,7 @@ PropertyPageDefsTab_7=Show disc. page names if they are unique. Else show profil
|
||||||
PropertyPageDefsTab_8=Always show names + profile IDs
|
PropertyPageDefsTab_8=Always show names + profile IDs
|
||||||
PropertyPageDefsTab_9=Always show profile IDs only
|
PropertyPageDefsTab_9=Always show profile IDs only
|
||||||
PropertyPageDefsTab_showIncludeFileTab=Display "Include Files" tab
|
PropertyPageDefsTab_showIncludeFileTab=Display "Include Files" tab
|
||||||
PropertyPageDefsTab_showProvidersTab=Display "Preprocessor Include Paths" tabs
|
PropertyPageDefsTab_showProvidersTab=Display "Preprocessor Include Paths" tab and enable language settings providers
|
||||||
ProjectConvert_convertersList=Converters List
|
ProjectConvert_convertersList=Converters List
|
||||||
|
|
||||||
AbstractPrefPage_0=\ Preference settings will be applied to new projects \n only when there were no toolchains selected.
|
AbstractPrefPage_0=\ Preference settings will be applied to new projects \n only when there were no toolchains selected.
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
package org.eclipse.cdt.managedbuilder.ui.preferences;
|
package org.eclipse.cdt.managedbuilder.ui.preferences;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||||
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||||
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
|
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
|
||||||
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||||
|
@ -31,7 +30,6 @@ public class WizardDefaultsTab extends AbstractCPropertyTab {
|
||||||
|
|
||||||
private Button show_sup;
|
private Button show_sup;
|
||||||
private Button show_oth;
|
private Button show_oth;
|
||||||
private Button checkBoxTryNewSD;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createControls(Composite parent) {
|
public void createControls(Composite parent) {
|
||||||
|
@ -46,27 +44,20 @@ public class WizardDefaultsTab extends AbstractCPropertyTab {
|
||||||
show_oth.setText(Messages.WizardDefaultsTab_1);
|
show_oth.setText(Messages.WizardDefaultsTab_1);
|
||||||
show_oth.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
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_sup.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOSUPP));
|
||||||
show_oth.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_OTHERS));
|
show_oth.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_OTHERS));
|
||||||
checkBoxTryNewSD.setSelection(CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NEWSD));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void performOK() {
|
protected void performOK() {
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOSUPP, !show_sup.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOSUPP, !show_sup.getSelection());
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_OTHERS, show_oth.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_OTHERS, show_oth.getSelection());
|
||||||
CDTPrefUtil.setBool(LanguageSettingsProvidersPage.KEY_NEWSD, checkBoxTryNewSD.getSelection());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void performDefaults() {
|
protected void performDefaults() {
|
||||||
show_sup.setSelection(true);
|
show_sup.setSelection(true);
|
||||||
show_oth.setSelection(false);
|
show_oth.setSelection(false);
|
||||||
checkBoxTryNewSD.setSelection(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -32,6 +32,7 @@ import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
||||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||||
import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
|
import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
|
||||||
|
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
||||||
import org.eclipse.cdt.internal.ui.wizards.ICDTCommonProjectWizard;
|
import org.eclipse.cdt.internal.ui.wizards.ICDTCommonProjectWizard;
|
||||||
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty;
|
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty;
|
||||||
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
|
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
|
||||||
|
@ -598,20 +599,12 @@ public class MBSWizardHandler extends CWizardHandler {
|
||||||
cfgFirst = cfgDes;
|
cfgFirst = cfgDes;
|
||||||
|
|
||||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||||
boolean isTryingNewSD = false;
|
boolean isEnableProvidersPreference = !CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS);
|
||||||
IWizardPage page = getStartingPage();
|
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isEnableProvidersPreference);
|
||||||
if (page instanceof CDTMainWizardPage) {
|
if (isEnableProvidersPreference) {
|
||||||
isTryingNewSD = ((CDTMainWizardPage)page).isTryingNewSD();
|
|
||||||
}
|
|
||||||
|
|
||||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isTryingNewSD);
|
|
||||||
List<ILanguageSettingsProvider> providers;
|
|
||||||
if (isTryingNewSD) {
|
|
||||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(config, cfgDes);
|
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(config, cfgDes);
|
||||||
} else {
|
} else {
|
||||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
||||||
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
||||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||||
|
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||||
|
@ -31,6 +32,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
|
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||||
import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
|
import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
|
||||||
|
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IProjectDescription;
|
import org.eclipse.core.resources.IProjectDescription;
|
||||||
import org.eclipse.core.resources.IWorkspace;
|
import org.eclipse.core.resources.IWorkspace;
|
||||||
|
@ -73,7 +75,6 @@ public class NewMakeProjFromExisting extends Wizard implements IImportWizard, IN
|
||||||
final String locationStr = page.getLocation();
|
final String locationStr = page.getLocation();
|
||||||
final boolean isCPP = page.isCPP();
|
final boolean isCPP = page.isCPP();
|
||||||
final IToolChain toolChain = page.getToolChain();
|
final IToolChain toolChain = page.getToolChain();
|
||||||
final boolean isTryingNewSD = page.isTryingNewSD();
|
|
||||||
|
|
||||||
IRunnableWithProgress op = new WorkspaceModifyOperation() {
|
IRunnableWithProgress op = new WorkspaceModifyOperation() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -118,13 +119,12 @@ public class NewMakeProjFromExisting extends Wizard implements IImportWizard, IN
|
||||||
ICConfigurationDescription cfgDes = projDesc.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
ICConfigurationDescription cfgDes = projDesc.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
||||||
|
|
||||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isTryingNewSD);
|
boolean isEnableProvidersPreference = !CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS);
|
||||||
if (isTryingNewSD) {
|
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isEnableProvidersPreference);
|
||||||
|
if (isEnableProvidersPreference) {
|
||||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(config, cfgDes);
|
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(config, cfgDes);
|
||||||
} else {
|
} else {
|
||||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
||||||
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
||||||
|
|
|
@ -16,12 +16,9 @@ import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
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.IToolChain;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
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.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||||
|
@ -71,9 +68,6 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
*/
|
*/
|
||||||
boolean projectNameSetByUser;
|
boolean projectNameSetByUser;
|
||||||
|
|
||||||
private Button checkBoxTryNewSD;
|
|
||||||
|
|
||||||
|
|
||||||
protected NewMakeProjFromExistingPage() {
|
protected NewMakeProjFromExistingPage() {
|
||||||
super(Messages.NewMakeProjFromExistingPage_0);
|
super(Messages.NewMakeProjFromExistingPage_0);
|
||||||
setTitle(Messages.NewMakeProjFromExistingPage_1);
|
setTitle(Messages.NewMakeProjFromExistingPage_1);
|
||||||
|
@ -93,22 +87,6 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
addSourceSelector(comp);
|
addSourceSelector(comp);
|
||||||
addLanguageSelector(comp);
|
addLanguageSelector(comp);
|
||||||
addToolchainSelector(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);
|
setControl(comp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,11 +342,4 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
return selection.length != 0 ? tcMap.get(selection[0]) : null;
|
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
||||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||||
|
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||||
|
@ -28,6 +29,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
|
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
|
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||||
|
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||||
import org.eclipse.cdt.ui.wizards.CDTMainWizardPage;
|
import org.eclipse.cdt.ui.wizards.CDTMainWizardPage;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
@ -52,7 +54,7 @@ public class STDWizardHandler extends MBSWizardHandler {
|
||||||
full_tcs.put(Messages.StdProjectTypeHandler_0, null);
|
full_tcs.put(Messages.StdProjectTypeHandler_0, null);
|
||||||
} else {
|
} else {
|
||||||
if (tc.isAbstract() || tc.isSystemObject()) return;
|
if (tc.isAbstract() || tc.isSystemObject()) return;
|
||||||
// unlike CWizardHandler, we don't check for configs
|
// unlike CWizardHandler, we don't check for configs
|
||||||
full_tcs.put(tc.getUniqueRealName(), tc);
|
full_tcs.put(tc.getUniqueRealName(), tc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,61 +78,54 @@ public class STDWizardHandler extends MBSWizardHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setProjectDescription(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor)
|
private void setProjectDescription(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
|
|
||||||
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
|
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
|
||||||
ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
|
ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
|
||||||
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
|
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
|
||||||
ManagedProject mProj = new ManagedProject(des);
|
ManagedProject mProj = new ManagedProject(des);
|
||||||
info.setManagedProject(mProj);
|
info.setManagedProject(mProj);
|
||||||
monitor.worked(20);
|
monitor.worked(20);
|
||||||
cfgs = CfgHolder.unique(getCfgItems(false));
|
cfgs = CfgHolder.unique(getCfgItems(false));
|
||||||
cfgs = CfgHolder.reorder(cfgs);
|
cfgs = CfgHolder.reorder(cfgs);
|
||||||
int work = 50/cfgs.length;
|
int work = 50/cfgs.length;
|
||||||
for (int i=0; i<cfgs.length; i++) {
|
for (int i=0; i<cfgs.length; i++) {
|
||||||
String s = (cfgs[i].getToolChain() == null) ? "0" : ((ToolChain)(cfgs[i].getToolChain())).getId(); //$NON-NLS-1$
|
String s = (cfgs[i].getToolChain() == null) ? "0" : ((ToolChain)(cfgs[i].getToolChain())).getId(); //$NON-NLS-1$
|
||||||
Configuration cfg = new Configuration(mProj, (ToolChain)cfgs[i].getToolChain(), ManagedBuildManager.calculateChildId(s, null), cfgs[i].getName());
|
Configuration cfg = new Configuration(mProj, (ToolChain)cfgs[i].getToolChain(), ManagedBuildManager.calculateChildId(s, null), cfgs[i].getName());
|
||||||
cfgs[i].setConfiguration(cfg);
|
cfgs[i].setConfiguration(cfg);
|
||||||
IBuilder bld = cfg.getEditableBuilder();
|
IBuilder bld = cfg.getEditableBuilder();
|
||||||
if (bld != null) {
|
if (bld != null) {
|
||||||
if(bld.isInternalBuilder()){
|
if(bld.isInternalBuilder()){
|
||||||
IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
|
IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
|
||||||
IBuilder prefBuilder = prefCfg.getBuilder();
|
IBuilder prefBuilder = prefCfg.getBuilder();
|
||||||
cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName());
|
cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName());
|
||||||
bld = cfg.getEditableBuilder();
|
bld = cfg.getEditableBuilder();
|
||||||
bld.setBuildPath(null);
|
bld.setBuildPath(null);
|
||||||
}
|
}
|
||||||
bld.setManagedBuildOn(false);
|
bld.setManagedBuildOn(false);
|
||||||
} else {
|
} else {
|
||||||
System.out.println(Messages.StdProjectTypeHandler_3);
|
System.out.println(Messages.StdProjectTypeHandler_3);
|
||||||
}
|
}
|
||||||
cfg.setArtifactName(mProj.getDefaultArtifactName());
|
cfg.setArtifactName(mProj.getDefaultArtifactName());
|
||||||
CConfigurationData data = cfg.getConfigurationData();
|
CConfigurationData data = cfg.getConfigurationData();
|
||||||
ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
||||||
|
|
||||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||||
boolean isTryingNewSD = false;
|
boolean isEnableProvidersPreference = !CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS);
|
||||||
IWizardPage page = getStartingPage();
|
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isEnableProvidersPreference);
|
||||||
if (page instanceof CDTMainWizardPage) {
|
if (isEnableProvidersPreference) {
|
||||||
isTryingNewSD = ((CDTMainWizardPage)page).isTryingNewSD();
|
|
||||||
}
|
|
||||||
|
|
||||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isTryingNewSD);
|
|
||||||
if (isTryingNewSD) {
|
|
||||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(cfg, cfgDes);
|
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(cfg, cfgDes);
|
||||||
} else {
|
} else {
|
||||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
||||||
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor.worked(work);
|
monitor.worked(work);
|
||||||
}
|
}
|
||||||
mngr.setProjectDescription(project, des);
|
mngr.setProjectDescription(project, des);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canCreateWithoutToolchain() {
|
public boolean canCreateWithoutToolchain() {
|
||||||
return true;
|
return true;
|
||||||
|
@ -138,7 +133,7 @@ public class STDWizardHandler extends MBSWizardHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void convertProject(IProject proj, IProgressMonitor monitor) throws CoreException {
|
public void convertProject(IProject proj, IProgressMonitor monitor) throws CoreException {
|
||||||
setProjectDescription(proj, true, true, monitor);
|
setProjectDescription(proj, true, true, monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,8 +26,6 @@ import org.eclipse.cdt.ui.newui.ICPropertyTab;
|
||||||
public class LanguageSettingsProvidersPage extends AbstractPage {
|
public class LanguageSettingsProvidersPage extends AbstractPage {
|
||||||
/** @since 5.4 */ // temporary key, subject to removal
|
/** @since 5.4 */ // temporary key, subject to removal
|
||||||
public static final String KEY_NO_SHOW_PROVIDERS = "properties.providers.tab.disable"; //$NON-NLS-1$
|
public static final String KEY_NO_SHOW_PROVIDERS = "properties.providers.tab.disable"; //$NON-NLS-1$
|
||||||
/** @since 5.4 */ // temporary key, subject to removal
|
|
||||||
public static final String KEY_NEWSD = "wizard.try.new.sd.enable"; //$NON-NLS-1$
|
|
||||||
|
|
||||||
private static boolean isLanguageSettingsProvidersEnabled = false;
|
private static boolean isLanguageSettingsProvidersEnabled = false;
|
||||||
private static IProject project = null;
|
private static IProject project = null;
|
||||||
|
|
|
@ -50,7 +50,6 @@ import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||||
import org.eclipse.cdt.ui.newui.PageLayout;
|
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;
|
import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||||
|
|
||||||
public class CDTMainWizardPage extends WizardNewProjectCreationPage implements IWizardItemsListListener {
|
public class CDTMainWizardPage extends WizardNewProjectCreationPage implements IWizardItemsListListener {
|
||||||
|
@ -68,7 +67,6 @@ import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||||
private Tree tree;
|
private Tree tree;
|
||||||
private Composite right;
|
private Composite right;
|
||||||
private Button show_sup;
|
private Button show_sup;
|
||||||
private Button checkBoxTryNewSD;
|
|
||||||
private Label right_label;
|
private Label right_label;
|
||||||
|
|
||||||
public CWizardHandler h_selected = null;
|
public CWizardHandler h_selected = null;
|
||||||
|
@ -156,20 +154,6 @@ import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||||
|
|
||||||
// restore settings from preferences
|
// restore settings from preferences
|
||||||
show_sup.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOSUPP));
|
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
|
@Override
|
||||||
|
@ -497,13 +481,5 @@ import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||||
public List filterItems(List items) {
|
public List filterItems(List items) {
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* AG FIXME - remove before CDT Juno release.
|
|
||||||
* @since 5.4
|
|
||||||
*/
|
|
||||||
public boolean isTryingNewSD() {
|
|
||||||
return checkBoxTryNewSD.getSelection();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue