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) {
File platformBuildFile =
new File(getProject().getProperty("PLATFORM_DIR")
new File(getProject().getProperty("BUILD_DIR")
+ File.separatorChar
+ getProject().getProperty("PLATFORM")
+ "_build.xml");

View File

@ -25,6 +25,7 @@ import org.tianocore.build.GenBuildTask;
import org.tianocore.build.fpd.FpdParserForThread;
import org.tianocore.build.id.FpdModuleIdentification;
import org.tianocore.build.id.ModuleIdentification;
import org.tianocore.common.logger.EdkLog;
/**
Add more comment here.
@ -145,7 +146,7 @@ public class GenBuildThread implements Runnable {
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.GenBuildThread;
import org.tianocore.common.exception.EdkException;
import org.tianocore.common.logger.EdkLog;
/**
@ -79,6 +80,7 @@ public class FpdParserForThread extends FpdParserTask {
// Prepare BUILD_DIR
//
isUnified = OutputManager.getInstance().prepareBuildDir(getProject());
String buildDir = getProject().getProperty("BUILD_DIR");
//
// For every Target and ToolChain
@ -90,7 +92,7 @@ public class FpdParserForThread extends FpdParserTask {
//
// Prepare FV_DIR
//
String ffsCommonDir = getProject().getProperty("BUILD_DIR") + File.separatorChar
String ffsCommonDir = buildDir + File.separatorChar
+ targetList[i] + File.separatorChar
+ toolchainList[j];
File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");
@ -107,7 +109,8 @@ public class FpdParserForThread extends FpdParserTask {
//
// 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();
//
@ -135,13 +138,13 @@ public class FpdParserForThread extends FpdParserTask {
//
Ant ant = new Ant();
ant.setProject(getProject());
ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");
ant.setAntfile(platformBuildFile);
ant.setTarget("prebuild");
ant.setInheritAll(true);
ant.init();
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
@ -189,7 +192,7 @@ public class FpdParserForThread extends FpdParserTask {
//
// Exist ready thread
//
System.out.println("## Exist ready thread");
EdkLog.log(this, "## Exist ready thread");
} else if (existNoneReady && currentRunNumber == 0) {
//
@ -200,14 +203,14 @@ public class FpdParserForThread extends FpdParserTask {
//
// 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;
continue ;
} else {
//
// 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 {
@ -223,7 +226,7 @@ public class FpdParserForThread extends FpdParserTask {
//
ant = new Ant();
ant.setProject(getProject());
ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");
ant.setAntfile(platformBuildFile);
ant.setTarget("fvs");
ant.setInheritAll(true);
ant.init();
@ -231,7 +234,7 @@ public class FpdParserForThread extends FpdParserTask {
ant = new Ant();
ant.setProject(getProject());
ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");
ant.setAntfile(platformBuildFile);
ant.setTarget("postbuild");
ant.setInheritAll(true);
ant.init();

View File

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

View File

@ -47,8 +47,6 @@ import org.w3c.dom.NodeList;
**/
public class PlatformBuildFileGenerator {
private String platformName;
///
/// Mapping from modules identification to out put file name
///
@ -64,6 +62,8 @@ public class PlatformBuildFileGenerator {
private SurfaceAreaQuery saq = null;
private File platformBuildFile = null;
private Project project;
private String info = "DO NOT EDIT \n"
@ -72,13 +72,13 @@ public class PlatformBuildFileGenerator {
+ "Abstract:\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.outfiles = outfiles;
this.isUnified = isUnified;
this.fvs = fvs;
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);
//
// Prepare the output file
//
File file = new File(project.getProperty("PLATFORM_DIR") + File.separatorChar + platformName + "_build.xml");
//
// generate all directory path
//
(new File(file.getParent())).mkdirs();
Result result = new StreamResult(file);
(new File(platformBuildFile.getParent())).mkdirs();
Result result = new StreamResult(platformBuildFile);
//
// Write the DOM document to the file
//
@ -180,7 +176,7 @@ public class PlatformBuildFileGenerator {
xformer.setOutputProperty(OutputKeys.INDENT, "yes");
xformer.transform(source, result);
} 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());
}
}