]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
changed TOOLS_DEFINITION_FILE to TOOL_CHAIN_CONF;
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / GenBuildTask.java
index 9eb509bca3bfe97df3ec3278647c617e1a0e255e..6dd0a4fff0d55c82235152ce6341c9c0294b9264 100644 (file)
@@ -100,11 +100,10 @@ public class GenBuildTask extends Ant {
     private ModuleIdentification moduleId;\r
 \r
     private Vector<Property> properties = new Vector<Property>();\r
-    \r
+\r
     private static Stack<Hashtable> backupPropertiesStack = new Stack<Hashtable>();\r
     \r
-    \r
-    private static Hashtable backupProperties;\r
+    private boolean isSingleModuleBuild = false;\r
     \r
     /**\r
       Public construct method. It is necessary for ANT task.\r
@@ -170,7 +169,7 @@ public class GenBuildTask extends Ant {
         //\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
@@ -180,8 +179,8 @@ public class GenBuildTask extends Ant {
             //\r
             // Platform build. Restore the platform related info\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
@@ -243,6 +242,15 @@ public class GenBuildTask extends Ant {
                 getProject().setProperty("TARGET", targetList[i]);\r
                 String[] toolchainList = GlobalData.getToolChainInfo().getTagnames();\r
                 for(int j = 0; j < toolchainList.length; j ++){\r
+                    //\r
+                    // check if any tool is defined for current target + toolchain + arch\r
+                    // don't do anything if no tools found\r
+                    // \r
+                    if (GlobalData.isCommandSet(targetList[i], toolchainList[j], archList[k]) == false) {\r
+                        System.out.println("!!!Warning: No build issued. No tools found for [target=" + targetList[i] + " toolchain=" + toolchainList[j] + " arch=" + archList[k] + "]\n");\r
+                        continue;\r
+                    }\r
+\r
                     //\r
                     // Prepare for toolchain related common properties\r
                     // TOOLCHAIN\r
@@ -309,13 +317,13 @@ public class GenBuildTask extends Ant {
         //\r
         // Read ACTIVE_PLATFORM's FPD file (Call FpdParserTask's method)\r
         //\r
-        String activePlatformName = getProject().getProperty("ACTIVE_PLATFORM");\r
+        String filename = getProject().getProperty("PLATFORM_FILE");\r
         \r
-        if (activePlatformName == null){\r
+        if (filename == null){\r
             throw new BuildException("Plese set ACTIVE_PLATFORM if you want to build a single module. ");\r
         }\r
         \r
-        PlatformIdentification platformId = GlobalData.getPlatform(activePlatformName);\r
+        PlatformIdentification platformId = GlobalData.getPlatform(filename);\r
         \r
         //\r
         // Read FPD file\r
@@ -328,7 +336,7 @@ public class GenBuildTask extends Ant {
         // 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
@@ -766,4 +774,8 @@ public class GenBuildTask extends Ant {
             getProject().setProperty(item, (String)backupProperties.get(item));\r
         }\r
     }\r
+\r
+    public void setSingleModuleBuild(boolean isSingleModuleBuild) {\r
+        this.isSingleModuleBuild = isSingleModuleBuild;\r
+    }\r
 }\r