X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2Fpcd%2Faction%2FCollectPCDAction.java;h=e0a3eb6fd3642716394fdc35db6b286895827c3e;hp=610739e48b90f1a177b02bd10d97864dceddbfe2;hb=d14ebb43742f411f2a013996b8e76bcab2420552;hpb=8d82d61173338a480da54065ef7138cb1454e889 diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java index 610739e48b..e0a3eb6fd3 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java +++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java @@ -41,17 +41,19 @@ import org.tianocore.ModuleSADocument; import org.tianocore.PcdBuildDefinitionDocument; import org.tianocore.PcdBuildDefinitionDocument.PcdBuildDefinition; import org.tianocore.PlatformSurfaceAreaDocument; -import org.tianocore.build.autogen.CommonDefinition; import org.tianocore.build.fpd.FpdParserTask; import org.tianocore.build.global.GlobalData; import org.tianocore.build.id.FpdModuleIdentification; -import org.tianocore.build.pcd.action.ActionMessage; -import org.tianocore.build.pcd.entity.DynamicTokenValue; -import org.tianocore.build.pcd.entity.MemoryDatabaseManager; -import org.tianocore.build.pcd.entity.SkuInstance; -import org.tianocore.build.pcd.entity.Token; -import org.tianocore.build.pcd.entity.UsageInstance; -import org.tianocore.build.pcd.exception.EntityException; +import org.tianocore.build.id.ModuleIdentification; +import org.tianocore.pcd.action.ActionMessage; +import org.tianocore.pcd.entity.CommonDefinition; +import org.tianocore.pcd.entity.DynamicTokenValue; +import org.tianocore.pcd.entity.MemoryDatabaseManager; +import org.tianocore.pcd.entity.SkuInstance; +import org.tianocore.pcd.entity.Token; +import org.tianocore.pcd.entity.UsageIdentification; +import org.tianocore.pcd.entity.UsageInstance; +import org.tianocore.pcd.exception.EntityException; /** CStructTypeDeclaration @@ -229,16 +231,24 @@ class StringTable { **/ class SizeTable { - private ArrayList al; + private ArrayList> al; private ArrayList alComments; - private String phase; private int len; + private String phase; public SizeTable (String phase) { - this.phase = phase; - al = new ArrayList(); + al = new ArrayList>(); alComments = new ArrayList(); len = 0; + this.phase = phase; + } + + public String getSizeMacro () { + return String.format(PcdDatabase.SizeTableSizeMacro, phase, getSize()); + } + + private int getSize() { + return len == 0 ? 1 : len; } public void genCode (ArrayList declaList, HashMap instTable, String phase) { @@ -262,6 +272,7 @@ class SizeTable { } private ArrayList getInstantiation () { + final String comma = ","; ArrayList Output = new ArrayList(); Output.add("/* SizeTable */"); @@ -270,14 +281,23 @@ class SizeTable { Output.add("\t0"); } else { for (int index = 0; index < al.size(); index++) { - Integer n = al.get(index); - String str = "\t" + n.toString(); + ArrayList ial = al.get(index); + + String str = "\t"; + + for (int index2 = 0; index2 < ial.size(); index2++) { + str += " " + ial.get(index2).toString(); + if (index2 != ial.size() - 1) { + str += comma; + } + } + str += " /* " + alComments.get(index) + " */"; + if (index != (al.size() - 1)) { - str += ","; + str += comma; } - str += " /* " + alComments.get(index) + " */"; Output.add(str); } @@ -287,20 +307,25 @@ class SizeTable { return Output; } - public int add (Token token) { - int index = len; + public void add (Token token) { - len++; - al.add(token.datumSize); + // + // We only have size information for POINTER type PCD entry. + // + if (token.datumType != Token.DATUM_TYPE.POINTER) { + return; + } + + ArrayList ial = token.getPointerTypeSize(); + + len+= ial.size(); + + al.add(ial); alComments.add(token.getPrimaryKeyString()); - return index; + return; } - public int getTableLen () { - return al.size() == 0 ? 1 : al.size(); - } - } /** @@ -344,7 +369,7 @@ class GuidTable { cCode += String.format(PcdDatabase.GuidTableDeclaration, phase); decl = new CStructTypeDeclaration ( name, - 8, + 4, cCode, true ); @@ -407,7 +432,7 @@ class GuidTable { // If so, return the GuidTable index. // for (int i = 0; i < al.size(); i++) { - if (al.get(i).equals(uuid)) { + if (al.get(i).compareTo(uuid) == 0) { return i; } } @@ -674,6 +699,25 @@ class LocalTokenNumberTable { str += " | PCD_TYPE_VPD"; } + switch (token.datumType) { + case UINT8: + case BOOLEAN: + str += " | PCD_DATUM_TYPE_UINT8"; + break; + case UINT16: + str += " | PCD_DATUM_TYPE_UINT16"; + break; + case UINT32: + str += " | PCD_DATUM_TYPE_UINT32"; + break; + case UINT64: + str += " | PCD_DATUM_TYPE_UINT64"; + break; + case POINTER: + str += " | PCD_DATUM_TYPE_POINTER"; + break; + } + al.add(str); alComment.add(token.getPrimaryKeyString()); @@ -710,7 +754,7 @@ class ExMapTable { } private ArrayList al; - private ArrayList alComment; + private Map alComment; private String phase; private int len; private int bodyLineNum; @@ -718,7 +762,7 @@ class ExMapTable { public ExMapTable (String phase) { this.phase = phase; al = new ArrayList(); - alComment = new ArrayList(); + alComment = new HashMap(); bodyLineNum = 0; len = 0; } @@ -773,7 +817,7 @@ class ExMapTable { str += e.localTokenIdx.toString() + ", "; str += e.guidTableIdx.toString(); - str += "}" + " /* " + alComment.get(index) + " */" ; + str += "}" + " /* " + alComment.get(e) + " */" ; if (index != al.size() - 1) { str += ","; @@ -792,9 +836,11 @@ class ExMapTable { public int add (int localTokenIdx, long exTokenNum, int guidTableIdx, String name) { int index = len; - len++; - al.add(new ExTriplet(guidTableIdx, exTokenNum, localTokenIdx)); - alComment.add(name); + len++; + ExTriplet et = new ExTriplet(guidTableIdx, exTokenNum, localTokenIdx); + + al.add(et); + alComment.put(et, name); return index; } @@ -851,7 +897,7 @@ class PcdDatabase { public final static String GuidTableDeclaration = "EFI_GUID GuidTable[%s_GUID_TABLE_SIZE];\r\n"; public final static String LocalTokenNumberTableDeclaration = "UINT32 LocalTokenNumberTable[%s_LOCAL_TOKEN_NUMBER_TABLE_SIZE];\r\n"; public final static String StringTableDeclaration = "UINT16 StringTable[%s_STRING_TABLE_SIZE];\r\n"; - public final static String SizeTableDeclaration = "UINT16 SizeTable[%s_LOCAL_TOKEN_NUMBER_TABLE_SIZE];\r\n"; + public final static String SizeTableDeclaration = "SIZE_INFO SizeTable[%s_SIZE_TABLE_SIZE];\r\n"; public final static String SkuIdTableDeclaration = "UINT8 SkuIdTable[%s_SKUID_TABLE_SIZE];\r\n"; @@ -860,6 +906,7 @@ class PcdDatabase { public final static String GuidTableSizeMacro = "#define %s_GUID_TABLE_SIZE %d\r\n"; public final static String LocalTokenNumberTableSizeMacro = "#define %s_LOCAL_TOKEN_NUMBER_TABLE_SIZE %d\r\n"; public final static String LocalTokenNumberSizeMacro = "#define %s_LOCAL_TOKEN_NUMBER %d\r\n"; + public final static String SizeTableSizeMacro = "#define %s_SIZE_TABLE_SIZE %d\r\n"; public final static String StringTableSizeMacro = "#define %s_STRING_TABLE_SIZE %d\r\n"; public final static String SkuIdTableSizeMacro = "#define %s_SKUID_TABLE_SIZE %d\r\n"; @@ -1079,7 +1126,7 @@ class PcdDatabase { if (t.isDynamicEx()) { exMapTable.add((int)t.tokenNumber, t.dynamicExTokenNumber, - guidTable.add(t.tokenSpaceName, t.getPrimaryKeyString()), + guidTable.add(translateSchemaStringToUUID(t.tokenSpaceName), t.getPrimaryKeyString()), t.getPrimaryKeyString() ); } @@ -1144,6 +1191,7 @@ class PcdDatabase { macroStr += skuIdTable.getSizeMacro(); macroStr += localTokenNumberTable.getSizeMacro(); macroStr += exMapTable.getSizeMacro(); + macroStr += sizeTable.getSizeMacro(); // // Generate existance info Macro for all Tables @@ -1311,6 +1359,9 @@ class PcdDatabase { } } + // + // privateGlobalName and privateGlobalCCode is used to pass output to caller of getCDeclarationString + // private void getCDeclarationString(Token t) throws EntityException { @@ -1321,7 +1372,7 @@ class PcdDatabase { } String type = getCType(t); - if ((t.datumType == Token.DATUM_TYPE.POINTER) && (!t.isHiiEnable())) { + if ((t.datumType == Token.DATUM_TYPE.POINTER) && (!t.isHiiEnable()) && (!t.isUnicodeStringType())) { int bufferSize; if (t.isASCIIStringType()) { // @@ -1338,7 +1389,7 @@ class PcdDatabase { } private String getDataTypeDeclarationForVariableDefault (Token token, String cName, int skuId) - throws EntityException { + throws EntityException { String typeStr; @@ -1516,28 +1567,119 @@ class PcdDatabase { return retStr; } + /** + Translate the schema string to UUID instance. + + In schema, the string of UUID is defined as following two types string: + 1) GuidArrayType: pattern = 0x[a-fA-F0-9]{1,8},( )*0x[a-fA-F0-9]{1,4},( + )*0x[a-fA-F0-9]{1,4}(,( )*\{)?(,?( )*0x[a-fA-F0-9]{1,2}){8}( )*(\})? + + 2) GuidNamingConvention: pattern = + [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12} + + This function will convert string and create uuid instance. + + @param uuidString UUID string in XML file + + @return UUID UUID instance + **/ + private UUID translateSchemaStringToUUID(String uuidString) + throws EntityException { + String temp; + String[] splitStringArray; + int index; + int chIndex; + int chLen; + + if (uuidString == null) { + return null; + } + + if (uuidString.length() == 0) { + return null; + } + + if (uuidString.equals("0") || + uuidString.equalsIgnoreCase("0x0")) { + return new UUID(0, 0); + } + + uuidString = uuidString.replaceAll("\\{", ""); + uuidString = uuidString.replaceAll("\\}", ""); + + // + // If the UUID schema string is GuidArrayType type then need translate + // to GuidNamingConvention type at first. + // + if ((uuidString.charAt(0) == '0') && ((uuidString.charAt(1) == 'x') || (uuidString.charAt(1) == 'X'))) { + splitStringArray = uuidString.split("," ); + if (splitStringArray.length != 11) { + throw new EntityException ("[FPD file error] Wrong format for UUID string: " + uuidString); + } + + // + // Remove blank space from these string and remove header string "0x" + // + for (index = 0; index < 11; index ++) { + splitStringArray[index] = splitStringArray[index].trim(); + splitStringArray[index] = splitStringArray[index].substring(2, splitStringArray[index].length()); + } + + // + // Add heading '0' to normalize the string length + // + for (index = 3; index < 11; index ++) { + chLen = splitStringArray[index].length(); + for (chIndex = 0; chIndex < 2 - chLen; chIndex ++) { + splitStringArray[index] = "0" + splitStringArray[index]; + } + } + + // + // construct the final GuidNamingConvention string + // + temp = String.format("%s-%s-%s-%s%s-%s%s%s%s%s%s", + splitStringArray[0], + splitStringArray[1], + splitStringArray[2], + splitStringArray[3], + splitStringArray[4], + splitStringArray[5], + splitStringArray[6], + splitStringArray[7], + splitStringArray[8], + splitStringArray[9], + splitStringArray[10]); + uuidString = temp; + } + + return UUID.fromString(uuidString); + } } +/** Module Info class is the data structure to hold information got from GlobalData. +*/ class ModuleInfo { - private String type; - private FpdModuleIdentification moduleId; + /// + /// Module's ID for a + /// + private FpdModuleIdentification moduleId; + /// + /// xmlobject in FPD file for a + /// private PcdBuildDefinitionDocument.PcdBuildDefinition pcdBuildDef; - - - public ModuleInfo (FpdModuleIdentification moduleId, String type, XmlObject pcdDef) { - this.moduleId = moduleId; - this.type = type; - this.pcdBuildDef = ((PcdBuildDefinitionDocument)pcdDef).getPcdBuildDefinition(); - } - public String getModuleType (){ - return this.type; + public ModuleInfo (FpdModuleIdentification moduleId, XmlObject pcdDef) { + this.moduleId = moduleId; + this.pcdBuildDef = ((PcdBuildDefinitionDocument)pcdDef).getPcdBuildDefinition(); } + public FpdModuleIdentification getModuleId (){ - return this.moduleId; + return moduleId; } + public PcdBuildDefinitionDocument.PcdBuildDefinition getPcdBuildDef(){ - return this.pcdBuildDef; + return pcdBuildDef; } } @@ -1546,22 +1688,29 @@ class ModuleInfo { from buildAction or UIAction. **/ public class CollectPCDAction { + /// /// memoryDatabase hold all PCD information collected from SPD, MSA, FPD. + /// private MemoryDatabaseManager dbManager; - + /// /// Workspacepath hold the workspace information. + /// private String workspacePath; - + /// /// FPD file is the root file. + /// private String fpdFilePath; - + /// /// Message level for CollectPCDAction. + /// private int originalMessageLevel; - + /// /// Cache the fpd docment instance for private usage. + /// private PlatformSurfaceAreaDocument fpdDocInstance; - + /// /// xmlObject name + /// private static String xmlObjectName = "PcdBuildDefinition"; /** @@ -1648,8 +1797,7 @@ public class CollectPCDAction { createTokenInDBFromFPD(); // - // Call Private function genPcdDatabaseSourceCode (void); ComponentTypeBsDriver - // 1) Generate for PEI, DXE PCD DATABASE's definition and initialization. + // Generate for PEI, DXE PCD DATABASE's definition and initialization. // genPcdDatabaseSourceCode (); @@ -1664,7 +1812,7 @@ public class CollectPCDAction { **/ private void genPcdDatabaseSourceCode() throws EntityException { - String PcdCommonHeaderString = PcdDatabase.getPcdDatabaseCommonDefinitions (); + String PcdCommonHeaderString = PcdDatabase.getPcdDatabaseCommonDefinitions(); ArrayList alPei = new ArrayList (); ArrayList alDxe = new ArrayList (); @@ -1672,17 +1820,14 @@ public class CollectPCDAction { dbManager.getTwoPhaseDynamicRecordArray(alPei, alDxe); PcdDatabase pcdPeiDatabase = new PcdDatabase (alPei, "PEI", 0); pcdPeiDatabase.genCode(); - MemoryDatabaseManager.PcdPeimHString = PcdCommonHeaderString + pcdPeiDatabase.getHString() - + PcdDatabase.getPcdPeiDatabaseDefinitions(); + MemoryDatabaseManager.PcdPeimHString = PcdCommonHeaderString + pcdPeiDatabase.getHString() + + PcdDatabase.getPcdPeiDatabaseDefinitions(); MemoryDatabaseManager.PcdPeimCString = pcdPeiDatabase.getCString(); - PcdDatabase pcdDxeDatabase = new PcdDatabase (alDxe, - "DXE", - alPei.size() - ); + PcdDatabase pcdDxeDatabase = new PcdDatabase(alDxe, "DXE", alPei.size()); pcdDxeDatabase.genCode(); - MemoryDatabaseManager.PcdDxeHString = MemoryDatabaseManager.PcdPeimHString + pcdDxeDatabase.getHString() - + PcdDatabase.getPcdDxeDatabaseDefinitions(); + MemoryDatabaseManager.PcdDxeHString = MemoryDatabaseManager.PcdPeimHString + pcdDxeDatabase.getHString() + + PcdDatabase.getPcdDxeDatabaseDefinitions(); MemoryDatabaseManager.PcdDxeCString = pcdDxeDatabase.getCString(); } @@ -1696,30 +1841,23 @@ public class CollectPCDAction { */ private List getComponentsFromFPD() throws EntityException { - List allModules = new ArrayList(); - ModuleInfo current = null; - int index = 0; - FrameworkModulesDocument.FrameworkModules fModules = null; - ModuleSADocument.ModuleSA[] modules = null; - HashMap map = new HashMap(); - - if (fpdDocInstance == null) { - try { - fpdDocInstance = (PlatformSurfaceAreaDocument)XmlObject.Factory.parse(new File(fpdFilePath)); - } catch(IOException ioE) { - throw new EntityException("File IO error for xml file:" + fpdFilePath + "\n" + ioE.getMessage()); - } catch(XmlException xmlE) { - throw new EntityException("Can't parse the FPD xml fle:" + fpdFilePath + "\n" + xmlE.getMessage()); - } + List allModules = new ArrayList(); + FrameworkModulesDocument.FrameworkModules fModules = null; + ModuleSADocument.ModuleSA[] modules = null; + Map pcdBuildDefinitions = null; + pcdBuildDefinitions = GlobalData.getFpdPcdBuildDefinitions(); + if (pcdBuildDefinitions == null) { + return null; } - MappcdBuildDef = GlobalData.getFpdModuleSaXmlObject(CollectPCDAction.xmlObjectName); - Set pcdBuildKeySet = pcdBuildDef.keySet(); - Iterator item = pcdBuildKeySet.iterator(); + // + // Loop map to retrieve all PCD build definition and Module id + // + Iterator item = pcdBuildDefinitions.keySet().iterator(); while (item.hasNext()){ - FpdModuleIdentification id = (FpdModuleIdentification)item.next(); - allModules.add(new ModuleInfo(id, id.getModule().getModuleType(),pcdBuildDef.get(id))); + FpdModuleIdentification id = (FpdModuleIdentification) item.next(); + allModules.add(new ModuleInfo(id, pcdBuildDefinitions.get(id))); } return allModules; @@ -1757,6 +1895,8 @@ public class CollectPCDAction { String datum = null; int maxDatumSize = 0; String[] tokenSpaceStrRet = null; + UsageIdentification usageId = null; + ModuleIdentification moduleId = null; // // ---------------------------------------------- @@ -1775,34 +1915,6 @@ public class CollectPCDAction { // ------------------------------------------------------------------- // for (index = 0; index < modules.size(); index ++) { - isDuplicate = false; - for (index2 = 0; index2 < index; index2 ++) { - // - // BUGBUG: For transition schema, we can *not* get module's version from - // , It is work around code. - // - primaryKey1 = UsageInstance.getPrimaryKey(modules.get(index).getModuleId().getModule().getName(), - null, - null, - null, - modules.get(index).getModuleId().getArch(), - null); - primaryKey2 = UsageInstance.getPrimaryKey(modules.get(index2).getModuleId().getModule().getName(), - null, - null, - null, - modules.get(index2).getModuleId().getArch(), - null); - if (primaryKey1.equalsIgnoreCase(primaryKey2)) { - isDuplicate = true; - break; - } - } - - if (isDuplicate) { - continue; - } - // // It is legal for a module does not contains ANY pcd build definitions. // @@ -1832,8 +1944,7 @@ public class CollectPCDAction { throw new EntityException ("Fail to get Token space guid for token" + pcdBuildData.getCName()); } - primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(), - translateSchemaStringToUUID(tokenSpaceStrRet[1])); + primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(), tokenSpaceStrRet[1]); pcdType = Token.getpcdTypeFromString(pcdBuildData.getItemType().toString()); datumType = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString()); tokenNumber = Long.decode(pcdBuildData.getToken().toString()); @@ -1972,8 +2083,7 @@ public class CollectPCDAction { throw new EntityException("Fail to get token space guid for token " + token.cName); } - token = new Token(pcdBuildData.getCName(), - translateSchemaStringToUUID(tokenSpaceStrRet[1])); + token = new Token(pcdBuildData.getCName(), tokenSpaceStrRet[1]); token.datumType = datumType; token.tokenNumber = tokenNumber; @@ -2006,15 +2116,17 @@ public class CollectPCDAction { // 2.1.4), Create an usage instance for this token. // ------------------------------------------------ // + moduleId = modules.get(index).getModuleId().getModule(); + usageId = new UsageIdentification (moduleId.getName(), + moduleId.getGuid(), + moduleId.getPackage().getName(), + moduleId.getPackage().getGuid(), + modules.get(index).getModuleId().getArch(), + moduleId.getVersion(), + moduleId.getModuleType()); usageInstance = new UsageInstance(token, - moduleName, - null, - null, - null, - CommonDefinition.getModuleType(modules.get(index).getModuleType()), + usageId, pcdType, - modules.get(index).getModuleId().getArch(), - null, datum, maxDatumSize); token.addUsageInstance(usageInstance); @@ -2036,7 +2148,7 @@ public class CollectPCDAction { } private List getUnreferencedDynamicPcd () throws EntityException { - List tokenArray = new ArrayList(); + List tokenArray = new ArrayList(); Token token = null; DynamicPcdBuildDefinitions dynamicPcdBuildDefinitions = null; List dynamicPcdBuildDataArray = null; @@ -2054,7 +2166,8 @@ public class CollectPCDAction { String variableGuidString[]; // - // If FPD document is not be opened, open and initialize it. + // Open fpd document to get Section. + // BUGBUG: the function should be move GlobalData in furture. // if (fpdDocInstance == null) { try { @@ -2085,7 +2198,7 @@ public class CollectPCDAction { } primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(), - translateSchemaStringToUUID(tokenSpaceStrRet[1])); + tokenSpaceStrRet[1]); if (dbManager.isTokenInDatabase(primaryKey)) { continue; @@ -2100,7 +2213,7 @@ public class CollectPCDAction { // // Create new token for unreference dynamic PCD token // - token = new Token(pcdBuildData.getCName(), translateSchemaStringToUUID(tokenSpaceStrRet[1])); + token = new Token(pcdBuildData.getCName(), tokenSpaceStrRet[1]); token.datumSize = pcdBuildData.getMaxDatumSize(); @@ -2530,7 +2643,12 @@ public class CollectPCDAction { strValue = datum.substring(start + 1, end); strValue = strValue.trim(); if (strValue.length() == 0) { - break; + exceptionString = String.format ("[FPD file error] The datum type of PCD %s in %s is VOID*, and "+ + "it is byte array in fact, but '{}' is not valid for NULL datam but"+ + " need use '{0}'", + cName, + moduleName); + return exceptionString; } strValueArray = strValue.split(","); for (index = 0; index < strValueArray.length; index ++) { @@ -2608,6 +2726,7 @@ public class CollectPCDAction { // // If FPD document is not be opened, open and initialize it. + // BUGBUG: The code should be moved into GlobalData in future. // if (fpdDocInstance == null) { try { @@ -2643,7 +2762,7 @@ public class CollectPCDAction { } dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(), - translateSchemaStringToUUID(tokenSpaceStrRet[1])); + tokenSpaceStrRet[1]); if (dynamicPrimaryKey.equalsIgnoreCase(token.getPrimaryKeyString())) { return dynamicPcdBuildDataArray.get(index); } @@ -2728,9 +2847,7 @@ public class CollectPCDAction { } pcdType = Token.getpcdTypeFromString(dynamicInfo.getItemType().toString()); - if (pcdType == Token.PCD_TYPE.DYNAMIC_EX) { - token.dynamicExTokenNumber = tokenNumber; - } + token.dynamicExTokenNumber = tokenNumber; skuInfoList = dynamicInfo.getSkuInfoList(); @@ -3007,14 +3124,16 @@ public class CollectPCDAction { **/ public static void main(String argv[]) throws EntityException { CollectPCDAction ca = new CollectPCDAction(); - ca.setWorkspacePath("m:/tianocore/edk2"); - ca.setFPDFilePath("m:/tianocore/edk2/EdkNt32Pkg/Nt32.fpd"); + String projectDir = "x:/edk2"; + ca.setWorkspacePath(projectDir); + ca.setFPDFilePath(projectDir + "/EdkNt32Pkg/Nt32.fpd"); ca.setActionMessageLevel(ActionMessage.MAX_MESSAGE_LEVEL); GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", - "m:/tianocore/edk2", + projectDir, "tools_def.txt"); + System.out.println("After initInfo!"); FpdParserTask fpt = new FpdParserTask(); - fpt.parseFpdFile(new File("m:/tianocore/edk2/EdkNt32Pkg/Nt32.fpd")); + fpt.parseFpdFile(new File(projectDir + "/EdkNt32Pkg/Nt32.fpd")); ca.execute(); } }