import java.util.List;\r
import java.util.Map;\r
import java.util.Set;\r
-import java.util.logging.Logger;\r
\r
import org.apache.tools.ant.BuildException;\r
import org.apache.xmlbeans.XmlObject;\r
@since GenBuild 1.0\r
**/\r
public class GlobalData {\r
-\r
- public static Logger log = Logger.getAnonymousLogger();\r
-\r
///\r
/// Record current WORKSPACE Directory\r
///\r
//\r
File toolsDefFile = new File(workspaceDir + File.separatorChar + toolsDefFilename);\r
System.out.println("Using tool definiton file [" + toolsDefFile.getPath() + "].");\r
- toolsDef = new ToolChainConfig(toolsDefFile);\r
+ try {\r
+ toolsDef = new ToolChainConfig(toolsDefFile);\r
+ } catch (Exception e) {\r
+ throw new BuildException(e.getMessage());\r
+ }\r
\r
//\r
// Parse Framework Database\r
List<DbPathAndFilename> packages = db.getFrameworkDatabase().getPackageList().getFilenameList();\r
Iterator<DbPathAndFilename> iter = packages.iterator();\r
while (iter.hasNext()) {\r
- String fileName = iter.next().getStringValue();\r
+ String fileName = iter.next().getStringValue().trim();\r
Spd spd = new Spd(new File(workspaceDir + File.separatorChar + fileName));\r
packageList.add(spd.getPackageId());\r
spdTable.put(spd.getPackageId(), spd);\r
List<DbPathAndFilename> platforms = db.getFrameworkDatabase().getPlatformList().getFilenameList();\r
Iterator<DbPathAndFilename> iter = platforms.iterator();\r
while (iter.hasNext()) {\r
- String fileName = iter.next().getStringValue();\r
+ String fileName = iter.next().getStringValue().trim();\r
File fpdFile = new File(workspaceDir + File.separatorChar + fileName);\r
if ( !fpdFile.exists() ) {\r
throw new BuildException("Platform file [" + fpdFile.getPath() + "] not exists. ");\r
//\r
Map<String, XmlObject> fpdDocMap = new HashMap<String, XmlObject>();\r
fpdDocMap.put("PlatformSurfaceArea", fpdDoc);\r
- SurfaceAreaQuery.setDoc(fpdDocMap);\r
- PlatformIdentification platformId = SurfaceAreaQuery.getFpdHeader();\r
+ SurfaceAreaQuery saq = new SurfaceAreaQuery(fpdDocMap);\r
+ PlatformIdentification platformId = saq.getFpdHeader();\r
platformId.setFpdFile(fpdFile);\r
platformList.add(platformId);\r
}\r
return msaMap;\r
}\r
catch (Exception ex){\r
- throw new BuildException(ex.getMessage());\r
+ throw new BuildException("Parsing MSA file [" + msaFile.getPath() + "] error. \n" + ex.getMessage() );\r
}\r
}\r
\r
}\r
}\r
return null;\r
-\r
}\r
\r
/**\r
return packageId;\r
}\r
}\r
- throw new BuildException("Can't find package GUID value " + packageId.getGuid() + " in the current workspace!");\r
+ throw new BuildException("Can't find package GUID value " + packageId.toGuidString() + " in the current workspace!");\r
}\r
\r
public synchronized static ModuleIdentification refreshModuleIdentification(ModuleIdentification moduleId) throws BuildException {\r
moduleId.setPackage(packageId);\r
Spd spd = spdTable.get(packageId);\r
if (spd == null) {\r
- throw new BuildException("Can't find package GUID value " + packageId.getGuid() + " in the current workspace!");\r
+ throw new BuildException("Can't find package GUID value " + packageId.toGuidString() + " in the current workspace!");\r
}\r
Set<ModuleIdentification> modules = spd.getModules();\r
Iterator<ModuleIdentification> iter = modules.iterator();\r
return moduleId;\r
}\r
}\r
- throw new BuildException("Can't find module GUID value " + moduleId.getGuid() + " in package, " + packageId + ", in the current workspace!");\r
+ throw new BuildException("Can't find module GUID value " + moduleId.toGuidString() + " in " + packageId + " under the current workspace!");\r
}\r
\r
public synchronized static Set<PackageIdentification> getPackageList(){\r
return result;\r
}\r
\r
- ////// Tool Chain Related, try to refine and put some logic process to ToolChainFactory\r
-\r
+ ///\r
+ /// Tool Chain Related, try to refine and put some logic process to ToolChainFactory\r
+ ///\r
public static ToolChainInfo getToolChainInfo() {\r
-// GlobalData.log.info(toolsDef.getConfigInfo() + "" + toolChainEnvInfo + toolChainPlatformInfo);\r
if (toolChainInfo == null) {\r
toolChainInfo = toolsDef.getConfigInfo().intersection(toolChainEnvInfo);\r
if (toolChainPlatformInfo != null) {\r
}\r
toolChainInfo.addCommands(toolsDef.getConfigInfo().getCommands());\r
toolChainInfo.normalize();\r
- GlobalData.log.info(toolChainInfo + "");\r
+ System.out.println("Current build tool chain information summary: ");\r
+ System.out.println(toolChainInfo + "");\r
}\r
return toolChainInfo;\r
}\r
\r
-\r
-\r
public static void setPlatformToolChainFamilyOption(ToolChainMap map) {\r
platformToolChainFamilyOption = map;\r
}\r