//\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
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
\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
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
// 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
//\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
//\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
//\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
//\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
//\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
//\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
\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
//\r
isUnified = OutputManager.getInstance().prepareBuildDir(getProject());\r
\r
+ String buildDir = getProject().getProperty("BUILD_DIR");\r
//\r
// For every Target and ToolChain\r
//\r
//\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
//\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
//\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
**/\r
public class PlatformBuildFileGenerator {\r
\r
- private String platformName;\r
- \r
///\r
/// Mapping from modules identification to out put file name\r
///\r
\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
+ "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
//\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
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