// If ToolChain has been set up before, do nothing.\r
// CONF dir + tools definition file name\r
//\r
- String confDir = GlobalData.workspaceDir + File.separatorChar + "Tools" + File.separatorChar + "Conf";\r
- File toolsDefFile = new File(confDir + File.separatorChar + toolsDefFilename);\r
+ File toolsDefFile = new File(workspaceDir + File.separatorChar + toolsDefFilename);\r
System.out.println("Using file [" + toolsDefFile.getPath() + "] as tools definition file. ");\r
toolsDef = new ToolChainConfig(toolsDefFile);\r
\r
\r
}\r
\r
- /////////////////////////// Update!! Update!! Update!!\r
-// public synchronized static MemoryDatabaseManager getPCDMemoryDBManager() {\r
-// return pcdDbManager;\r
-// }\r
- ///////////////////////////\r
- public synchronized static PlatformIdentification getPlatform(String name) throws BuildException {\r
+ public synchronized static PlatformIdentification getPlatformByName(String name) throws BuildException {\r
Iterator iter = platformList.iterator();\r
while(iter.hasNext()){\r
PlatformIdentification platformId = (PlatformIdentification)iter.next();\r
if (platformId.getName().equalsIgnoreCase(name)) {\r
-// GlobalData.log.info("Platform: " + platformId + platformId.getFpdFile());\r
return platformId;\r
}\r
}\r
- throw new BuildException("Can't find platform [" + name + "] in current workspace. ");\r
+ throw new BuildException("Can't find platform [" + name + "] in current workspace database. ");\r
+ }\r
+ \r
+ public synchronized static PlatformIdentification getPlatform(String filename) throws BuildException {\r
+ File file = new File(workspaceDir + File.separatorChar + filename);\r
+ Iterator iter = platformList.iterator();\r
+ while(iter.hasNext()){\r
+ PlatformIdentification platformId = (PlatformIdentification)iter.next();\r
+ if (platformId.getFpdFile().getPath().equalsIgnoreCase(file.getPath())) {\r
+ return platformId;\r
+ }\r
+ }\r
+ throw new BuildException("Can't find platform file [" + filename + "] in current workspace database. ");\r
}\r
\r
public synchronized static PackageIdentification refreshPackageIdentification(PackageIdentification packageId) throws BuildException {\r