]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
Remove static from SurfaceAreaQuery.java for preparing parallel build.(1)
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / fpd / FpdParserTask.java
index 488451554796b4854da61b7ce8fa988cc1f311ea..ba6f2cdab0d2fd2d12ee18e678850e3412e66582 100644 (file)
@@ -96,6 +96,8 @@ public class FpdParserTask extends Task {
     ///\r
     private Vector<Property> properties = new Vector<Property>();\r
 \r
+    SurfaceAreaQuery saq = null;\r
+    \r
     private boolean isUnified = true;\r
 \r
     /**\r
@@ -169,7 +171,7 @@ public class FpdParserTask extends Task {
         //\r
         // Gen build.xml\r
         //\r
-        PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified);\r
+        PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq);\r
         fileGenerator.genBuildFile();\r
 \r
         //\r
@@ -194,12 +196,12 @@ public class FpdParserTask extends Task {
                   File write FV.inf files error.\r
     **/\r
     private void genFvInfFiles(String ffsCommonDir) throws BuildException {\r
-        String[] validFv = SurfaceAreaQuery.getFpdValidImageNames();\r
+        String[] validFv = saq.getFpdValidImageNames();\r
         for (int i = 0; i < validFv.length; i++) {\r
             //\r
             // Get all global variables from FPD and set them to properties\r
             //\r
-            String[][] globalVariables = SurfaceAreaQuery.getFpdGlobalVariable();\r
+            String[][] globalVariables = saq.getFpdGlobalVariable();\r
             for (int j = 0; j < globalVariables.length; j++) {\r
                 getProject().setProperty(globalVariables[j][0], globalVariables[j][1]);\r
             }\r
@@ -216,7 +218,7 @@ public class FpdParserTask extends Task {
                 //\r
                 // Options\r
                 //\r
-                String[][] options = SurfaceAreaQuery.getFpdOptions(validFv[i]);\r
+                String[][] options = saq.getFpdOptions(validFv[i]);\r
                 if (options.length > 0) {\r
                     bw.write("[options]");\r
                     bw.newLine();\r
@@ -237,7 +239,7 @@ public class FpdParserTask extends Task {
                 //\r
                 // Attributes;\r
                 //\r
-                String[][] attributes = SurfaceAreaQuery.getFpdAttributes(validFv[i]);\r
+                String[][] attributes = saq.getFpdAttributes(validFv[i]);\r
                 if (attributes.length > 0) {\r
                     bw.write("[attributes]");\r
                     bw.newLine();\r
@@ -258,7 +260,7 @@ public class FpdParserTask extends Task {
                 //\r
                 // Components\r
                 //\r
-                String[][] components = SurfaceAreaQuery.getFpdComponents(validFv[i]);\r
+                String[][] components = saq.getFpdComponents(validFv[i]);\r
                 if (components.length > 0) {\r
                     bw.write("[components]");\r
                     bw.newLine();\r
@@ -325,12 +327,12 @@ public class FpdParserTask extends Task {
 \r
             Map<String, XmlObject> map = new HashMap<String, XmlObject>();\r
             map.put("PlatformSurfaceArea", doc);\r
-            SurfaceAreaQuery.setDoc(map);\r
+            saq = new SurfaceAreaQuery(map);\r
 \r
             //\r
             // Initialize\r
             //\r
-            platformId = SurfaceAreaQuery.getFpdHeader();\r
+            platformId = saq.getFpdHeader();\r
             platformId.setFpdFile(fpdFile);\r
             getProject().setProperty("PLATFORM", platformId.getName());\r
             getProject().setProperty("PLATFORM_FILE", platformId.getRelativeFpdFile().replaceAll("(\\\\)", "/"));\r
@@ -340,17 +342,17 @@ public class FpdParserTask extends Task {
             //\r
             // Build mode. User-defined output dir.\r
             //\r
-            String buildMode = SurfaceAreaQuery.getFpdIntermediateDirectories();\r
-            String userDefinedOutputDir = SurfaceAreaQuery.getFpdOutputDirectory();\r
+            String buildMode = saq.getFpdIntermediateDirectories();\r
+            String userDefinedOutputDir = saq.getFpdOutputDirectory();\r
 \r
             OutputManager.getInstance().setup(userDefinedOutputDir, buildMode);\r
 \r
             //\r
             // TBD. Deal PCD and BuildOption related Info\r
             //\r
-            GlobalData.setFpdBuildOptions(SurfaceAreaQuery.getFpdBuildOptions());\r
+            GlobalData.setFpdBuildOptions(saq.getFpdBuildOptions());\r
 \r
-            GlobalData.setToolChainPlatformInfo(SurfaceAreaQuery.getFpdToolChainInfo());\r
+            GlobalData.setToolChainPlatformInfo(saq.getFpdToolChainInfo());\r
 \r
             //\r
             // Parse all list modules SA\r
@@ -363,7 +365,7 @@ public class FpdParserTask extends Task {
             parseToolChainFamilyOptions();\r
             parseToolChainOptions();\r
 \r
-            SurfaceAreaQuery.setDoc(map);\r
+            saq.push(map);\r
 \r
             //\r
             // Pcd Collection. Call CollectPCDAction to collect pcd info.\r
@@ -379,7 +381,7 @@ public class FpdParserTask extends Task {
       Parse all modules listed in FPD file.\r
     **/\r
     private void parseModuleSAFiles() throws EdkException{\r
-        Map<FpdModuleIdentification, Map<String, XmlObject>> moduleSAs = SurfaceAreaQuery.getFpdModules();\r
+        Map<FpdModuleIdentification, Map<String, XmlObject>> moduleSAs = saq.getFpdModules();\r
 \r
         //\r
         // For every Module lists in FPD file.\r
@@ -397,8 +399,8 @@ public class FpdParserTask extends Task {
             //\r
             // Put fpdModuleId to the corresponding FV\r
             //\r
-            SurfaceAreaQuery.push(GlobalData.getDoc(fpdModuleId));\r
-            String fvBinding = SurfaceAreaQuery.getModuleFvBindingKeyword();\r
+            saq.push(GlobalData.getDoc(fpdModuleId));\r
+            String fvBinding = saq.getModuleFvBindingKeyword();\r
 \r
             fpdModuleId.setFvBinding(fvBinding);\r
             updateFvs(fvBinding, fpdModuleId);\r
@@ -408,7 +410,7 @@ public class FpdParserTask extends Task {
             //\r
             ModuleIdentification moduleId = fpdModuleId.getModule();\r
 \r
-            String baseName = SurfaceAreaQuery.getModuleOutputFileBasename();\r
+            String baseName = saq.getModuleOutputFileBasename();\r
             \r
             if (baseName == null) {\r
                 baseName = moduleId.getName();\r
@@ -422,12 +424,12 @@ public class FpdParserTask extends Task {
             //\r
             GlobalData.addModuleToolChainOption(fpdModuleId, parseModuleBuildOptions(false));\r
             GlobalData.addModuleToolChainFamilyOption(fpdModuleId, parseModuleBuildOptions(true));\r
-            SurfaceAreaQuery.pop();\r
+            saq.pop();\r
         }\r
     }\r
 \r
     private ToolChainMap parseModuleBuildOptions(boolean toolChainFamilyFlag) throws EdkException {\r
-        String[][] options = SurfaceAreaQuery.getModuleBuildOptions(toolChainFamilyFlag);\r
+        String[][] options = saq.getModuleBuildOptions(toolChainFamilyFlag);\r
         if (options == null || options.length == 0) {\r
             return new ToolChainMap();\r
         }\r
@@ -435,7 +437,7 @@ public class FpdParserTask extends Task {
     }\r
 \r
     private ToolChainMap parsePlatformBuildOptions(boolean toolChainFamilyFlag) throws EdkException {\r
-        String[][] options = SurfaceAreaQuery.getPlatformBuildOptions(toolChainFamilyFlag);\r
+        String[][] options = saq.getPlatformBuildOptions(toolChainFamilyFlag);\r
         if (options == null || options.length == 0) {\r
             return new ToolChainMap();\r
         }\r