Skip to main content
summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-05-07 01:04:30 -0400
committerAndrew Gvozdev2012-05-07 01:07:21 -0400
commit77442617cc7d23302e446a227726b4b0e42f8e81 (patch)
treeff632da63abc8b7664fd2a14beb362ad685289b7 /build
parentfac58cefa1e23b4ac3e4ce525b1ffbaff1756ac0 (diff)
downloadorg.eclipse.cdt-77442617cc7d23302e446a227726b4b0e42f8e81.tar.gz
org.eclipse.cdt-77442617cc7d23302e446a227726b4b0e42f8e81.tar.xz
org.eclipse.cdt-77442617cc7d23302e446a227726b4b0e42f8e81.zip
bug 378589: [sd90] Scanner Discovery doesn't run on certain toolchains
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java29
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java33
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml21
4 files changed, 46 insertions, 41 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java
index 63953098db..8de96d8bff 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java
@@ -1842,25 +1842,25 @@ public class InputType extends BuildObject implements IInputType {
}
/**
- * Check if legacy scanner discovery method should be used.
+ * Check if legacy scanner discovery profiles should be used.
*/
- private boolean isLegacyScannerDiscovery() {
- boolean isLanguageSettingsProvidersEnabled = false;
+ private boolean useLegacyScannerDiscoveryProfiles() {
+ boolean useLegacy = true;
ITool tool = getParent();
- if (tool!=null) {
- IBuildObject bo = tool.getParent();
- if (bo instanceof IToolChain) {
- IConfiguration cfg = ((IToolChain) bo).getParent();
- if (cfg!=null) {
+ if (tool != null) {
+ IBuildObject toolchain = tool.getParent();
+ if (toolchain instanceof IToolChain && ((IToolChain) toolchain).getDefaultLanguageSettingsProviderIds() != null) {
+ IConfiguration cfg = ((IToolChain) toolchain).getParent();
+ if (cfg != null && cfg.getDefaultLanguageSettingsProviderIds() != null) {
IResource rc = cfg.getOwner();
- if (rc!=null) {
+ if (rc != null) {
IProject project = rc.getProject();
- isLanguageSettingsProvidersEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
+ useLegacy = !ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
}
}
}
}
- return !isLanguageSettingsProvidersEnabled;
+ return useLegacy;
}
/**
@@ -1879,11 +1879,12 @@ public class InputType extends BuildObject implements IInputType {
}
public String getDiscoveryProfileIdAttribute() {
- if (isLegacyScannerDiscovery()) {
- return getLegacyDiscoveryProfileIdAttribute();
+ String discoveryProfileAttribute = getDiscoveryProfileIdAttributeInternal();
+ if (discoveryProfileAttribute == null && useLegacyScannerDiscoveryProfiles()) {
+ discoveryProfileAttribute = getLegacyDiscoveryProfileIdAttribute();
}
- return getDiscoveryProfileIdAttributeInternal();
+ return discoveryProfileAttribute;
}
/**
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java
index 30f027a94c..f19fed3634 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java
@@ -89,7 +89,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
private String secondaryOutputIds;
private Boolean isAbstract;
private String defaultLanguageSettingsProviderIds;
- private String scannerConfigDiscoveryProfileId;
+ private String scannerConfigDiscoveryProfileId;
private String versionsSupported;
private String convertToId;
private IConfigurationElement managedIsToolChainSupportedElement = null;
@@ -1545,19 +1545,21 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
/**
- * Check if legacy scanner discovery method should be used.
- */
- private boolean isLegacyScannerDiscovery() {
- boolean isLanguageSettingsProvidersEnabled = false;
- IConfiguration cfg = getParent();
- if (cfg != null) {
- IResource rc = cfg.getOwner();
- if (rc != null) {
- IProject project = rc.getProject();
- isLanguageSettingsProvidersEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
+ * Check if legacy scanner discovery profiles should be used.
+ */
+ private boolean useLegacyScannerDiscoveryProfiles() {
+ boolean useLegacy = true;
+ if (getDefaultLanguageSettingsProviderIds() != null) {
+ IConfiguration cfg = getParent();
+ if (cfg != null && cfg.getDefaultLanguageSettingsProviderIds() != null) {
+ IResource rc = cfg.getOwner();
+ if (rc != null) {
+ IProject project = rc.getProject();
+ useLegacy = !ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
+ }
}
}
- return !isLanguageSettingsProvidersEnabled;
+ return useLegacy;
}
/**
@@ -1582,11 +1584,12 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public String getScannerConfigDiscoveryProfileId() {
- if (isLegacyScannerDiscovery()) {
- return getLegacyScannerConfigDiscoveryProfileId();
+ String discoveryProfileId = getScannerConfigDiscoveryProfileIdInternal();
+ if (discoveryProfileId == null && useLegacyScannerDiscoveryProfiles()) {
+ discoveryProfileId = getLegacyScannerConfigDiscoveryProfileId();
}
- return getScannerConfigDiscoveryProfileIdInternal();
+ return discoveryProfileId;
}
/**
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java
index 5c29520d0b..eae4fbff64 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java
@@ -533,9 +533,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
}
providers.add(provider);
}
- }
-
- if (providers.isEmpty()) {
+ } else {
providers = ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
index db5faa8aa5..34cbe8478f 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
@@ -1923,10 +1923,11 @@
<toolChain
archList="all"
- osList="macosx"
+ id="cdt.managedbuild.toolchain.gnu.macosx.base"
+ languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
name="%ToolChainName.Macosx"
- targetTool="cdt.managedbuild.tool.macosx.c.linker.macosx.base;cdt.managedbuild.tool.macosx.cpp.linker.macosx.base;cdt.managedbuild.tool.gnu.archiver"
- id="cdt.managedbuild.toolchain.gnu.macosx.base">
+ osList="macosx"
+ targetTool="cdt.managedbuild.tool.macosx.c.linker.macosx.base;cdt.managedbuild.tool.macosx.cpp.linker.macosx.base;cdt.managedbuild.tool.gnu.archiver">
<targetPlatform
id="cdt.managedbuild.target.gnu.platform.macosx.base"
name="%PlatformName.Dbg"
@@ -2053,9 +2054,10 @@
<toolChain
archList="all"
- osList="solaris"
id="cdt.managedbuild.toolchain.gnu.solaris.base"
+ languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
name="%ToolChainName.Solaris"
+ osList="solaris"
superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform
id="cdt.managedbuild.target.gnu.solaris.base"
@@ -3256,9 +3258,9 @@
</projectType>
<configuration
- id="cdt.managedbuild.config.gnu.macosx.base"
- cleanCommand="rm -rf"
- >
+ cleanCommand="rm -rf"
+ id="cdt.managedbuild.config.gnu.macosx.base"
+ languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser">
<enablement type="CONTAINER_ATTRIBUTE"
attribute="artifactExtension"
value="dylib"
@@ -3669,8 +3671,9 @@
</projectType>
<configuration
- id="cdt.managedbuild.config.gnu.solaris.base"
- cleanCommand="rm -rf">
+ cleanCommand="rm -rf"
+ id="cdt.managedbuild.config.gnu.solaris.base"
+ languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain};-org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser">
<enablement type="CONTAINER_ATTRIBUTE"
attribute="artifactExtension"
value="so"

Back to the top