From 27d7f76135f6deb999f79af3cc0444093685cb5e Mon Sep 17 00:00:00 2001 From: Mikhail Sennikovsky Date: Thu, 29 Mar 2007 11:51:46 +0000 Subject: [PATCH] Tool-chain modification functionality fixes --- .../internal/core/FolderInfo.java | 63 ++++++++++++++++++- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java index bdc0d9f914a..0c652d7a42d 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java @@ -739,12 +739,26 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { } public IToolChain changeToolChain(IToolChain newSuperClass, String Id, String name) throws BuildException{ - if(newSuperClass == null) + boolean usePrefTc = false; + if(newSuperClass == null){ newSuperClass = ManagedBuildManager.getExtensionToolChain(ConfigurationDataProvider.PREF_TC_ID); + usePrefTc = true; + } + + if(newSuperClass == null) + return toolChain; IToolChain curReal = ManagedBuildManager.getRealToolChain(toolChain); IToolChain newReal = ManagedBuildManager.getRealToolChain(newSuperClass); + if(Id == null){ + Id = ManagedBuildManager.calculateChildId(newSuperClass.getId(), null); + } + + if(name == null){ + name = newSuperClass.getName(); + } + if(newReal != curReal){ IToolChain extTc = ManagedBuildManager.getExtensionToolChain(newSuperClass); if(extTc != null) @@ -756,7 +770,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { if(el != null){ updateToolChainWithConverter(el, newSuperClass, Id, name); } else { - updateToolChainWithProperties(newSuperClass, Id, name); + updateToolChainWithProperties(usePrefTc ? null : newSuperClass, Id, name); } BuildSettingsUtil.disconnectDepentents(getParent(), oldTools); @@ -768,15 +782,58 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { ToolChain oldTc = (ToolChain)getToolChain(); if(newSuperClass != null) { createToolChain(newSuperClass, Id, name, false); + + // For each option/option category child of the tool-chain that is + // the child of the selected configuration element, create an option/ + // option category child of the cloned configuration's tool-chain element + // that specifies the original tool element as its superClass. + toolChain.createOptions(newSuperClass); + + // For each tool element child of the tool-chain that is the child of + // 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. + String subId; + ITool[] tools = newSuperClass.getTools(); + for (int i=0; i