Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2012-03-29 21:37:48 +0000
committerJeff Johnston2012-03-29 22:19:40 +0000
commit179924ef5c78c72e0465ff6fe3baff0acdee00e9 (patch)
tree0b9c093b0899816958ee39569a0c6c216aca9ed6 /build/org.eclipse.cdt.autotools.ui
parent90ecfa9d5e2643120e5359d0a9530e8e42029cdf (diff)
downloadorg.eclipse.cdt-179924ef5c78c72e0465ff6fe3baff0acdee00e9.tar.gz
org.eclipse.cdt-179924ef5c78c72e0465ff6fe3baff0acdee00e9.tar.xz
org.eclipse.cdt-179924ef5c78c72e0465ff6fe3baff0acdee00e9.zip
Bug 374026 - [autotools] unable to extend the autotools toolchain
- fix createItems method in AutotoolsBuildWizard to accept any project type that has a toolchain that is based upon [GNU Autotools]
Diffstat (limited to 'build/org.eclipse.cdt.autotools.ui')
-rw-r--r--build/org.eclipse.cdt.autotools.ui/ChangeLog6
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/AutotoolsBuildWizard.java58
2 files changed, 42 insertions, 22 deletions
diff --git a/build/org.eclipse.cdt.autotools.ui/ChangeLog b/build/org.eclipse.cdt.autotools.ui/ChangeLog
index 3a19b166803..b54ca73364c 100644
--- a/build/org.eclipse.cdt.autotools.ui/ChangeLog
+++ b/build/org.eclipse.cdt.autotools.ui/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves: bug#374026
+ * src/org/eclipse/cdt/internal/autotools/ui/wizards/AutotoolsBuildWizard.java (createItems): Change to accept any
+ type of project that has at least one toolchain that is based upon the GNU Autotools toolchain.
+
2012-01-03 Jeff Johnston <jjohnstn@redhat.com>
Refactor entire plug-in to org.eclipse.cdt.autotools.ui.
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/AutotoolsBuildWizard.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/AutotoolsBuildWizard.java
index 838f61ca487..60de20c70a4 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/AutotoolsBuildWizard.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/AutotoolsBuildWizard.java
@@ -40,6 +40,8 @@ public class AutotoolsBuildWizard extends AbstractCWizard {
* @since 5.1
*/
public static final String EMPTY_PROJECT = AutotoolsWizardMessages.getResourceString("AutotoolsBuildWizard.2"); //$NON-NLS-1$
+ public static final String AUTOTOOLS_TOOLCHAIN_ID = "org.eclipse.linuxtools.cdt.autotools.core.toolChain"; //$NON-NLS-1$
+
/**
* Creates and returns an array of items to be displayed
*/
@@ -49,38 +51,50 @@ public class AutotoolsBuildWizard extends AbstractCWizard {
IBuildPropertyValue[] vs = bpt.getSupportedValues();
Arrays.sort(vs, BuildListComparator.getInstance());
ArrayList<EntryDescriptor> items = new ArrayList<EntryDescriptor>();
-
- // look for Autotools project type
+
+ // look for project types that have a toolchain based on the Autotools toolchain
+ // and if so, add an entry for the project type.
+ // Fix for bug#374026
EntryDescriptor oldsRoot = null;
SortedMap<String, IProjectType> sm = ManagedBuildManager.getExtensionProjectTypeMap();
for (Map.Entry<String, IProjectType> e : sm.entrySet()) {
IProjectType pt = e.getValue();
- if (pt.getId().equals(AUTOTOOLS_PROJECTTYPE_ID)) {
- AutotoolsBuildWizardHandler h = new AutotoolsBuildWizardHandler(pt, parent, wizard);
- IToolChain[] tcs = ManagedBuildManager.getExtensionToolChains(pt);
- for(int i = 0; i < tcs.length; i++){
- IToolChain t = tcs[i];
- if(t.isSystemObject())
- continue;
- if (!isValid(t, supportedOnly, wizard))
- continue;
+ AutotoolsBuildWizardHandler h = new AutotoolsBuildWizardHandler(pt, parent, wizard);
+ IToolChain[] tcs = ManagedBuildManager.getExtensionToolChains(pt);
+ for(int i = 0; i < tcs.length; i++){
+ IToolChain t = tcs[i];
- h.addTc(t);
+ IToolChain parent = t;
+ while (parent.getSuperClass() != null) {
+ parent = parent.getSuperClass();
}
- String pId = null;
- if (CDTPrefUtil.getBool(CDTPrefUtil.KEY_OTHERS)) {
- if (oldsRoot == null) {
- oldsRoot = new EntryDescriptor(OTHERS_LABEL, null, OTHERS_LABEL, true, null, null);
- items.add(oldsRoot);
- }
- pId = oldsRoot.getId();
- } else { // do not group to <Others>
- pId = null;
+ if (!parent.getId().equals(AUTOTOOLS_TOOLCHAIN_ID))
+ continue;
+
+ if(t.isSystemObject())
+ continue;
+ if (!isValid(t, supportedOnly, wizard))
+ continue;
+
+ h.addTc(t);
+ }
+
+ String pId = null;
+ if (CDTPrefUtil.getBool(CDTPrefUtil.KEY_OTHERS)) {
+ if (oldsRoot == null) {
+ oldsRoot = new EntryDescriptor(OTHERS_LABEL, null, OTHERS_LABEL, true, null, null);
+ items.add(oldsRoot);
}
- items.add(new EntryDescriptor(pt.getId(), pId, pt.getName(), true, h, null));
+ pId = oldsRoot.getId();
+ } else { // do not group to <Others>
+ pId = null;
}
+
+ if (h.getToolChainsCount() > 0)
+ items.add(new EntryDescriptor(pt.getId(), pId, pt.getName(), true, h, null));
}
+
return (EntryDescriptor[])items.toArray(new EntryDescriptor[items.size()]);
}
}

Back to the top