Move ${PLATFORM}_build.xml from PLATFORM_DIR to BULID_DIR. Now, all output files will be only under BUILD_DIR. To change BUILD_DIR in FPD.PlatformDefinitions.OutputDirectory, both abstract and relative path is allowed. For relative path is relative to WORKSPACE_DIR. Default BUILD_DIR is PLATFORM_DIR/BUILD.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1489 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
wuyizhong 2006-09-07 02:39:37 +00:00
parent 67ce7c51e7
commit 02c768ee72
5 changed files with 28 additions and 26 deletions

View File

@ -263,7 +263,7 @@ public class FrameworkBuildTask extends Task{
// //
if (type.compareTo("cleanall") == 0) { if (type.compareTo("cleanall") == 0) {
File platformBuildFile = File platformBuildFile =
new File(getProject().getProperty("PLATFORM_DIR") new File(getProject().getProperty("BUILD_DIR")
+ File.separatorChar + File.separatorChar
+ getProject().getProperty("PLATFORM") + getProject().getProperty("PLATFORM")
+ "_build.xml"); + "_build.xml");

View File

@ -25,6 +25,7 @@ import org.tianocore.build.GenBuildTask;
import org.tianocore.build.fpd.FpdParserForThread; import org.tianocore.build.fpd.FpdParserForThread;
import org.tianocore.build.id.FpdModuleIdentification; import org.tianocore.build.id.FpdModuleIdentification;
import org.tianocore.build.id.ModuleIdentification; import org.tianocore.build.id.ModuleIdentification;
import org.tianocore.common.logger.EdkLog;
/** /**
Add more comment here. Add more comment here.
@ -145,7 +146,7 @@ public class GenBuildThread implements Runnable {
status = FpdParserForThread.STATUS_END_RUN; status = FpdParserForThread.STATUS_END_RUN;
System.out.println(fpdModuleId + " build finished. "); EdkLog.log("GenBuildThread", fpdModuleId + " build finished. ");
// //
// //

View File

@ -32,6 +32,7 @@ import org.tianocore.build.id.ModuleIdentification;
import org.tianocore.build.FrameworkBuildTask; import org.tianocore.build.FrameworkBuildTask;
import org.tianocore.build.GenBuildThread; import org.tianocore.build.GenBuildThread;
import org.tianocore.common.exception.EdkException; import org.tianocore.common.exception.EdkException;
import org.tianocore.common.logger.EdkLog;
/** /**
@ -79,6 +80,7 @@ public class FpdParserForThread extends FpdParserTask {
// Prepare BUILD_DIR // Prepare BUILD_DIR
// //
isUnified = OutputManager.getInstance().prepareBuildDir(getProject()); isUnified = OutputManager.getInstance().prepareBuildDir(getProject());
String buildDir = getProject().getProperty("BUILD_DIR");
// //
// For every Target and ToolChain // For every Target and ToolChain
@ -90,7 +92,7 @@ public class FpdParserForThread extends FpdParserTask {
// //
// Prepare FV_DIR // Prepare FV_DIR
// //
String ffsCommonDir = getProject().getProperty("BUILD_DIR") + File.separatorChar String ffsCommonDir = buildDir + File.separatorChar
+ targetList[i] + File.separatorChar + targetList[i] + File.separatorChar
+ toolchainList[j]; + toolchainList[j];
File fvDir = new File(ffsCommonDir + File.separatorChar + "FV"); File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");
@ -107,7 +109,8 @@ public class FpdParserForThread extends FpdParserTask {
// //
// Gen build.xml // Gen build.xml
// //
PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq); String platformBuildFile = buildDir + File.separatorChar + platformId.getName() + "_build.xml";
PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq, platformBuildFile);
fileGenerator.genBuildFile(); fileGenerator.genBuildFile();
// //
@ -135,13 +138,13 @@ public class FpdParserForThread extends FpdParserTask {
// //
Ant ant = new Ant(); Ant ant = new Ant();
ant.setProject(getProject()); ant.setProject(getProject());
ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml"); ant.setAntfile(platformBuildFile);
ant.setTarget("prebuild"); ant.setTarget("prebuild");
ant.setInheritAll(true); ant.setInheritAll(true);
ant.init(); ant.init();
ant.execute(); ant.execute();
System.out.println("Task number is " + allThreads.size()); EdkLog.log(this, "Task number is " + allThreads.size());
// //
// Waiting for all thread over, or time out // Waiting for all thread over, or time out
@ -189,7 +192,7 @@ public class FpdParserForThread extends FpdParserTask {
// //
// Exist ready thread // Exist ready thread
// //
System.out.println("## Exist ready thread"); EdkLog.log(this, "## Exist ready thread");
} else if (existNoneReady && currentRunNumber == 0) { } else if (existNoneReady && currentRunNumber == 0) {
// //
@ -200,14 +203,14 @@ public class FpdParserForThread extends FpdParserTask {
// //
// Current queue build finish, move to next // Current queue build finish, move to next
// //
System.out.println("## Current queue build finish, move to next"); EdkLog.log(this, "## Current queue build finish, move to next");
++currentQueueCode; ++currentQueueCode;
continue ; continue ;
} else { } else {
// //
// active thread exist, but no ready thread // active thread exist, but no ready thread
// //
System.out.println("## active thread exist, but no ready thread" + currentRunNumber); EdkLog.log(this, "## active thread exist, but no ready thread" + currentRunNumber);
} }
try { try {
@ -223,7 +226,7 @@ public class FpdParserForThread extends FpdParserTask {
// //
ant = new Ant(); ant = new Ant();
ant.setProject(getProject()); ant.setProject(getProject());
ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml"); ant.setAntfile(platformBuildFile);
ant.setTarget("fvs"); ant.setTarget("fvs");
ant.setInheritAll(true); ant.setInheritAll(true);
ant.init(); ant.init();
@ -231,7 +234,7 @@ public class FpdParserForThread extends FpdParserTask {
ant = new Ant(); ant = new Ant();
ant.setProject(getProject()); ant.setProject(getProject());
ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml"); ant.setAntfile(platformBuildFile);
ant.setTarget("postbuild"); ant.setTarget("postbuild");
ant.setInheritAll(true); ant.setInheritAll(true);
ant.init(); ant.init();

View File

@ -125,6 +125,7 @@ public class FpdParserTask extends Task {
// //
isUnified = OutputManager.getInstance().prepareBuildDir(getProject()); isUnified = OutputManager.getInstance().prepareBuildDir(getProject());
String buildDir = getProject().getProperty("BUILD_DIR");
// //
// For every Target and ToolChain // For every Target and ToolChain
// //
@ -135,7 +136,7 @@ public class FpdParserTask extends Task {
// //
// Prepare FV_DIR // Prepare FV_DIR
// //
String ffsCommonDir = getProject().getProperty("BUILD_DIR") + File.separatorChar String ffsCommonDir = buildDir + File.separatorChar
+ targetList[i] + "_" + targetList[i] + "_"
+ toolchainList[j]; + toolchainList[j];
File fvDir = new File(ffsCommonDir + File.separatorChar + "FV"); File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");
@ -152,7 +153,8 @@ public class FpdParserTask extends Task {
// //
// Gen build.xml // Gen build.xml
// //
PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq); String platformBuildFile = buildDir + File.separatorChar + platformId.getName() + "_build.xml";
PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq, platformBuildFile);
fileGenerator.genBuildFile(); fileGenerator.genBuildFile();
// //
@ -160,7 +162,7 @@ public class FpdParserTask extends Task {
// //
Ant ant = new Ant(); Ant ant = new Ant();
ant.setProject(getProject()); ant.setProject(getProject());
ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml"); ant.setAntfile(platformBuildFile);
ant.setTarget(type); ant.setTarget(type);
ant.setInheritAll(true); ant.setInheritAll(true);
ant.init(); ant.init();

View File

@ -47,8 +47,6 @@ import org.w3c.dom.NodeList;
**/ **/
public class PlatformBuildFileGenerator { public class PlatformBuildFileGenerator {
private String platformName;
/// ///
/// Mapping from modules identification to out put file name /// Mapping from modules identification to out put file name
/// ///
@ -64,6 +62,8 @@ public class PlatformBuildFileGenerator {
private SurfaceAreaQuery saq = null; private SurfaceAreaQuery saq = null;
private File platformBuildFile = null;
private Project project; private Project project;
private String info = "DO NOT EDIT \n" private String info = "DO NOT EDIT \n"
@ -72,13 +72,13 @@ public class PlatformBuildFileGenerator {
+ "Abstract:\n" + "Abstract:\n"
+ "Auto-generated ANT build file for building EFI Modules and Platforms\n"; + "Auto-generated ANT build file for building EFI Modules and Platforms\n";
public PlatformBuildFileGenerator(Project project, Map<FpdModuleIdentification, String> outfiles, Map<String, Set<FpdModuleIdentification>> fvs, boolean isUnified, SurfaceAreaQuery saq){ public PlatformBuildFileGenerator(Project project, Map<FpdModuleIdentification, String> outfiles, Map<String, Set<FpdModuleIdentification>> fvs, boolean isUnified, SurfaceAreaQuery saq, String platformBuildFile){
this.project = project; this.project = project;
this.outfiles = outfiles; this.outfiles = outfiles;
this.isUnified = isUnified; this.isUnified = isUnified;
this.fvs = fvs; this.fvs = fvs;
this.saq = saq; this.saq = saq;
this.platformName = project.getProperty("PLATFORM"); this.platformBuildFile = new File(platformBuildFile);
} }
/** /**
@ -164,14 +164,10 @@ public class PlatformBuildFileGenerator {
// //
Source source = new DOMSource(document); Source source = new DOMSource(document);
// //
// Prepare the output file
//
File file = new File(project.getProperty("PLATFORM_DIR") + File.separatorChar + platformName + "_build.xml");
//
// generate all directory path // generate all directory path
// //
(new File(file.getParent())).mkdirs(); (new File(platformBuildFile.getParent())).mkdirs();
Result result = new StreamResult(file); Result result = new StreamResult(platformBuildFile);
// //
// Write the DOM document to the file // Write the DOM document to the file
// //
@ -180,7 +176,7 @@ public class PlatformBuildFileGenerator {
xformer.setOutputProperty(OutputKeys.INDENT, "yes"); xformer.setOutputProperty(OutputKeys.INDENT, "yes");
xformer.transform(source, result); xformer.transform(source, result);
} catch (Exception ex) { } catch (Exception ex) {
throw new BuildException("Generation of the " + platformName + "_build.xml failed!\n" + ex.getMessage()); throw new BuildException("Generating platform build file [" + platformBuildFile.getPath() + "_build.xml] failed. \n" + ex.getMessage());
} }
} }