mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 22:22:11 +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:
parent
90ecfa9d5e
commit
179924ef5c
2 changed files with 43 additions and 23 deletions
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
items.add(new EntryDescriptor(pt.getId(), pId, pt.getName(), true, h, 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);
|
||||
}
|
||||
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()]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue