]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Move ${PLATFORM}_build.xml from PLATFORM_DIR to BULID_DIR. Now, all output files...
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 7 Sep 2006 02:39:37 +0000 (02:39 +0000)
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 7 Sep 2006 02:39:37 +0000 (02:39 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1489 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java
Tools/Source/GenBuild/org/tianocore/build/GenBuildThread.java
Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserForThread.java
Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
Tools/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java

index 14103d7b22f3f076d7abd77c3003973c3c437a15..6d380d9654ae5e3b07b5df56e1894b9f9f676661 100644 (file)
@@ -263,7 +263,7 @@ public class FrameworkBuildTask extends Task{
             //\r
             if (type.compareTo("cleanall") == 0) {\r
                 File platformBuildFile = \r
-                    new File(getProject().getProperty("PLATFORM_DIR") \r
+                    new File(getProject().getProperty("BUILD_DIR") \r
                                     + File.separatorChar \r
                                     + getProject().getProperty("PLATFORM") \r
                                     + "_build.xml");\r
index 5ab7c0aff79f097e5b9e3e535994cae8276884e9..08e46500faf19835e3c36eb9838de08e9cbfc56e 100644 (file)
@@ -25,6 +25,7 @@ import org.tianocore.build.GenBuildTask;
 import org.tianocore.build.fpd.FpdParserForThread;\r
 import org.tianocore.build.id.FpdModuleIdentification;\r
 import org.tianocore.build.id.ModuleIdentification;\r
+import org.tianocore.common.logger.EdkLog;\r
 \r
 /**\r
   Add more comment here. \r
@@ -145,7 +146,7 @@ public class GenBuildThread implements Runnable {
 \r
         status = FpdParserForThread.STATUS_END_RUN;\r
         \r
-        System.out.println(fpdModuleId + " build finished. ");\r
+        EdkLog.log("GenBuildThread", fpdModuleId + " build finished. ");\r
         \r
         //\r
         // \r
index 65516645206f899d18cb46b845b2b59779fd3387..11e926b251a9e27f7f9c6311dfd6ba7254e07d7b 100644 (file)
@@ -32,6 +32,7 @@ import org.tianocore.build.id.ModuleIdentification;
 import org.tianocore.build.FrameworkBuildTask;\r
 import org.tianocore.build.GenBuildThread;\r
 import org.tianocore.common.exception.EdkException;\r
+import org.tianocore.common.logger.EdkLog;\r
 \r
 /**\r
 \r
@@ -79,7 +80,8 @@ public class FpdParserForThread extends FpdParserTask {
         // Prepare BUILD_DIR\r
         //\r
         isUnified = OutputManager.getInstance().prepareBuildDir(getProject());\r
-\r
+        String buildDir = getProject().getProperty("BUILD_DIR");\r
+        \r
         //\r
         // For every Target and ToolChain\r
         //\r
@@ -90,7 +92,7 @@ public class FpdParserForThread extends FpdParserTask {
                 //\r
                 // Prepare FV_DIR\r
                 //\r
-                String ffsCommonDir = getProject().getProperty("BUILD_DIR") + File.separatorChar\r
+                String ffsCommonDir = buildDir + File.separatorChar\r
                                 + targetList[i] + File.separatorChar\r
                                 + toolchainList[j];\r
                 File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");\r
@@ -107,7 +109,8 @@ public class FpdParserForThread extends FpdParserTask {
         //\r
         // Gen build.xml\r
         //\r
-        PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq);\r
+        String platformBuildFile = buildDir + File.separatorChar + platformId.getName() + "_build.xml";\r
+        PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq, platformBuildFile);\r
         fileGenerator.genBuildFile();\r
         \r
         //\r
@@ -135,13 +138,13 @@ public class FpdParserForThread extends FpdParserTask {
         //\r
         Ant ant = new Ant();\r
         ant.setProject(getProject());\r
-        ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");\r
+        ant.setAntfile(platformBuildFile);\r
         ant.setTarget("prebuild");\r
         ant.setInheritAll(true);\r
         ant.init();\r
         ant.execute();\r
         \r
-        System.out.println("Task number is " + allThreads.size());\r
+        EdkLog.log(this, "Task number is " + allThreads.size());\r
         \r
         //\r
         // Waiting for all thread over, or time out\r
@@ -189,7 +192,7 @@ public class FpdParserForThread extends FpdParserTask {
                     //\r
                     // Exist ready thread\r
                     //\r
-                    System.out.println("## Exist ready thread");\r
+                    EdkLog.log(this, "## Exist ready thread");\r
 \r
                 } else if (existNoneReady && currentRunNumber == 0) {\r
                     //\r
@@ -200,14 +203,14 @@ public class FpdParserForThread extends FpdParserTask {
                     //\r
                     // Current queue build finish, move to next\r
                     //\r
-                    System.out.println("## Current queue build finish, move to next");\r
+                    EdkLog.log(this, "## Current queue build finish, move to next");\r
                     ++currentQueueCode;\r
                     continue ;\r
                 } else {\r
                     //\r
                     // active thread exist, but no ready thread\r
                     //\r
-                    System.out.println("## active thread exist, but no ready thread" + currentRunNumber);\r
+                    EdkLog.log(this, "## active thread exist, but no ready thread" + currentRunNumber);\r
                 }\r
 \r
                 try {\r
@@ -223,7 +226,7 @@ public class FpdParserForThread extends FpdParserTask {
         //\r
         ant = new Ant();\r
         ant.setProject(getProject());\r
-        ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");\r
+        ant.setAntfile(platformBuildFile);\r
         ant.setTarget("fvs");\r
         ant.setInheritAll(true);\r
         ant.init();\r
@@ -231,7 +234,7 @@ public class FpdParserForThread extends FpdParserTask {
         \r
         ant = new Ant();\r
         ant.setProject(getProject());\r
-        ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");\r
+        ant.setAntfile(platformBuildFile);\r
         ant.setTarget("postbuild");\r
         ant.setInheritAll(true);\r
         ant.init();\r
index ea14ac350fdee412e4c690919d0bf44e080d285b..88d7e62c8f5412ad8cb8213dfea51d6625968830 100644 (file)
@@ -125,6 +125,7 @@ public class FpdParserTask extends Task {
         //\r
         isUnified = OutputManager.getInstance().prepareBuildDir(getProject());\r
 \r
+        String buildDir = getProject().getProperty("BUILD_DIR");\r
         //\r
         // For every Target and ToolChain\r
         //\r
@@ -135,7 +136,7 @@ public class FpdParserTask extends Task {
                 //\r
                 // Prepare FV_DIR\r
                 //\r
-                String ffsCommonDir = getProject().getProperty("BUILD_DIR") + File.separatorChar\r
+                String ffsCommonDir = buildDir + File.separatorChar\r
                                 + targetList[i] + "_"\r
                                 + toolchainList[j];\r
                 File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");\r
@@ -152,7 +153,8 @@ public class FpdParserTask extends Task {
         //\r
         // Gen build.xml\r
         //\r
-        PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq);\r
+        String platformBuildFile = buildDir + File.separatorChar + platformId.getName() + "_build.xml";\r
+        PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq, platformBuildFile);\r
         fileGenerator.genBuildFile();\r
 \r
         //\r
@@ -160,7 +162,7 @@ public class FpdParserTask extends Task {
         //\r
         Ant ant = new Ant();\r
         ant.setProject(getProject());\r
-        ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");\r
+        ant.setAntfile(platformBuildFile);\r
         ant.setTarget(type);\r
         ant.setInheritAll(true);\r
         ant.init();\r
index 05f6e01ee6046ce2b2d073604957a7ee74a8b762..d4b4622c6098b8279f4e7be393b109a4b56672db 100644 (file)
@@ -47,8 +47,6 @@ import org.w3c.dom.NodeList;
 **/\r
 public class PlatformBuildFileGenerator {\r
 \r
-    private String platformName;\r
-    \r
     ///\r
     /// Mapping from modules identification to out put file name\r
     ///\r
@@ -64,6 +62,8 @@ public class PlatformBuildFileGenerator {
     \r
     private SurfaceAreaQuery saq = null;\r
     \r
+    private File platformBuildFile = null;\r
+    \r
     private Project project;\r
     \r
     private String info = "DO NOT EDIT \n" \r
@@ -72,13 +72,13 @@ public class PlatformBuildFileGenerator {
         + "Abstract:\n"\r
         + "Auto-generated ANT build file for building EFI Modules and Platforms\n";\r
 \r
-    public PlatformBuildFileGenerator(Project project, Map<FpdModuleIdentification, String> outfiles, Map<String, Set<FpdModuleIdentification>> fvs, boolean isUnified, SurfaceAreaQuery saq){\r
+    public PlatformBuildFileGenerator(Project project, Map<FpdModuleIdentification, String> outfiles, Map<String, Set<FpdModuleIdentification>> fvs, boolean isUnified, SurfaceAreaQuery saq, String platformBuildFile){\r
         this.project = project;\r
         this.outfiles = outfiles;\r
         this.isUnified = isUnified;\r
         this.fvs = fvs;\r
         this.saq = saq;\r
-        this.platformName = project.getProperty("PLATFORM");\r
+        this.platformBuildFile = new File(platformBuildFile);\r
     }\r
     \r
     /**\r
@@ -164,14 +164,10 @@ public class PlatformBuildFileGenerator {
             //\r
             Source source = new DOMSource(document);\r
             //\r
-            // Prepare the output file\r
-            //\r
-            File file = new File(project.getProperty("PLATFORM_DIR") + File.separatorChar + platformName + "_build.xml");\r
-            //\r
             // generate all directory path\r
             //\r
-            (new File(file.getParent())).mkdirs();\r
-            Result result = new StreamResult(file);\r
+            (new File(platformBuildFile.getParent())).mkdirs();\r
+            Result result = new StreamResult(platformBuildFile);\r
             //\r
             // Write the DOM document to the file\r
             //\r
@@ -180,7 +176,7 @@ public class PlatformBuildFileGenerator {
             xformer.setOutputProperty(OutputKeys.INDENT, "yes");\r
             xformer.transform(source, result);\r
         } catch (Exception ex) {\r
-            throw new BuildException("Generation of the " + platformName + "_build.xml failed!\n" + ex.getMessage());\r
+            throw new BuildException("Generating platform build file [" + platformBuildFile.getPath() + "_build.xml] failed. \n" + ex.getMessage());\r
         }\r
     }\r
     \r