1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-27 19:05:38 +02:00

Apply Chris' patch to handle ToolChain versions

This commit is contained in:
Leo Treggiari 2005-06-03 03:10:28 +00:00
parent 041dbf3c91
commit 03c8b2fa41
2 changed files with 13 additions and 11 deletions

View file

@ -187,20 +187,21 @@ public final class MBSCustomPageData
{ {
ToolchainData tcd = (ToolchainData) iterator.next(); ToolchainData tcd = (ToolchainData) iterator.next();
// look for toolchain with same id // look for toolchain with same id. The id in the tool-chain data should never
// contain a version suffix.
if (tcd.getId().equals(id)) if (tcd.getId().equals(id))
{ {
// if we don't check versions then we're done // if we don't check versions then we're done
if (version == null) if (tcd.getVersionsSupported() == null)
return true; return true;
// does the toolchain have a compatible version?
// is the toolchain of one of the specified versions?
for (int k = 0; k < tcd.getVersionsSupported().length; k++) for (int k = 0; k < tcd.getVersionsSupported().length; k++)
{ {
// TODO: implement version support - should this check for an exact match? // check for an exact version match
// An older version of a tool-chain could use a different custom page if (tcd.getVersionsSupported()[k].equals(version))
// than a newer version.
if (tcd.getVersionsSupported()[k].compareTo(version) >= 0)
{ {
return true; return true;
} }

View file

@ -12,6 +12,7 @@ package org.eclipse.cdt.managedbuilder.ui.wizards;
import org.eclipse.cdt.managedbuilder.core.BuildException; import org.eclipse.cdt.managedbuilder.core.BuildException;
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.internal.ui.ManagedBuilderUIMessages; import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIMessages;
import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtension;
@ -363,11 +364,11 @@ public final class MBSCustomPageManager
while (toolchainIterator.hasNext()) while (toolchainIterator.hasNext())
{ {
IToolChain toolchain = (IToolChain) toolchainIterator.next(); IToolChain toolchain = (IToolChain) toolchainIterator.next();
String id = ManagedBuildManager.getIdFromIdAndVersion(toolchain.getId());
String version = ManagedBuildManager.getVersionFromIdAndVersion(toolchain.getId());
// get the ID and version // check the ID and version
// version support in MBS is not complete yet so just check the id for now if (page.shouldBeVisibleForToolchain(id, version))
// TODO: implement version support
if (toolchain.getId().equals(toolchainData[k].getId()))
{ {
return true; return true;
} }