import org.tianocore.build.id.ModuleIdentification;\r
import org.tianocore.build.id.PackageIdentification;\r
import org.tianocore.build.id.PlatformIdentification;\r
-import org.tianocore.build.pcd.entity.MemoryDatabaseManager;\r
+import org.tianocore.pcd.entity.MemoryDatabaseManager;\r
import org.tianocore.build.toolchain.ToolChainAttribute;\r
import org.tianocore.build.toolchain.ToolChainConfig;\r
import org.tianocore.build.toolchain.ToolChainElement;\r
///\r
/// PCD memory database stored all PCD information which collected from FPD,MSA and SPD.\r
///\r
-// private static final MemoryDatabaseManager pcdDbManager = new MemoryDatabaseManager();\r
+ private static final MemoryDatabaseManager pcdDbManager = new MemoryDatabaseManager();\r
\r
///\r
/// build target + tool chain family/tag name + arch + command types + command options\r
private static Map<FpdModuleIdentification, ToolChainMap> moduleToolChainOption = new HashMap<FpdModuleIdentification, ToolChainMap>();\r
private static Map<FpdModuleIdentification, ToolChainMap> moduleToolChainFamilyOption = new HashMap<FpdModuleIdentification, ToolChainMap>();\r
\r
- private static final MemoryDatabaseManager pcdDbManager = new MemoryDatabaseManager();\r
-\r
/**\r
Parse framework database (DB) and all SPD files listed in DB to initialize\r
the environment for next build. This method will only be executed only once\r
// CONF dir + tools definition file name\r
//\r
File toolsDefFile = new File(workspaceDir + File.separatorChar + toolsDefFilename);\r
- System.out.println("Using file [" + toolsDefFile.getPath() + "] as tools definition file. ");\r
+ System.out.println("Using tool definiton file [" + toolsDefFile.getPath() + "].");\r
toolsDef = new ToolChainConfig(toolsDefFile);\r
\r
//\r
// validate FrameworkDatabaseFile\r
//\r
if (! db.validate()) {\r
- throw new BuildException("Framework Database file [" + dbFile.getPath() + "] is invalid.");\r
+ throw new BuildException("Framework Database file [" + dbFile.getPath() + "] format is invalid!");\r
}\r
//\r
// Get package list\r
// Verify FPD file, if is invalid, throw Exception\r
//\r
if (! fpdDoc.validate()) {\r
- throw new BuildException("Framework Platform Surface Area file [" + fpdFile.getPath() + "] is invalid. ");\r
+ throw new BuildException("Framework Platform Surface Area file [" + fpdFile.getPath() + "] format is invalid!");\r
}\r
//\r
// We can change Map to XmlObject\r
}\r
}\r
} catch (Exception e) {\r
- throw new BuildException("Parse workspace Database [" + dbFile.getPath() + "] Error.\n" + e.getMessage());\r
+ throw new BuildException("Parse WORKSPACE Database file [" + dbFile.getPath() + "] Error.\n" + e.getMessage());\r
}\r
}\r
\r
}\r
}\r
if (msaFile == null){\r
- throw new BuildException("Can't find Module [" + moduleId.getName() + "] in all packages. ");\r
+ throw new BuildException("Can't find Module [" + moduleId.getName() + "] in any SPD package!");\r
}\r
else {\r
return msaFile;\r
}\r
}\r
if (packageId == null){\r
- throw new BuildException("Can't find Module [" + moduleId.getName() + "] in all packages. ");\r
+ throw new BuildException("Can't find Module [" + moduleId.getName() + "] in any SPD package!");\r
}\r
else {\r
return packageId;\r
\r
public synchronized static Map<String, XmlObject> getNativeMsa(File msaFile) throws BuildException {\r
if (! msaFile.exists()) {\r
- throw new BuildException("Surface Area file [" + msaFile.getPath() + "] can't found.");\r
+ throw new BuildException("Module Surface Area file [" + msaFile.getPath() + "] can't be found!");\r
}\r
try {\r
ModuleSurfaceAreaDocument doc = (ModuleSurfaceAreaDocument)XmlObject.Factory.parse(msaFile);\r
// Validate File if they accord with XML Schema\r
//\r
if ( ! doc.validate()){\r
- throw new BuildException("Module Surface Area file [" + msaFile.getPath() + "] is invalid.");\r
+ throw new BuildException("Module Surface Area file [" + msaFile.getPath() + "] format is invalid!");\r
}\r
//\r
// parse MSA file\r
// If can't find library class declaration in every package\r
//\r
throw new BuildException("Can not find library class [" + name\r
- + "] declaration in every packages. ");\r
+ + "] declaration in any SPD package!");\r
}\r
\r
/**\r
return platformId;\r
}\r
}\r
- throw new BuildException("Can't find platform [" + name + "] in current workspace database. ");\r
+ throw new BuildException("Can't find platform [" + name + "] in the current WORKSPACE database!");\r
}\r
\r
public synchronized static PlatformIdentification getPlatform(String filename) throws BuildException {\r
return platformId;\r
}\r
}\r
- throw new BuildException("Can't find platform file [" + filename + "] in current workspace database. ");\r
+ throw new BuildException("Can't find platform file [" + filename + "] in the current WORKSPACE database!");\r
}\r
\r
public synchronized static PackageIdentification refreshPackageIdentification(PackageIdentification packageId) throws BuildException {\r
return packageId;\r
}\r
}\r
- throw new BuildException("Can't find package GUID value " + packageId.getGuid() + " under current workspace. ");\r
+ throw new BuildException("Can't find package GUID value " + packageId.getGuid() + " 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() + " under current workspace. ");\r
+ throw new BuildException("Can't find package GUID value " + packageId.getGuid() + " 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 " + packageId + " under current workspace. ");\r
+ throw new BuildException("Can't find module GUID value " + moduleId.getGuid() + " in package, " + packageId + ", in the current workspace!");\r
}\r
\r
public synchronized static Set<PackageIdentification> getPackageList(){\r
//\r
// For PCD get tokenSpaceGUid\r
//\r
- public synchronized static String[] getGuidInfoFromCname(String cName){\r
- String cNameGuid[] = null;\r
+ public synchronized static String getGuidInfoFromCname(String cName){\r
+ String cNameGuid = null;\r
String guid = null;\r
Set set = spdTable.keySet();\r
Iterator iter = set.iterator();\r
Spd spd = (Spd) spdTable.get(iter.next());\r
guid = spd.getGuidFromCname(cName);\r
if (guid != null){\r
- cNameGuid = new String[2];\r
- cNameGuid[0] = cName;\r
- cNameGuid[1] = guid;\r
+ cNameGuid = guid;\r
break;\r
}\r
}\r