X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2Fpcd%2Faction%2FPlatformPcdPreprocessActionForBuilding.java;h=4d2335dfd2525975e791e01d124b1bce262b858e;hp=0b2fd0b0109e17b5b8ad9bcf30f0e1eb879fee77;hb=11eb278ae57cfc9ba415fcf91e61dea56d6082c0;hpb=a04ab2ba89cf59331b4f4087799de4a188ab8796 diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java index 0b2fd0b010..4d2335dfd2 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java +++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java @@ -19,7 +19,6 @@ package org.tianocore.build.pcd.action; import java.io.File; import java.io.IOException; -import java.math.BigInteger; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -50,7 +49,7 @@ import org.tianocore.pcd.exception.PlatformPcdPreprocessException; **/ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreprocessAction { /// - /// FPD file is the root file. + /// FPD file path. /// private String fpdFilePath; @@ -88,7 +87,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces /** Common function interface for outer. - @param fpdFilePath The fpd file path of current build or analysis. + @param fpdFilePath The fpd file path of current build or processing. @param messageLevel The message level for this Action. @throws PlatformPreprocessBuildException @@ -98,7 +97,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces **/ public void perform(String fpdFilePath, int messageLevel) throws PlatformPcdPreprocessBuildException { - setFPDFilePath(fpdFilePath); + this.fpdFilePath = fpdFilePath; setActionMessageLevel(messageLevel); checkParameter(); execute(); @@ -121,7 +120,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces **/ public void execute() throws PlatformPcdPreprocessBuildException { - String errorMessageHeader = "Fail to initialize Pcd memory database for building. Because:"; + String errorMessageHeader = "Failed to initialize the Pcd memory database because: "; String errorsForPreprocess = null; // @@ -152,7 +151,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces try { genPcdDatabaseSourceCode (); } catch (EntityException exp) { - throw new PlatformPcdPreprocessBuildException(errorMessageHeader + exp.getMessage()); + throw new PlatformPcdPreprocessBuildException(errorMessageHeader + "\r\n" + exp.getMessage()); } } @@ -170,7 +169,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces try { tokenSpaceStrRet = GlobalData.getGuidInfoFromCname(guidCName); } catch ( Exception e ) { - throw new PlatformPcdPreprocessException ("Failed get Guid CName " + guidCName + "from SPD file!"); + throw new PlatformPcdPreprocessException ("Failed to get Guid CName " + guidCName + " from the SPD file!"); } return tokenSpaceStrRet; } @@ -303,8 +302,8 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces dynamicPcdBuildDefinitions = fpdDocInstance.getPlatformSurfaceArea().getDynamicPcdBuildDefinitions(); if (dynamicPcdBuildDefinitions == null) { - exceptionString = String.format("[FPD file error] There are no in FPD file but contains Dynamic type "+ - "PCD entry %s in module %s!", + exceptionString = String.format("[FPD file error] There are no elements in FPD file but there are Dynamic type "+ + "PCD entries %s in module %s!", token.cName, moduleName); putError(exceptionString); @@ -323,7 +322,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(), tokenSpaceStrRet); - if (dynamicPrimaryKey.equalsIgnoreCase(token.getPrimaryKeyString())) { + if (dynamicPrimaryKey.equals(token.getPrimaryKeyString())) { return dynamicPcdBuildDataArray.get(index); } } @@ -374,11 +373,11 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces File file = null; if (fpdFilePath == null) { - throw new PlatformPcdPreprocessBuildException("WorkspacePath and FPDFileName should be blank for CollectPCDAtion!"); + throw new PlatformPcdPreprocessBuildException("FPDFileName should be empty for CollectPCDAtion!"); } if (fpdFilePath.length() == 0) { - throw new PlatformPcdPreprocessBuildException("WorkspacePath and FPDFileName should be blank for CollectPCDAtion!"); + throw new PlatformPcdPreprocessBuildException("FPDFileName should be empty for CollectPCDAtion!"); } file = new File(fpdFilePath); @@ -387,23 +386,4 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces throw new PlatformPcdPreprocessBuildException("FPD File " + fpdFilePath + " does not exist!"); } } - - /** - Test case function - - @param argv parameter from command line - **/ - public static void main(String argv[]) throws PlatformPcdPreprocessBuildException { - PlatformPcdPreprocessActionForBuilding ca = new PlatformPcdPreprocessActionForBuilding(); - String projectDir = "x:/edk2"; - ca.setFPDFilePath(projectDir + "/EdkNt32Pkg/Nt32.fpd"); - ca.setActionMessageLevel(ActionMessage.MAX_MESSAGE_LEVEL); - GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", - projectDir, - "tools_def.txt"); - System.out.println("After initInfo!"); - FpdParserTask fpt = new FpdParserTask(); - fpt.parseFpdFile(new File(projectDir + "/EdkNt32Pkg/Nt32.fpd")); - ca.execute(); - } }