mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Additional core fix for [bug 205840] Should file-level tool be updated when project toolchain changes?
This commit is contained in:
parent
6fb8484d00
commit
b8a19bed37
16 changed files with 212 additions and 63 deletions
|
@ -63,7 +63,7 @@ public class ToolChainModificationTests extends BasicTestCase {
|
|||
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(des.getConfigurations()[0]);
|
||||
IToolChainModificationManager mngr = ManagedBuildManager.getToolChainModificationManager();
|
||||
|
||||
IConfigurationModification cfgM = (IConfigurationModification)mngr.getModification(cfg.getRootFolderInfo());
|
||||
IConfigurationModification cfgM = (IConfigurationModification)mngr.createModification(cfg.getRootFolderInfo());
|
||||
assertTrue(cfgM.isToolChainCompatible());
|
||||
assertTrue(cfgM.isBuilderCompatible());
|
||||
|
||||
|
@ -132,7 +132,7 @@ public class ToolChainModificationTests extends BasicTestCase {
|
|||
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(des.getConfigurations()[0]);
|
||||
IToolChainModificationManager mngr = ManagedBuildManager.getToolChainModificationManager();
|
||||
|
||||
IConfigurationModification cfgM = (IConfigurationModification)mngr.getModification(cfg.getRootFolderInfo());
|
||||
IConfigurationModification cfgM = (IConfigurationModification)mngr.createModification(cfg.getRootFolderInfo());
|
||||
assertEquals(cfgM.getToolChain(), cfg.getToolChain());
|
||||
assertTrue(cfgM.isToolChainCompatible());
|
||||
assertTrue(cfgM.isBuilderCompatible());
|
||||
|
@ -142,11 +142,11 @@ public class ToolChainModificationTests extends BasicTestCase {
|
|||
fo.create(true, true, null);
|
||||
|
||||
IFolderInfo foInfo = cfg.createFolderInfo(foPath);
|
||||
IFolderInfoModification foM = mngr.getModification(foInfo);
|
||||
IFolderInfoModification foM = mngr.createModification(foInfo);
|
||||
assertEquals(foM.getToolChain(), foInfo.getToolChain());
|
||||
assertTrue(foM.isToolChainCompatible());
|
||||
|
||||
cfgM = (IConfigurationModification)mngr.getModification(cfg.getRootFolderInfo());
|
||||
cfgM = (IConfigurationModification)mngr.createModification(cfg.getRootFolderInfo());
|
||||
assertEquals(cfgM.getToolChain(), cfg.getToolChain());
|
||||
assertTrue(cfgM.isToolChainCompatible());
|
||||
assertTrue(cfgM.isBuilderCompatible());
|
||||
|
@ -165,9 +165,9 @@ public class ToolChainModificationTests extends BasicTestCase {
|
|||
foM.setToolChain(incompatibleTc);
|
||||
assertFalse(foM.isToolChainCompatible());
|
||||
foInfo.changeToolChain(incompatibleTc, CDataUtil.genId("blah.blah"), incompatibleTc.getName());
|
||||
cfgM = (IConfigurationModification)mngr.getModification(cfg.getRootFolderInfo());
|
||||
cfgM = (IConfigurationModification)mngr.createModification(cfg.getRootFolderInfo());
|
||||
assertTrue(cfgM.isToolChainCompatible());
|
||||
foM = mngr.getModification(foInfo);
|
||||
foM = mngr.createModification(foInfo);
|
||||
assertFalse(foM.isToolChainCompatible());
|
||||
|
||||
project.delete(true, null);
|
||||
|
@ -183,7 +183,7 @@ public class ToolChainModificationTests extends BasicTestCase {
|
|||
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(des.getConfigurations()[0]);
|
||||
IToolChainModificationManager mngr = ManagedBuildManager.getToolChainModificationManager();
|
||||
|
||||
IConfigurationModification cfgM = (IConfigurationModification)mngr.getModification(cfg.getRootFolderInfo());
|
||||
IConfigurationModification cfgM = (IConfigurationModification)mngr.createModification(cfg.getRootFolderInfo());
|
||||
assertEquals(cfgM.getToolChain(), cfg.getToolChain());
|
||||
assertTrue(cfgM.isToolChainCompatible());
|
||||
assertTrue(cfgM.isBuilderCompatible());
|
||||
|
@ -193,11 +193,11 @@ public class ToolChainModificationTests extends BasicTestCase {
|
|||
fo.create(true, true, null);
|
||||
|
||||
IFolderInfo foInfo = cfg.createFolderInfo(foPath);
|
||||
IFolderInfoModification foM = mngr.getModification(foInfo);
|
||||
IFolderInfoModification foM = mngr.createModification(foInfo);
|
||||
assertEquals(foM.getToolChain(), foInfo.getToolChain());
|
||||
assertTrue(foM.isToolChainCompatible());
|
||||
|
||||
cfgM = (IConfigurationModification)mngr.getModification(cfg.getRootFolderInfo());
|
||||
cfgM = (IConfigurationModification)mngr.createModification(cfg.getRootFolderInfo());
|
||||
assertEquals(cfgM.getToolChain(), cfg.getToolChain());
|
||||
assertTrue(cfgM.isToolChainCompatible());
|
||||
assertTrue(cfgM.isBuilderCompatible());
|
||||
|
@ -222,9 +222,9 @@ public class ToolChainModificationTests extends BasicTestCase {
|
|||
foM.setToolChain(ManagedBuildManager.getExtensionToolChain("tcm.derive2.tc1"));
|
||||
assertFalse(foM.isToolChainCompatible());
|
||||
foInfo.changeToolChain(ManagedBuildManager.getExtensionToolChain("tcm.derive2.tc1"), CDataUtil.genId("blah.blah"), null);
|
||||
cfgM = (IConfigurationModification)mngr.getModification(cfg.getRootFolderInfo());
|
||||
cfgM = (IConfigurationModification)mngr.createModification(cfg.getRootFolderInfo());
|
||||
assertTrue(cfgM.isToolChainCompatible());
|
||||
foM = mngr.getModification(foInfo);
|
||||
foM = mngr.createModification(foInfo);
|
||||
assertFalse(foM.isToolChainCompatible());
|
||||
|
||||
project.delete(true, null);
|
||||
|
@ -324,7 +324,7 @@ public class ToolChainModificationTests extends BasicTestCase {
|
|||
|
||||
IToolChainModificationManager mngr = ManagedBuildManager.getToolChainModificationManager();
|
||||
|
||||
IConfigurationModification cfgM = (IConfigurationModification)mngr.getModification(cfg.getRootFolderInfo());
|
||||
IConfigurationModification cfgM = (IConfigurationModification)mngr.createModification(cfg.getRootFolderInfo());
|
||||
assertEquals(cfgM.getToolChain(), cfg.getToolChain());
|
||||
assertTrue(cfgM.isToolChainCompatible());
|
||||
assertTrue(cfgM.isBuilderCompatible());
|
||||
|
@ -334,11 +334,11 @@ public class ToolChainModificationTests extends BasicTestCase {
|
|||
fo.create(true, true, null);
|
||||
|
||||
IFolderInfo foInfo = cfg.createFolderInfo(foPath);
|
||||
IFolderInfoModification foM = mngr.getModification(foInfo);
|
||||
IFolderInfoModification foM = mngr.createModification(foInfo);
|
||||
assertEquals(foM.getToolChain(), foInfo.getToolChain());
|
||||
assertTrue(foM.isToolChainCompatible());
|
||||
|
||||
cfgM = (IConfigurationModification)mngr.getModification(cfg.getRootFolderInfo());
|
||||
cfgM = (IConfigurationModification)mngr.createModification(cfg.getRootFolderInfo());
|
||||
assertEquals(cfgM.getToolChain(), cfg.getToolChain());
|
||||
assertTrue(cfgM.isToolChainCompatible());
|
||||
assertTrue(cfgM.isBuilderCompatible());
|
||||
|
|
|
@ -2704,4 +2704,8 @@ public class Builder extends BuildObject implements IBuilder, IMatchKeyProvider,
|
|||
public boolean isRealBuildObject() {
|
||||
return ManagedBuildManager.getRealBuilder(this) == this;
|
||||
}
|
||||
|
||||
public boolean isExtensionBuildObject() {
|
||||
return isExtensionElement();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3027,4 +3027,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
|||
public String getUniqueRealName() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
public boolean isExtensionBuildObject() {
|
||||
return isExtensionElement();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@ public interface IRealBuildObjectAssociation extends IBuildObject {
|
|||
|
||||
boolean isRealBuildObject();
|
||||
|
||||
boolean isExtensionBuildObject();
|
||||
|
||||
IRealBuildObjectAssociation[] getIdenticBuildObjects();
|
||||
|
||||
IRealBuildObjectAssociation getSuperClassObject();
|
||||
|
|
|
@ -4209,4 +4209,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
|
|||
public boolean isRealBuildObject() {
|
||||
return getRealBuildObject() == this;
|
||||
}
|
||||
|
||||
public boolean isExtensionBuildObject() {
|
||||
return isExtensionElement();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2796,4 +2796,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IBuildPropert
|
|||
public boolean isRealBuildObject() {
|
||||
return getRealBuildObject() == this;
|
||||
}
|
||||
|
||||
public boolean isExtensionBuildObject() {
|
||||
return isExtensionElement();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,6 +79,16 @@ public class ConfigurationModification extends FolderInfoModification implements
|
|||
setBuilder(foInfo.getParent().getBuilder());
|
||||
}
|
||||
|
||||
public ConfigurationModification(FolderInfo foInfo, ConfigurationModification base) {
|
||||
super(foInfo, base);
|
||||
|
||||
fSelectedBuilder = base.fSelectedBuilder;
|
||||
if(!fSelectedBuilder.isExtensionElement())
|
||||
fSelectedBuilder = ManagedBuildManager.getExtensionBuilder(fSelectedBuilder);
|
||||
|
||||
fRealBuilder = base.fRealBuilder;
|
||||
}
|
||||
|
||||
public IBuilder getBuilder() {
|
||||
return fSelectedBuilder;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,10 @@ public class FileInfoModification extends
|
|||
super(rcInfo, rcInfo.getTools());
|
||||
}
|
||||
|
||||
public FileInfoModification(ResourceConfiguration rcInfo, FileInfoModification base) {
|
||||
super(rcInfo, base);
|
||||
}
|
||||
|
||||
protected boolean canRemove(ITool realTool) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -58,6 +58,15 @@ public class FolderInfoModification extends ToolListModification implements IFol
|
|||
fRealToolChain = (ToolChain)ManagedBuildManager.getRealToolChain(fSelectedToolChain);
|
||||
}
|
||||
|
||||
public FolderInfoModification(FolderInfo foInfo, FolderInfoModification base) {
|
||||
super(foInfo, base);
|
||||
fSelectedToolChain = base.fSelectedToolChain;
|
||||
if(!fSelectedToolChain.isExtensionElement())
|
||||
fSelectedToolChain = (ToolChain)fSelectedToolChain.getExtensionObject();
|
||||
|
||||
fRealToolChain = base.fRealToolChain;
|
||||
}
|
||||
|
||||
private ConflictMatchSet getParentConflictMatchSet(){
|
||||
if(fParentConflicts == null){
|
||||
PerTypeMapStorage storage = getParentObjectStorage();
|
||||
|
|
|
@ -13,7 +13,7 @@ package org.eclipse.cdt.managedbuilder.internal.tcmodification;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class PerTypeMapStorage {
|
||||
public class PerTypeMapStorage implements Cloneable {
|
||||
private ObjectTypeBasedStorage fStorage = new ObjectTypeBasedStorage();
|
||||
|
||||
public Map getMap(int type, boolean create){
|
||||
|
@ -30,4 +30,20 @@ public class PerTypeMapStorage {
|
|||
return new HashMap();
|
||||
return (Map)((HashMap)map).clone();
|
||||
}
|
||||
|
||||
public Object clone(){
|
||||
try {
|
||||
PerTypeMapStorage clone = (PerTypeMapStorage)super.clone();
|
||||
int types[] = ObjectTypeBasedStorage.getSupportedObjectTypes();
|
||||
for(int i = 0; i < types.length; i++){
|
||||
Object o = clone.fStorage.get(types[i]);
|
||||
if(o != null){
|
||||
clone.fStorage.set(types[i], clone.createMap((Map)o));
|
||||
}
|
||||
}
|
||||
} catch (CloneNotSupportedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,6 +117,21 @@ public class TcModificationUtil {
|
|||
return storage;
|
||||
}
|
||||
|
||||
public static PerTypeMapStorage cloneRealToolToPathSet(PerTypeMapStorage starage){
|
||||
starage = (PerTypeMapStorage)starage.clone();
|
||||
int types[] = ObjectTypeBasedStorage.getSupportedObjectTypes();
|
||||
for(int i = 0; i < types.length; i++){
|
||||
Map map = starage.getMap(types[i], false);
|
||||
if(map != null){
|
||||
for(Iterator iter = map.entrySet().iterator(); iter.hasNext(); ){
|
||||
Map.Entry entry = (Map.Entry)iter.next();
|
||||
entry.setValue(((TreeSet)entry.getValue()).clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return starage;
|
||||
}
|
||||
|
||||
public static PerTypeMapStorage createRealToolToPathSet(IConfiguration cfg, PerTypeMapStorage skipMapStorage, boolean addSkipPaths){
|
||||
PerTypeMapStorage storage = new PerTypeMapStorage();
|
||||
|
@ -448,6 +463,17 @@ public class TcModificationUtil {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static TreeMap clonePathMap(TreeMap map){
|
||||
map = (TreeMap)map.clone();
|
||||
|
||||
for(Iterator iter = map.entrySet().iterator(); iter.hasNext(); ){
|
||||
Map.Entry entry = (Map.Entry)iter.next();
|
||||
entry.setValue(((PerTypeSetStorage)entry.getValue()).clone());
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
private static boolean pathContainsObjects(PerTypeMapStorage storage, IPath path, int type){
|
||||
Map map = storage.getMap(type, false);
|
||||
if(map == null)
|
||||
|
|
|
@ -20,8 +20,10 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IFileInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.FolderInfo;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.IRealBuildObjectAssociation;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ResourceConfiguration;
|
||||
|
@ -30,6 +32,8 @@ import org.eclipse.cdt.managedbuilder.internal.tcmodification.extension.RulesMan
|
|||
import org.eclipse.cdt.managedbuilder.tcmodification.IFileInfoModification;
|
||||
import org.eclipse.cdt.managedbuilder.tcmodification.IFolderInfoModification;
|
||||
import org.eclipse.cdt.managedbuilder.tcmodification.IToolChainModificationManager;
|
||||
import org.eclipse.cdt.managedbuilder.tcmodification.IToolListModification;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
||||
public class ToolChainModificationManager implements
|
||||
IToolChainModificationManager {
|
||||
|
@ -54,17 +58,57 @@ public class ToolChainModificationManager implements
|
|||
RulesManager.getInstance().start();
|
||||
}
|
||||
|
||||
public IFileInfoModification getModification(IFileInfo rcInfo) {
|
||||
public IFileInfoModification createModification(IFileInfo rcInfo) {
|
||||
return new FileInfoModification((ResourceConfiguration)rcInfo);
|
||||
}
|
||||
|
||||
public IFolderInfoModification getModification(IFolderInfo rcInfo) {
|
||||
public IFolderInfoModification createModification(IFolderInfo rcInfo) {
|
||||
FolderInfo foInfo = (FolderInfo)rcInfo;
|
||||
if(foInfo.isRoot())
|
||||
return new ConfigurationModification(foInfo);
|
||||
return new FolderInfoModification(foInfo);
|
||||
}
|
||||
|
||||
public IFolderInfoModification createModification(IConfiguration cfg,
|
||||
IFolderInfoModification base) throws IllegalArgumentException {
|
||||
IResourceInfo baseRcInfo = base.getResourceInfo();
|
||||
IPath path = baseRcInfo.getPath();
|
||||
IResourceInfo rcInfo = cfg.getResourceInfo(path, true);
|
||||
FolderInfo folderInfo;
|
||||
if(rcInfo != null){
|
||||
if(rcInfo instanceof FolderInfo){
|
||||
folderInfo = (FolderInfo)rcInfo;
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
} else {
|
||||
folderInfo = (FolderInfo)cfg.createFolderInfo(path);
|
||||
}
|
||||
|
||||
return folderInfo.isRoot() ?
|
||||
new ConfigurationModification(folderInfo, (ConfigurationModification)base)
|
||||
: new FolderInfoModification(folderInfo, (FolderInfoModification)base);
|
||||
}
|
||||
|
||||
public IFileInfoModification createModification(IConfiguration cfg,
|
||||
IFileInfoModification base) throws IllegalArgumentException {
|
||||
IResourceInfo baseRcInfo = base.getResourceInfo();
|
||||
IPath path = baseRcInfo.getPath();
|
||||
IResourceInfo rcInfo = cfg.getResourceInfo(path, true);
|
||||
ResourceConfiguration fileInfo;
|
||||
if(rcInfo != null){
|
||||
if(rcInfo instanceof ResourceConfiguration){
|
||||
fileInfo = (ResourceConfiguration)rcInfo;
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
} else {
|
||||
fileInfo = (ResourceConfiguration)cfg.createFileInfo(path);
|
||||
}
|
||||
|
||||
return new FileInfoModification(fileInfo, (FileInfoModification)base);
|
||||
}
|
||||
|
||||
public static boolean checkFlags(int flags, int value){
|
||||
return (flags & value) == value;
|
||||
}
|
||||
|
@ -77,38 +121,6 @@ public class ToolChainModificationManager implements
|
|||
return flags &= (~value);
|
||||
}
|
||||
|
||||
// public static final int SCOPE_MATCH_EXACT = 1;
|
||||
// public static final int SCOPE_MATCH_PARTIAL = 1 << 1;
|
||||
// public static final int SCOPE_MATCH_SCOPE_COVERS = 1 << 2;
|
||||
// public static final int SCOPE_MATCH_SET_SCOPE_COVERS = 1 << 3;
|
||||
// public static final int SCOPE_MATCH_NO = 1 << 4;
|
||||
// public static final int SCOPE_MATCH_ANY_MATCH =
|
||||
// SCOPE_MATCH_EXACT
|
||||
// | SCOPE_MATCH_PARTIAL
|
||||
// | SCOPE_MATCH_SCOPE_COVERS
|
||||
// | SCOPE_MATCH_SET_SCOPE_COVERS;
|
||||
//
|
||||
//
|
||||
// public static boolean matchScope(int scope, int setScope, int matchType){
|
||||
// int applicableTypes = 0;
|
||||
// if(scope == setScope){
|
||||
// applicableTypes |= SCOPE_MATCH_EXACT;
|
||||
// } else {
|
||||
// int conjunction = scope & setScope;
|
||||
// if(conjunction == scope){
|
||||
// applicableTypes |= SCOPE_MATCH_SET_SCOPE_COVERS;
|
||||
// } else if (conjunction == setScope) {
|
||||
// applicableTypes |= SCOPE_MATCH_SCOPE_COVERS;
|
||||
// } else if (conjunction == 0){
|
||||
// applicableTypes |= SCOPE_MATCH_NO;
|
||||
// } else {
|
||||
// applicableTypes |= SCOPE_MATCH_PARTIAL;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return (applicableTypes & matchType) != 0;
|
||||
// }
|
||||
|
||||
private boolean getMatchingObjects(int type, IObjectSet[] oSets, Set skipSet, IRealBuildObjectAssociation additionalSkip, Set result){
|
||||
Set tmp = null;
|
||||
boolean added = false;
|
||||
|
|
|
@ -50,17 +50,17 @@ import org.eclipse.core.runtime.Status;
|
|||
public abstract class ToolListModification implements
|
||||
IToolListModification {
|
||||
// private Tool []fTools;
|
||||
private Set fInputExtsSet = new HashSet();
|
||||
private HashSet fInputExtsSet = new HashSet();
|
||||
private ResourceInfo fRcInfo;
|
||||
private LinkedHashMap fProjCompInfoMap = new LinkedHashMap();
|
||||
private HashMap fSysCompInfoMap = new HashMap();
|
||||
private Tool[] fAllSysTools;
|
||||
private Set fFilteredOutSysTools;
|
||||
private HashSet fFilteredOutSysTools;
|
||||
// private LinkedHashMap fRealToToolMap = new LinkedHashMap();
|
||||
// private boolean fSysInfoMapInited;
|
||||
private PerTypeMapStorage fCompleteObjectStorage;
|
||||
private TreeMap fCompletePathMapStorage;
|
||||
private Set fAddCapableTools;
|
||||
private HashSet fAddCapableTools;
|
||||
private Map fFilteredOutTools;
|
||||
|
||||
private ToolListModificationInfo fModificationInfo;
|
||||
|
@ -378,6 +378,55 @@ public abstract class ToolListModification implements
|
|||
clearToolInfo(tools);
|
||||
}
|
||||
|
||||
public ToolListModification(ResourceInfo rcInfo, ToolListModification base){
|
||||
fRcInfo = rcInfo;
|
||||
Tool[] initialTools = (Tool[])rcInfo.getTools();
|
||||
Map initRealToToolMap = TcModificationUtil.getRealToObjectsMap(initialTools, new LinkedHashMap());
|
||||
Tool[] updatedTools = base.getTools(true, false);
|
||||
Map updatedRealToToolMap = TcModificationUtil.getRealToObjectsMap(updatedTools, new LinkedHashMap());
|
||||
for(Iterator iter = updatedRealToToolMap.entrySet().iterator(); iter.hasNext(); ){
|
||||
Map.Entry entry = (Map.Entry)iter.next();
|
||||
Object real = entry.getKey();
|
||||
Object initial = initRealToToolMap.get(real);
|
||||
if(initial != null){
|
||||
entry.setValue(initial);
|
||||
} else {
|
||||
IRealBuildObjectAssociation updated = (IRealBuildObjectAssociation)entry.getValue();
|
||||
if(!updated.isExtensionBuildObject()){
|
||||
updated = updated.getExtensionObject();
|
||||
entry.setValue(updated);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updatedRealToToolMap.values().toArray(updatedTools);
|
||||
clearToolInfo(updatedTools);
|
||||
|
||||
// if(base.fInputExtsSet != null)
|
||||
// fInputExtsSet = (HashSet)base.fInputExtsSet.clone();
|
||||
// private LinkedHashMap fProjCompInfoMap = new LinkedHashMap();
|
||||
// private HashMap fSysCompInfoMap = new HashMap();
|
||||
if(base.fAllSysTools != null)
|
||||
fAllSysTools = (Tool[])base.fAllSysTools.clone();
|
||||
|
||||
if(base.fFilteredOutSysTools != null)
|
||||
fFilteredOutSysTools = (HashSet)base.fFilteredOutSysTools.clone();
|
||||
|
||||
if(base.fCompleteObjectStorage != null){
|
||||
fCompleteObjectStorage = TcModificationUtil.cloneRealToolToPathSet(base.fCompleteObjectStorage);
|
||||
}
|
||||
|
||||
if(base.fCompletePathMapStorage != null){
|
||||
fCompletePathMapStorage = base.fCompletePathMapStorage;
|
||||
}
|
||||
// if(base.fAddCapableTools)
|
||||
// fAddCapableTools = (HashSet)base.fAddCapableTools.clone();
|
||||
//private Map fFilteredOutTools;
|
||||
|
||||
// private ToolListModificationInfo fModificationInfo;
|
||||
}
|
||||
|
||||
|
||||
public IResourceInfo getResourceInfo(){
|
||||
return fRcInfo;
|
||||
}
|
||||
|
@ -440,7 +489,7 @@ public abstract class ToolListModification implements
|
|||
if(fAllSysTools == null){
|
||||
ITool[] allSys = ManagedBuildManager.getRealTools();
|
||||
fAllSysTools = filterTools((Tool[])allSys);
|
||||
Set set = new HashSet(Arrays.asList(allSys));
|
||||
HashSet set = new HashSet(Arrays.asList(allSys));
|
||||
set.removeAll(Arrays.asList(fAllSysTools));
|
||||
fFilteredOutSysTools = set;
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.tcmodification;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IFileInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.IRealBuildObjectAssociation;
|
||||
|
@ -28,7 +29,7 @@ public interface IToolChainModificationManager {
|
|||
* @param rcInfo
|
||||
* @return
|
||||
*/
|
||||
IFolderInfoModification getModification(IFolderInfo rcInfo);
|
||||
IFolderInfoModification createModification(IFolderInfo rcInfo);
|
||||
|
||||
/**
|
||||
* returns the modification info calculator for the given file info
|
||||
|
@ -36,5 +37,9 @@ public interface IToolChainModificationManager {
|
|||
* @param rcInfo
|
||||
* @return
|
||||
*/
|
||||
IFileInfoModification getModification(IFileInfo rcInfo);
|
||||
IFileInfoModification createModification(IFileInfo rcInfo);
|
||||
|
||||
IFolderInfoModification createModification(IConfiguration cfg, IFolderInfoModification base) throws IllegalArgumentException;
|
||||
|
||||
IFileInfoModification createModification(IConfiguration cfg, IFileInfoModification base) throws IllegalArgumentException;
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab {
|
|||
|
||||
private void showErrorMessage() {
|
||||
if (ri instanceof IFolderInfo) {
|
||||
IFolderInfoModification foim = tcmm.getModification((IFolderInfo)ri);
|
||||
IFolderInfoModification foim = tcmm.createModification((IFolderInfo)ri);
|
||||
if (foim.isToolChainCompatible()) {
|
||||
st_toolchain.setText(EMPTY_STR);
|
||||
} else {
|
||||
|
@ -186,7 +186,7 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab {
|
|||
}
|
||||
}
|
||||
} else { // FileInfo
|
||||
IFileInfoModification fim = tcmm.getModification((IFileInfo)ri);
|
||||
IFileInfoModification fim = tcmm.createModification((IFileInfo)ri);
|
||||
fim.getProjectToolModifications();
|
||||
}
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab {
|
|||
|
||||
IToolChain[] tcs = r_tcs;
|
||||
if (b_dispCompatible.getSelection() && (ri instanceof IFolderInfo)) {
|
||||
IFolderInfoModification fim = tcmm.getModification((IFolderInfo)ri);
|
||||
IFolderInfoModification fim = tcmm.createModification((IFolderInfo)ri);
|
||||
tcs = fim.getCompatibleToolChains();
|
||||
IToolChain[] tcs1 = new IToolChain[tcs.length + 1];
|
||||
System.arraycopy(tcs, 0, tcs1, 0, tcs.length);
|
||||
|
@ -245,7 +245,7 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab {
|
|||
IBuilder[] bs = r_bs;
|
||||
|
||||
if (b_dispCompatible.getSelection() && (ri instanceof IFolderInfo)) {
|
||||
IFolderInfoModification fim = tcmm.getModification((IFolderInfo)ri);
|
||||
IFolderInfoModification fim = tcmm.createModification((IFolderInfo)ri);
|
||||
if (fim instanceof IConfigurationModification) {
|
||||
IBuilder[] bs1 = ((IConfigurationModification)fim).getCompatibleBuilders();
|
||||
bs = new IBuilder[bs1.length + 1];
|
||||
|
@ -347,7 +347,7 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab {
|
|||
st_tool.setImage(null);
|
||||
if (tool == null)
|
||||
return;
|
||||
IFileInfoModification fim = tcmm.getModification((IFileInfo)ri);
|
||||
IFileInfoModification fim = tcmm.createModification((IFileInfo)ri);
|
||||
IToolModification tm = fim.getToolModification(tool);
|
||||
if (tm != null && !tm.isCompatible()) {
|
||||
CompatibilityStatus cs = tm.getCompatibilityStatus();
|
||||
|
@ -361,7 +361,7 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab {
|
|||
private boolean updateCompatibleTools(ITool real) {
|
||||
boolean result = false;
|
||||
ArrayList list = new ArrayList();
|
||||
IFileInfoModification fim = tcmm.getModification((IFileInfo)ri);
|
||||
IFileInfoModification fim = tcmm.createModification((IFileInfo)ri);
|
||||
|
||||
if (real != null) { // Current tool exists
|
||||
real = ManagedBuildManager.getRealTool(real);
|
||||
|
|
|
@ -72,9 +72,9 @@ public class ToolSelectionDialog extends Dialog {
|
|||
setShellStyle(getShellStyle() | SWT.RESIZE);
|
||||
|
||||
if (ri instanceof IFolderInfo)
|
||||
tmod = ManagedBuildManager.getToolChainModificationManager().getModification((IFolderInfo)ri);
|
||||
tmod = ManagedBuildManager.getToolChainModificationManager().createModification((IFolderInfo)ri);
|
||||
else
|
||||
tmod = ManagedBuildManager.getToolChainModificationManager().getModification((IFileInfo)ri);
|
||||
tmod = ManagedBuildManager.getToolChainModificationManager().createModification((IFileInfo)ri);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
Loading…
Add table
Reference in a new issue