X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FPcdTools%2Forg%2Ftianocore%2Fpcd%2Faction%2FPlatformPcdPreprocessAction.java;h=9343c1689d09365a4ab0205d48ecae4b17d056ee;hp=f2d52475ae0f60b04a4756317f4218ee34d7cfa0;hb=f889b75c5fbbbb549c9299b7193957e6e59b636d;hpb=20c5c53fd7ec8b8395f15ad11a8cb337b7e39ea9 diff --git a/Tools/Source/PcdTools/org/tianocore/pcd/action/PlatformPcdPreprocessAction.java b/Tools/Source/PcdTools/org/tianocore/pcd/action/PlatformPcdPreprocessAction.java index f2d52475ae..9343c1689d 100644 --- a/Tools/Source/PcdTools/org/tianocore/pcd/action/PlatformPcdPreprocessAction.java +++ b/Tools/Source/PcdTools/org/tianocore/pcd/action/PlatformPcdPreprocessAction.java @@ -159,9 +159,9 @@ public abstract class PlatformPcdPreprocessAction { public void putError(String error) { if (errorString == null) { - errorString = "### ERROR[" + errorCount + "] ###\r\n" + error + "\r\n\r\n"; + errorString = "### ERROR[" + errorCount + "] ###\r\n" + error + "\r\n"; } else { - errorString += "### ERROR[" + errorCount + "] ###\r\n" + error + "\r\n\r\n"; + errorString += "### ERROR[" + errorCount + "] ###\r\n" + error + "\r\n"; } errorCount++; @@ -199,7 +199,7 @@ public abstract class PlatformPcdPreprocessAction { if (modules == null) { throw new PlatformPcdPreprocessException( - "No modules in FPD file, Please check whether there are elements in in FPD file!"); + "No modules found in the FPD file.\nPlease check whether there are elements in in the FPD file!"); } // @@ -230,8 +230,8 @@ public abstract class PlatformPcdPreprocessAction { tokenSpaceStrRet = getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName()); if (tokenSpaceStrRet == null) { - putError("Fail to get Token space guid for token" + pcdBuildData.getCName() + - " from all SPD files. You must have an for this token space Guid"); + putError("Failed to get Token Space Guid for token " + pcdBuildData.getCName() + + " from any SPD file. You must have an for this Token Space Guid!"); // // Do not break preprocess, continues to analysis. // All errors will be summary to be shown. @@ -252,8 +252,8 @@ public abstract class PlatformPcdPreprocessAction { if ((pcdType == Token.PCD_TYPE.FEATURE_FLAG) && (datumType != Token.DATUM_TYPE.BOOLEAN)){ - exceptionString = String.format("In FPD file, for PCD %s in module %s, the PCD type is FEATRUE_FLAG but "+ - "datum type of this PCD entry is not BOOLEAN!", + exceptionString = String.format("In FPD file, for PCD %s in module %s, the PCD type is FEATURE_FLAG but "+ + "datum type for this PCD entry is not BOOLEAN!", pcdBuildData.getCName(), moduleName); putError(exceptionString); @@ -274,7 +274,7 @@ public abstract class PlatformPcdPreprocessAction { // Value is required. // if (datum == null) { - exceptionString = String.format("In FPD file, there is no value for PCD entry %s in module %s!", + exceptionString = String.format("In the FPD file, there is no value for PCD entry %s in module %s!", pcdBuildData.getCName(), moduleName); putError(exceptionString); @@ -319,7 +319,7 @@ public abstract class PlatformPcdPreprocessAction { // modules. // if (token.datumType != datumType) { - exceptionString = String.format("In FPD file, the datum type of PCD entry %s is %s, which is different with %s defined in before!", + exceptionString = String.format("In the FPD file, the datum type of the PCD entry %s is %s, which is different from %s which was previously defined!", pcdBuildData.getCName(), pcdBuildData.getDatumType().toString(), Token.getStringOfdatumType(token.datumType)); @@ -335,7 +335,7 @@ public abstract class PlatformPcdPreprocessAction { // Check token number is valid // if (tokenNumber != token.tokenNumber) { - exceptionString = String.format("In FPD file, the token number of PCD entry %s in module %s is different with same PCD entry in other modules!", + exceptionString = String.format("In the FPD file, the token number of PCD entry %s in module %s is different from the same PCD entry in other modules!", pcdBuildData.getCName(), moduleName); putError(exceptionString); @@ -350,8 +350,8 @@ public abstract class PlatformPcdPreprocessAction { // For same PCD used in different modules, the PCD type should all be dynamic or non-dynamic. // if (token.isDynamicPCD != Token.isDynamic(pcdType)) { - exceptionString = String.format("In FPD file, for PCD entry %s in module %s, you define dynamic or non-dynamic PCD type which"+ - " is different with others module's", + exceptionString = String.format("In the FPD file, for PCD entry %s in module %s, you defined dynamic or non-dynamic PCD type which"+ + " is different from other module's definition.", token.cName, moduleName); putError(exceptionString); @@ -363,33 +363,10 @@ public abstract class PlatformPcdPreprocessAction { } if (token.isDynamicPCD) { - // - // Check datum is equal the datum in dynamic information. - // For dynamic PCD, you can do not write in sperated every in different , - // But if you write, the must be same as the value in . - // - if (!token.isSkuEnable() && - (token.getDefaultSku().type == DynamicTokenValue.VALUE_TYPE.DEFAULT_TYPE) && - (datum != null)) { - if (!datum.equalsIgnoreCase(token.getDefaultSku().value)) { - exceptionString = String.format("In FPD file, for dynamic PCD %s in module %s, the datum in is "+ - "not equal to the datum in , it is "+ - "illega! You could no set in for a dynamic PCD!", - token.cName, - moduleName); - putError(exceptionString); - // - // Do not break preprocess, continues to analysis. - // All errors will be summary to be shown. - // - continue; - } - } - if ((maxDatumSize != 0) && (maxDatumSize != token.datumSize)){ - exceptionString = String.format("In FPD file, for dynamic PCD %s in module %s, the max datum size is %d which "+ - "is different with %d defined in !", + exceptionString = String.format("In the FPD file, for dynamic PCD %s in module %s, the max datum size is %d which "+ + "is different than %d defined in !", token.cName, moduleName, maxDatumSize, @@ -411,8 +388,8 @@ public abstract class PlatformPcdPreprocessAction { tokenSpaceStrRet = getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName()); if (tokenSpaceStrRet == null) { - putError("Fail to get Token space guid for token" + token.cName + - " from all SPD files. You must have an for this token space Guid"); + putError("Failed to get the Token Space Guid for token" + token.cName + + " from any SPD file. You must have a for this Token Space Guid!"); // // Do not break preprocess, continues to analysis. // All errors will be summary to be shown. @@ -461,8 +438,8 @@ public abstract class PlatformPcdPreprocessAction { datum, maxDatumSize); if (!token.addUsageInstance(usageInstance)) { - putError(String.format("PCD %s for module %s(%s) has already exist in database, Please check all PCD build entries "+ - "in modules %s in to make sure no duplicated definitions in FPD file!", + putError(String.format("PCD %s for module %s(%s) already exists in the database.\nPlease check all PCD build entries "+ + "in the %s module's section to make sure there are no duplicated definitions in the FPD file!", token.cName, modules.get(index).usageId.moduleGuid, moduleName, @@ -519,9 +496,9 @@ public abstract class PlatformPcdPreprocessAction { dynamicInfo = getDynamicInfoFromFpd(token, moduleName); if (dynamicInfo == null) { - exceptionString = String.format("In FPD file, for Dynamic PCD %s used by module %s, "+ - "there is no dynamic information in "+ - "in FPD file, but it is required!", + exceptionString = String.format("In the FPD file, the Dynamic PCD %s is used by module %s.\n" + + "However, there is no dynamic information in the " + + "section of the FPD file. This section is required!", token.cName, moduleName); putError(exceptionString); @@ -541,8 +518,8 @@ public abstract class PlatformPcdPreprocessAction { if ((maxDatumSize != 0) && (maxDatumSize != token.datumSize)) { - exceptionString = String.format("In FPD file, for dynamic PCD %s, the datum size in module %s is %d, but "+ - "the datum size in is %d, they are not match!", + exceptionString = String.format("In the FPD file, for dynamic PCD %s, the datum size in module %s is %d, but "+ + "the datum size in is %d, they do not match!", token.cName, moduleName, maxDatumSize, @@ -552,8 +529,8 @@ public abstract class PlatformPcdPreprocessAction { } tokenNumber = Long.decode(dynamicInfo.getToken().toString()); if (tokenNumber != token.tokenNumber) { - exceptionString = String.format("In FPD file, for dynamic PCD %s, the token number in module %s is 0x%x, but"+ - "in , the token number is 0x%x, they are not match!", + exceptionString = String.format("In the FPD file, for dynamic PCD %s, the token number in module %s is 0x%x, but "+ + "in the section, the token number is 0x%x, they do not match!", token.cName, moduleName, token.tokenNumber, @@ -595,20 +572,6 @@ public abstract class PlatformPcdPreprocessAction { token.skuData.add(skuInstance); - // - // Judege wether is same of datum between module's information - // and dynamic information. - // - if (datum != null) { - if ((skuInstance.id == 0) && - !datum.toString().equalsIgnoreCase(skuInfoList.get(index).getValue().toString())) { - exceptionString = "In FPD file, for dynamic PCD " + token.cName + ", the value in module " + moduleName + " is " + datum.toString() + " but the "+ - "value of sku 0 data in is " + skuInstance.value.value + ". They are must be same!"+ - " or you could not define value for a dynamic PCD in every !"; - putError(exceptionString); - return null; - } - } continue; } @@ -618,8 +581,8 @@ public abstract class PlatformPcdPreprocessAction { if (skuInfoList.get(index).getVariableName() != null) { exceptionString = null; if (skuInfoList.get(index).getVariableGuid() == null) { - exceptionString = String.format("In FPD file, for dynamic PCD %s in section in FPD "+ - "file, who use HII, but there is no defined for Sku %d data!", + exceptionString = String.format("In the FPD file, for dynamic PCD %s in section in FPD "+ + "file, use of HII was defined, but there is no defined for SKU %d data!", token.cName, index); putError(exceptionString); @@ -627,8 +590,8 @@ public abstract class PlatformPcdPreprocessAction { } if (skuInfoList.get(index).getVariableOffset() == null) { - exceptionString = String.format("In FPD file, for dynamic PCD %s in section in FPD "+ - "file, who use HII, but there is no defined for Sku %d data!", + exceptionString = String.format("In the FPD file, for dynamic PCD %s in section in FPD "+ + "file, use of HII was defined, but there is no defined for SKU %d data!", token.cName, index); putError(exceptionString); @@ -636,8 +599,8 @@ public abstract class PlatformPcdPreprocessAction { } if (skuInfoList.get(index).getHiiDefaultValue() == null) { - exceptionString = String.format("In FPD file, for dynamic PCD %s in section in FPD "+ - "file, who use HII, but there is no defined for Sku %d data!", + exceptionString = String.format("In the FPD file, for dynamic PCD %s in section in FPD "+ + "file, use of HII was defined, but there is no defined for SKU %d data!", token.cName, index); putError(exceptionString); @@ -660,8 +623,8 @@ public abstract class PlatformPcdPreprocessAction { offset = Integer.decode(skuInfoList.get(index).getVariableOffset()); if (offset > 0xFFFF) { - putError(String.format("In FPD file, for dynamic PCD %s , the variable offset defined in sku %d data "+ - "exceed 64K, it is not allowed!", + putError(String.format("In the FPD file, for dynamic PCD %s, the variable offset defined in SKU %d data "+ + "exceeds 64K, which is not allowed!", token.cName, index)); return null; @@ -672,7 +635,7 @@ public abstract class PlatformPcdPreprocessAction { // variableGuidString = getGuidInfoFromSpd(skuInfoList.get(index).getVariableGuid().toString()); if (variableGuidString == null) { - putError(String.format("In FPD file, for dynamic PCD %s, the variable guid %s can be found in all SPD file!", + putError(String.format("In the FPD file, for dynamic PCD %s, the variable guid: %s cannot be found in any SPD file!", token.cName, skuInfoList.get(index).getVariableGuid().toString())); return null; @@ -700,16 +663,16 @@ public abstract class PlatformPcdPreprocessAction { continue; } - exceptionString = String.format("In FPD file, for dynamic PCD %s, the dynamic info must "+ - "be one of 'DefaultGroup', 'HIIGroup', 'VpdGroup'.", + exceptionString = String.format("In the FPD file, for dynamic PCD %s, the dynamic info must "+ + "be one of: 'DefaultGroup', 'HIIGroup', 'VpdGroup'.", token.cName); putError(exceptionString); return null; } if (!hasSkuId0) { - exceptionString = String.format("In FPD file, for dynamic PCD %s in , there are "+ - "no sku id = 0 data, which is required for every dynamic PCD", + exceptionString = String.format("In the FPD file, for dynamic PCD %s in , there is "+ + "no SKU ID = 0 data, which is required for every dynamic PCD", token.cName); putError(exceptionString); return null; @@ -751,7 +714,7 @@ public abstract class PlatformPcdPreprocessAction { tokenSpaceStrRet = getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName()); if (tokenSpaceStrRet == null) { - putError("Fail to get Token space guid for token" + pcdBuildData.getCName()); + putError("Failed to get the Token Space Guid for token" + pcdBuildData.getCName()); continue; } @@ -764,7 +727,7 @@ public abstract class PlatformPcdPreprocessAction { pcdType = Token.getPcdTypeFromString(pcdBuildData.getItemType().toString()); if (pcdType != Token.PCD_TYPE.DYNAMIC_EX) { - putError(String.format("In FPD file, it not allowed for DYNAMIC PCD %s who is no used by any module", + putError(String.format("In the FPD file, it not allowed to define DYNAMIC PCD %s that is not used by any module", pcdBuildData.getCName())); continue; } @@ -832,8 +795,8 @@ public abstract class PlatformPcdPreprocessAction { if (skuInfoList.get(index).getVariableName() != null) { exceptionString = null; if (skuInfoList.get(index).getVariableGuid() == null) { - exceptionString = String.format("In FPD file, for dynamic PCD %s in section in FPD "+ - "file, who use HII, but there is no defined for Sku %d data!", + exceptionString = String.format("In the FPD file, for dynamic PCD %s in the section of the FPD "+ + "file, use of HII is defined, but there is no defined for SKU %d data!", token.cName, index); putError(exceptionString); @@ -841,8 +804,8 @@ public abstract class PlatformPcdPreprocessAction { } if (skuInfoList.get(index).getVariableOffset() == null) { - exceptionString = String.format("In FPD file, for dynamic PCD %s in section in FPD "+ - "file, who use HII, but there is no defined for Sku %d data!", + exceptionString = String.format("In the FPD file, for dynamic PCD %s in the section of the FPD "+ + "file, use of HII is defined, but there is no defined for SKU %d data!", token.cName, index); putError(exceptionString); @@ -850,8 +813,8 @@ public abstract class PlatformPcdPreprocessAction { } if (skuInfoList.get(index).getHiiDefaultValue() == null) { - exceptionString = String.format("In FPD file, for dynamic PCD %s in section in FPD "+ - "file, who use HII, but there is no defined for Sku %d data!", + exceptionString = String.format("In the FPD file, for dynamic PCD %s in the section of the FPD "+ + "file, use of HII is defined, but there is no defined for SKU %d data!", token.cName, index); putError(exceptionString); @@ -875,8 +838,8 @@ public abstract class PlatformPcdPreprocessAction { offset = Integer.decode(skuInfoList.get(index).getVariableOffset()); if (offset > 0xFFFF) { - exceptionString = String.format("In FPD file, for dynamic PCD %s , the variable offset defined in sku %d data "+ - "exceed 64K, it is not allowed!", + exceptionString = String.format("In the FPD file, for dynamic PCD %s, the variable offset defined in SKU %d data "+ + "exceeds 64K, which is not allowed!", token.cName, index); putError(exceptionString); @@ -888,7 +851,7 @@ public abstract class PlatformPcdPreprocessAction { // variableGuidString = getGuidInfoFromSpd(skuInfoList.get(index).getVariableGuid().toString()); if (variableGuidString == null) { - exceptionString = String.format("In FPD file, for dynamic PCD %s, the variable guid %s can be found in all SPD file!", + exceptionString = String.format("In the FPD file, for dynamic PCD %s, the variable guid %s cannot be found in any SPD file!", token.cName, skuInfoList.get(index).getVariableGuid().toString()); putError(exceptionString); @@ -917,15 +880,15 @@ public abstract class PlatformPcdPreprocessAction { continue; } - exceptionString = String.format("In FPD file, for dynamic PCD %s, the dynamic info must "+ + exceptionString = String.format("In the FPD file, for dynamic PCD %s, the dynamic info must "+ "be one of 'DefaultGroup', 'HIIGroup', 'VpdGroup'.", token.cName); putError(exceptionString); } if (!hasSkuId0) { - exceptionString = String.format("In FPD file, for dynamic PCD %s in , there are "+ - "no sku id = 0 data, which is required for every dynamic PCD", + exceptionString = String.format("In the FPD file, for dynamic PCD %s in , there is "+ + "no SKU ID = 0 data, which is required for every dynamic PCD", token.cName); putError(exceptionString); continue; @@ -984,7 +947,7 @@ public abstract class PlatformPcdPreprocessAction { if ((uuidString.charAt(0) == '0') && ((uuidString.charAt(1) == 'x') || (uuidString.charAt(1) == 'X'))) { splitStringArray = uuidString.split("," ); if (splitStringArray.length != 11) { - throw new PlatformPcdPreprocessException ("Wrong format for UUID string: " + uuidString); + throw new PlatformPcdPreprocessException ("Wrong format for GUID string: " + uuidString); } //