diff options
author | jwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-07-12 02:41:10 +0000 |
---|---|---|
committer | jwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-07-12 02:41:10 +0000 |
commit | 196ad8d77c4a256e6a9b432541d688d2f40f4614 (patch) | |
tree | b6de194d16f7a8134111e2dce0b7925b8ca58a76 /Tools/Source/GenBuild | |
parent | a99a79e46fbb1773772cfa25d33305539f18c58b (diff) | |
download | edk2-platforms-196ad8d77c4a256e6a9b432541d688d2f40f4614.tar.xz |
Fixed EDKT102;
Fixed some dependency check issue and made several optimizations on the dependency check logic. Now the rebuild is speeded up enormously.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@885 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Source/GenBuild')
5 files changed, 39 insertions, 17 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java b/Tools/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java index f09becbad0..286fd69490 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java +++ b/Tools/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java @@ -282,7 +282,7 @@ public class FrameworkBuildTask extends Task{ GlobalData.setToolChainEnvInfo(envToolChainInfo);
str = getValue("TOOL_CHAIN_CONF", targetFileInfo);
- if (str != null) {
+ if (str != null && str.trim().length() > 0) {
toolsDefFilename = str;
}
diff --git a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java index 665ab89232..bac506abfa 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java +++ b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java @@ -247,7 +247,7 @@ public class GenBuildTask extends Ant { // don't do anything if no tools found
//
if (GlobalData.isCommandSet(targetList[i], toolchainList[j], archList[k]) == false) {
- System.out.println("!!!Warning: No build issued. No tools found for [target=" + targetList[i] + " toolchain=" + toolchainList[j] + " arch=" + archList[k] + "]\n");
+ System.out.println("Warning: No build issued. No tools found for [target=" + targetList[i] + " toolchain=" + toolchainList[j] + " arch=" + archList[k] + "]\n");
continue;
}
@@ -431,7 +431,6 @@ public class GenBuildTask extends Ant { key[4] = "NAME";
String cmdName = GlobalData.getCommandSetting(key, fpdModuleId);
File cmdFile = new File(cmdPath + File.separatorChar + cmdName);
-// GlobalData.log.info("PATH: " + cmdFile.getPath());
getProject().setProperty(cmd[m], cmdFile.getPath().replaceAll("(\\\\)", "/"));
//
@@ -439,7 +438,6 @@ public class GenBuildTask extends Ant { //
key[4] = "FLAGS";
String cmdFlags = GlobalData.getCommandSetting(key, fpdModuleId);
-// GlobalData.log.info("Flags: " + cmdFlags);
Set<String> addset = new LinkedHashSet<String>();
Set<String> subset = new LinkedHashSet<String>();
putFlagsToSet(addset, cmdFlags);
@@ -450,7 +448,6 @@ public class GenBuildTask extends Ant { //
key[4] = "EXT";
String extName = GlobalData.getCommandSetting(key, fpdModuleId);
-// GlobalData.log.info("Ext: " + extName);
if ( extName != null && ! extName.equalsIgnoreCase("")) {
getProject().setProperty(cmd[m] + "_EXT", extName);
}
@@ -463,7 +460,6 @@ public class GenBuildTask extends Ant { //
key[4] = "FAMILY";
String toolChainFamily = GlobalData.getCommandSetting(key, fpdModuleId);
-// GlobalData.log.info("FAMILY: " + toolChainFamily);
if (toolChainFamily != null) {
getProject().setProperty(cmd[m] + "_FAMILY", toolChainFamily);
}
@@ -473,7 +469,6 @@ public class GenBuildTask extends Ant { //
key[4] = "SPATH";
String spath = GlobalData.getCommandSetting(key, fpdModuleId);
-// GlobalData.log.info("SPATH: " + spath);
if (spath != null) {
getProject().setProperty(cmd[m] + "_SPATH", spath.replaceAll("(\\\\)", "/"));
}
@@ -486,7 +481,6 @@ public class GenBuildTask extends Ant { //
key[4] = "DPATH";
String dpath = GlobalData.getCommandSetting(key, fpdModuleId);
-// GlobalData.log.info("DPATH: " + dpath);
if (dpath != null) {
getProject().setProperty(cmd[m] + "_DPATH", dpath.replaceAll("(\\\\)", "/"));
}
diff --git a/Tools/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java b/Tools/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java index 0680146cec..b4f34f762a 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java +++ b/Tools/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java @@ -549,7 +549,7 @@ public class ModuleBuildFileGenerator { return ;
}
if (fp.initSections(ffsKeyword, project, fpdModuleId)) {
- String targetFilename = fpdModuleId.getModule().getGuid() + "-" + fpdModuleId.getModule().getName() + FpdParserTask.getSuffix(fpdModuleId.getModule().getModuleType());
+ String targetFilename = fpdModuleId.getModule().getGuid() + "-" + "${BASE_NAME}" + FpdParserTask.getSuffix(fpdModuleId.getModule().getModuleType());
String[] list = fp.getGenSectionElements(document, "${BASE_NAME}", fpdModuleId.getModule().getGuid(), targetFilename);
for (int i = 0; i < list.length; i++) {
diff --git a/Tools/Source/GenBuild/org/tianocore/build/global/DpFileList.java b/Tools/Source/GenBuild/org/tianocore/build/global/DpFileList.java index 8b4b4a0add..dd032526d8 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/global/DpFileList.java +++ b/Tools/Source/GenBuild/org/tianocore/build/global/DpFileList.java @@ -16,10 +16,14 @@ package org.tianocore.build.global; import java.util.ArrayList;
import java.util.List;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.FileSet;
+
/**
DpFileList is a container of Dpfile at the point of ANT task/datatype
**/
-public class DpFileList {
+public class DpFileList extends DataType {
///
/// Keep all the file names from all nested DpFile
///
@@ -46,5 +50,15 @@ public class DpFileList { public void addConfiguredFile(DpFile f) {
this.nameList.addAll(f.getList());
}
+
+ public void addConfiguredFileSet(FileSet fileSet) {
+ DirectoryScanner ds = fileSet.getDirectoryScanner(getProject());
+ String dir = fileSet.getDir(getProject()).getAbsolutePath();
+ String[] files = ds.getIncludedFiles();
+
+ for (int i = 0; i < files.length; ++i) {
+ nameList.add(dir + "/" + files[i]);
+ }
+ }
}
diff --git a/Tools/Source/GenBuild/org/tianocore/build/global/OnDependency.java b/Tools/Source/GenBuild/org/tianocore/build/global/OnDependency.java index 936dac8ea3..ba388a1000 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/global/OnDependency.java +++ b/Tools/Source/GenBuild/org/tianocore/build/global/OnDependency.java @@ -13,13 +13,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. --*/
package org.tianocore.build.global;
+import java.io.File;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.Sequential;
-import java.io.File;
-import java.util.Iterator;
-
/**
Class OnDepdendency is used to check the timestamp between source files and
target files, which can be used to determine if the target files are needed to
@@ -27,6 +29,10 @@ import java.util.Iterator; **/
public class OnDependency extends Task {
///
+ /// cache the modified timestamp of files accessed, to speed up the depencey check
+ ///
+ private static Map<String, Long> timeStampCache = new HashMap<String, Long>();
+ ///
/// source files list
///
private DpFileList sources = null;
@@ -77,12 +83,20 @@ public class OnDependency extends Task { Iterator srcIt = sources.nameList.iterator();
while (srcIt.hasNext()) {
String srcFileName = (String)srcIt.next();
- File srcFile = new File(srcFileName);
- if (!srcFile.exists()) {
- throw new BuildException(srcFileName + " doesn't exist !!!");
+ long srcTimeStamp;
+
+ if (timeStampCache.containsKey(srcFileName)) {
+ srcTimeStamp = ((Long)timeStampCache.get(srcFileName)).longValue();
+ } else {
+ File srcFile = new File(srcFileName);
+ if (!srcFile.exists()) {
+ throw new BuildException(srcFileName + " doesn't exist !!!");
+ }
+ srcTimeStamp = srcFile.lastModified();
+ timeStampCache.put(srcFileName, new Long(srcTimeStamp));
}
- if (dstTimeStamp < srcFile.lastModified()) {
+ if (dstTimeStamp < srcTimeStamp) {
return true;
}
}
|