]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/OutputDirSetup.java
Fully support active platform policy.
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / OutputDirSetup.java
index 6a53fa6dbbabe62f1bc3de96335df420be403689..fc24f6f67b73bf8815c9601bb807218f039c282e 100644 (file)
@@ -8,9 +8,7 @@ import org.apache.tools.ant.Task;
 import org.apache.xmlbeans.XmlObject;\r
 import org.tianocore.build.fpd.FpdParserTask;\r
 import org.tianocore.build.global.GlobalData;\r
-import org.tianocore.build.global.OutputManager;\r
 import org.tianocore.build.global.SurfaceAreaQuery;\r
-import org.tianocore.build.id.FpdModuleIdentification;\r
 import org.tianocore.build.id.ModuleIdentification;\r
 import org.tianocore.build.id.PackageIdentification;\r
 import org.tianocore.build.id.PlatformIdentification;\r
@@ -31,6 +29,7 @@ public class OutputDirSetup extends Task {
     ///\r
     private String componentType;\r
     \r
+    private boolean isSingleModuleBuild = false;\r
 //    private ToolChainFactory toolChainFactory;\r
     \r
     /**\r
@@ -64,7 +63,7 @@ public class OutputDirSetup extends Task {
         //\r
         // Judge whether it is single module build or not\r
         //\r
-        if (getProject().getProperty("PLATFORM") == null) {\r
+        if (isSingleModuleBuild) {\r
             //\r
             // Single Module build\r
             //\r
@@ -74,8 +73,8 @@ public class OutputDirSetup extends Task {
             //\r
             // Platform build\r
             //\r
-            String platformName = getProject().getProperty("PLATFORM");\r
-            PlatformIdentification platformId = GlobalData.getPlatform(platformName);\r
+            String filename = getProject().getProperty("PLATFORM_FILE");\r
+            PlatformIdentification platformId = GlobalData.getPlatform(filename);\r
             getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));\r
             getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));\r
           \r
@@ -160,9 +159,9 @@ public class OutputDirSetup extends Task {
         //\r
         // Read ACTIVE_PLATFORM's FPD file (Call FpdParserTask's method)\r
         //\r
-        String activePlatformName = getProject().getProperty("env.ACTIVE_PLATFORM");\r
-        \r
-        PlatformIdentification platformId = GlobalData.getPlatform(activePlatformName);\r
+        String filename = getProject().getProperty("PLATFORM_FILE");\r
+\r
+        PlatformIdentification platformId = GlobalData.getPlatform(filename);\r
         \r
         //\r
         // Read FPD file\r
@@ -174,7 +173,7 @@ public class OutputDirSetup extends Task {
         // Prepare for Platform related common properties\r
         // PLATFORM, PLATFORM_DIR, PLATFORM_RELATIVE_DIR\r
         //\r
-        getProject().setProperty("PLATFORM", activePlatformName);\r
+        getProject().setProperty("PLATFORM", platformId.getName());\r
         getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));\r
         getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));\r
     }\r