X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Tools%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2Fpcd%2Faction%2FCollectPCDAction.java;h=71a30b67abb74a0768fef0bcb1ec73f6c0c885af;hb=19ce77c3e90fbc5a9029163ef2813592127c4498;hp=055563df1b29a2f2c51181cca20e3014b3017078;hpb=878ddf1fc3540a715f63594ed22b6929e881afb4;p=mirror_edk2.git 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 055563df1b..71a30b67ab 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java +++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java @@ -373,15 +373,13 @@ public class CollectPCDAction { if(Token.PCD_USAGE.UNKNOWN != token.isUsageInstanceExist(moduleName)) { // - // BUGBUG: It should *not* throw exception here. Becaues in MdePkg.fpd, - // more than on BaseLib exist. But why? need confirmation. + // BUGBUG: It is legal that same base name exist in one FPD file. In furture + // we should use "Guid, Version, Package" and "Arch" to differ a module. + // So currently, warning should be disabled. // - //throw new EntityException( - // "In module " + moduleName + " exist more than one PCD token " + token.cName - // ); - ActionMessage.warning(this, - "In module " + moduleName + " exist more than one PCD token " + token.cName - ); + //ActionMessage.warning(this, + // "In module " + moduleName + " exist more than one PCD token " + token.cName + // ); return null; } @@ -501,7 +499,8 @@ public class CollectPCDAction { token.skuDataArrayEnabled = pcdBuildData.getSkuDataArrayEnable(); token.assignedtokenNumber = Integer.decode(pcdBuildData.getToken().getStringValue()); skuDataArray = pcdBuildData.getSkuDataArray1(); - + token.datumType = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString()); + if(skuDataArray != null) { for(skuIndex = 0; skuIndex < skuDataArray.size(); skuIndex ++) { // @@ -550,11 +549,12 @@ public class CollectPCDAction { private void updateTokenBySPD(UsageInstance usageInstance, String packageFullPath) throws EntityException { - PackageSurfaceAreaDocument pkgDoc = null; - List pcdEntryArray = new ArrayList(); - int index; - boolean isFoundInSpd = false; - Token.DATUM_TYPE datumType = Token.DATUM_TYPE.UNKNOWN; + PackageSurfaceAreaDocument pkgDoc = null; + PcdDefinitions pcdDefinitions = null; + List pcdEntryArray = new ArrayList(); + int index = 0; + boolean isFoundInSpd = false; + Token.DATUM_TYPE datumType = Token.DATUM_TYPE.UNKNOWN; try { pkgDoc =(PackageSurfaceAreaDocument)XmlObject.Factory.parse(new File(packageFullPath)); @@ -563,8 +563,18 @@ public class CollectPCDAction { } catch(XmlException xmlE) { throw new EntityException("Can't parse the FPD xml fle:" + packageFullPath); } + pcdDefinitions = pkgDoc.getPackageSurfaceArea().getPcdDefinitions(); + // + // It is illege for SPD file does not contains any PCD information. + // + if (pcdDefinitions == null) { + return; + } - pcdEntryArray = pkgDoc.getPackageSurfaceArea().getPcdDefinitions().getPcdEntryList(); + pcdEntryArray = pcdDefinitions.getPcdEntryList(); + if (pcdEntryArray == null) { + return; + } for(index = 0; index < pcdEntryArray.size(); index ++) { if(pcdEntryArray.get(index).getCName().equalsIgnoreCase( usageInstance.parentToken.cName)) { @@ -616,12 +626,6 @@ public class CollectPCDAction { } } } - - if(!isFoundInSpd ) { - ActionMessage.warning(this, - "Can *not* find the PCD token " + usageInstance.parentToken.cName + - " in SPD file!"); - } } /**