1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 06:32:10 +02:00

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]
This commit is contained in:
Jeff Johnston 2012-03-29 17:37:48 -04:00
parent 90ecfa9d5e
commit 179924ef5c
2 changed files with 43 additions and 23 deletions

View file

@ -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> 2012-01-03 Jeff Johnston <jjohnstn@redhat.com>
Refactor entire plug-in to org.eclipse.cdt.autotools.ui. Refactor entire plug-in to org.eclipse.cdt.autotools.ui.

View file

@ -40,6 +40,8 @@ public class AutotoolsBuildWizard extends AbstractCWizard {
* @since 5.1 * @since 5.1
*/ */
public static final String EMPTY_PROJECT = AutotoolsWizardMessages.getResourceString("AutotoolsBuildWizard.2"); //$NON-NLS-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 * Creates and returns an array of items to be displayed
*/ */
@ -50,16 +52,26 @@ public class AutotoolsBuildWizard extends AbstractCWizard {
Arrays.sort(vs, BuildListComparator.getInstance()); Arrays.sort(vs, BuildListComparator.getInstance());
ArrayList<EntryDescriptor> items = new ArrayList<EntryDescriptor>(); 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; EntryDescriptor oldsRoot = null;
SortedMap<String, IProjectType> sm = ManagedBuildManager.getExtensionProjectTypeMap(); SortedMap<String, IProjectType> sm = ManagedBuildManager.getExtensionProjectTypeMap();
for (Map.Entry<String, IProjectType> e : sm.entrySet()) { for (Map.Entry<String, IProjectType> e : sm.entrySet()) {
IProjectType pt = e.getValue(); IProjectType pt = e.getValue();
if (pt.getId().equals(AUTOTOOLS_PROJECTTYPE_ID)) {
AutotoolsBuildWizardHandler h = new AutotoolsBuildWizardHandler(pt, parent, wizard); AutotoolsBuildWizardHandler h = new AutotoolsBuildWizardHandler(pt, parent, wizard);
IToolChain[] tcs = ManagedBuildManager.getExtensionToolChains(pt); IToolChain[] tcs = ManagedBuildManager.getExtensionToolChains(pt);
for(int i = 0; i < tcs.length; i++){ for(int i = 0; i < tcs.length; i++){
IToolChain t = tcs[i]; IToolChain t = tcs[i];
IToolChain parent = t;
while (parent.getSuperClass() != null) {
parent = parent.getSuperClass();
}
if (!parent.getId().equals(AUTOTOOLS_TOOLCHAIN_ID))
continue;
if(t.isSystemObject()) if(t.isSystemObject())
continue; continue;
if (!isValid(t, supportedOnly, wizard)) if (!isValid(t, supportedOnly, wizard))
@ -78,9 +90,11 @@ public class AutotoolsBuildWizard extends AbstractCWizard {
} else { // do not group to <Others> } else { // do not group to <Others>
pId = null; pId = null;
} }
if (h.getToolChainsCount() > 0)
items.add(new EntryDescriptor(pt.getId(), pId, pt.getName(), true, h, null)); items.add(new EntryDescriptor(pt.getId(), pId, pt.getName(), true, h, null));
} }
}
return (EntryDescriptor[])items.toArray(new EntryDescriptor[items.size()]); return (EntryDescriptor[])items.toArray(new EntryDescriptor[items.size()]);
} }
} }