1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fix for problem with tool-chain defined at top level in manifest

This commit is contained in:
Leo Treggiari 2005-07-02 20:34:48 +00:00
parent 841ba5d06f
commit c488f8ca33
2 changed files with 8 additions and 6 deletions

View file

@ -309,9 +309,9 @@ public class Configuration extends BuildObject implements IConfiguration {
// the selected configuration element, create a tool element child of
// the cloned configuration's tool-chain element that specifies the
// original tool element as its superClass.
Iterator iter = superChain.getToolList().listIterator();
while (iter.hasNext()) {
Tool toolChild = (Tool) iter.next();
ITool[] tools = superChain.getTools();
for (int i=0; i<tools.length; i++) {
Tool toolChild = (Tool)tools[i];
nnn = ManagedBuildManager.getRandomNumber();
tmpId = toolChild.getId();
version = ManagedBuildManager.getVersionFromIdAndVersion(tmpId);

View file

@ -25,6 +25,7 @@ import org.eclipse.cdt.managedbuilder.core.IProjectType;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.IToolChain;
import org.eclipse.cdt.managedbuilder.core.IResourceConfiguration;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IInputType;
import org.eclipse.cdt.managedbuilder.core.IInputOrder;
import org.eclipse.cdt.managedbuilder.core.IAdditionalInput;
@ -687,16 +688,17 @@ public class InputType extends BuildObject implements IInputType {
* Returns the project that uses this IInputType
*/
public IProject getProject(ITool tool) {
IProject project = null;
IBuildObject toolParent = tool.getParent();
if (toolParent != null) {
if (toolParent instanceof IToolChain) {
return (IProject)((IToolChain)toolParent).getParent().getOwner();
IConfiguration config = ((IToolChain)toolParent).getParent();
if (config == null) return null;
return (IProject)config.getOwner();
} else if (toolParent instanceof IResourceConfiguration) {
return (IProject)((IResourceConfiguration)toolParent).getOwner();
}
}
return project;
return null;
}
/* (non-Javadoc)