mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
Backup original properties to avoid property overriding message. This change is for multi-thread build preparations. (3)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1438 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
1e8e8a82dd
commit
aca6c736f6
@ -16,6 +16,7 @@ package org.tianocore.build;
|
|||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import java.util.Hashtable;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -26,7 +27,6 @@ import org.apache.tools.ant.Task;
|
|||||||
import org.tianocore.build.fpd.FpdParserForThread;
|
import org.tianocore.build.fpd.FpdParserForThread;
|
||||||
import org.tianocore.build.fpd.FpdParserTask;
|
import org.tianocore.build.fpd.FpdParserTask;
|
||||||
import org.tianocore.build.global.GlobalData;
|
import org.tianocore.build.global.GlobalData;
|
||||||
import org.tianocore.build.global.PropertyManager;
|
|
||||||
import org.tianocore.build.toolchain.ConfigReader;
|
import org.tianocore.build.toolchain.ConfigReader;
|
||||||
import org.tianocore.build.toolchain.ToolChainInfo;
|
import org.tianocore.build.toolchain.ToolChainInfo;
|
||||||
import org.tianocore.common.definitions.ToolDefinitions;
|
import org.tianocore.common.definitions.ToolDefinitions;
|
||||||
@ -74,6 +74,11 @@ public class FrameworkBuildTask extends Task{
|
|||||||
|
|
||||||
private Set<File> msaFiles = new LinkedHashSet<File>();
|
private Set<File> msaFiles = new LinkedHashSet<File>();
|
||||||
|
|
||||||
|
//
|
||||||
|
// This is only for none-multi-thread build to reduce overriding message
|
||||||
|
//
|
||||||
|
public static Hashtable<String, String> originalProperties = new Hashtable<String, String>();
|
||||||
|
|
||||||
String toolsDefFilename = ToolDefinitions.DEFAULT_TOOLS_DEF_FILE_PATH;
|
String toolsDefFilename = ToolDefinitions.DEFAULT_TOOLS_DEF_FILE_PATH;
|
||||||
|
|
||||||
String targetFilename = ToolDefinitions.TARGET_FILE_PATH;
|
String targetFilename = ToolDefinitions.TARGET_FILE_PATH;
|
||||||
@ -81,17 +86,17 @@ public class FrameworkBuildTask extends Task{
|
|||||||
String dbFilename = ToolDefinitions.FRAMEWORK_DATABASE_FILE_PATH;
|
String dbFilename = ToolDefinitions.FRAMEWORK_DATABASE_FILE_PATH;
|
||||||
|
|
||||||
String activePlatform = null;
|
String activePlatform = null;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The flag to present current is multi-thread enabled
|
/// The flag to present current is multi-thread enabled
|
||||||
///
|
///
|
||||||
public static boolean multithread = false;
|
public static boolean multithread = false;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The concurrent thread number
|
/// The concurrent thread number
|
||||||
///
|
///
|
||||||
public static int MAX_CONCURRENT_THREAD_NUMBER = 1;
|
public static int MAX_CONCURRENT_THREAD_NUMBER = 1;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// there are three type: all (build), clean and cleanall
|
/// there are three type: all (build), clean and cleanall
|
||||||
///
|
///
|
||||||
@ -147,7 +152,7 @@ public class FrameworkBuildTask extends Task{
|
|||||||
// Global Data initialization
|
// Global Data initialization
|
||||||
//
|
//
|
||||||
File workspacePath = new File(getProject().getProperty("WORKSPACE"));
|
File workspacePath = new File(getProject().getProperty("WORKSPACE"));
|
||||||
PropertyManager.setProperty(getProject(), "WORKSPACE_DIR", workspacePath.getPath().replaceAll("(\\\\)", "/"));
|
getProject().setProperty("WORKSPACE_DIR", workspacePath.getPath().replaceAll("(\\\\)", "/"));
|
||||||
GlobalData.initInfo(dbFilename, workspacePath.getPath(), toolsDefFilename);
|
GlobalData.initInfo(dbFilename, workspacePath.getPath(), toolsDefFilename);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -228,7 +233,10 @@ public class FrameworkBuildTask extends Task{
|
|||||||
GenBuildTask genBuildTask = new GenBuildTask();
|
GenBuildTask genBuildTask = new GenBuildTask();
|
||||||
genBuildTask.setSingleModuleBuild(true);
|
genBuildTask.setSingleModuleBuild(true);
|
||||||
genBuildTask.setType(type);
|
genBuildTask.setType(type);
|
||||||
PropertyManager.setProperty(getProject(), "PLATFORM_FILE", activePlatform);
|
getProject().setProperty("PLATFORM_FILE", activePlatform);
|
||||||
|
if( !multithread) {
|
||||||
|
originalProperties.put("PLATFORM_FILE", activePlatform);
|
||||||
|
}
|
||||||
genBuildTask.setProject(getProject());
|
genBuildTask.setProject(getProject());
|
||||||
genBuildTask.setMsaFile(buildFile);
|
genBuildTask.setMsaFile(buildFile);
|
||||||
genBuildTask.execute();
|
genBuildTask.execute();
|
||||||
@ -242,8 +250,7 @@ public class FrameworkBuildTask extends Task{
|
|||||||
**/
|
**/
|
||||||
private void backupSystemProperties() {
|
private void backupSystemProperties() {
|
||||||
Map<String, String> sysProperties = System.getenv();
|
Map<String, String> sysProperties = System.getenv();
|
||||||
Set<String> keys = sysProperties.keySet();
|
Iterator<String> iter = sysProperties.keySet().iterator();
|
||||||
Iterator<String> iter = keys.iterator();
|
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
String name = iter.next();
|
String name = iter.next();
|
||||||
|
|
||||||
@ -251,9 +258,17 @@ public class FrameworkBuildTask extends Task{
|
|||||||
// If system environment variable is not in ANT properties, add it
|
// If system environment variable is not in ANT properties, add it
|
||||||
//
|
//
|
||||||
if (getProject().getProperty(name) == null) {
|
if (getProject().getProperty(name) == null) {
|
||||||
PropertyManager.setProperty(getProject(), name, sysProperties.get(name));
|
getProject().setProperty(name, sysProperties.get(name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Hashtable allProperties = getProject().getProperties();
|
||||||
|
Iterator piter = allProperties.keySet().iterator();
|
||||||
|
while (piter.hasNext()) {
|
||||||
|
String name = (String)piter.next();
|
||||||
|
originalProperties.put(new String(name), new String((String)allProperties.get(name)));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private File intercommuniteWithUser(){
|
private File intercommuniteWithUser(){
|
||||||
|
@ -16,6 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
package org.tianocore.build;
|
package org.tianocore.build;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.Hashtable;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -26,6 +27,8 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.apache.tools.ant.BuildException;
|
import org.apache.tools.ant.BuildException;
|
||||||
|
import org.apache.tools.ant.BuildListener;
|
||||||
|
import org.apache.tools.ant.Project;
|
||||||
import org.apache.tools.ant.taskdefs.Ant;
|
import org.apache.tools.ant.taskdefs.Ant;
|
||||||
import org.apache.tools.ant.taskdefs.Property;
|
import org.apache.tools.ant.taskdefs.Property;
|
||||||
import org.apache.xmlbeans.XmlObject;
|
import org.apache.xmlbeans.XmlObject;
|
||||||
@ -38,7 +41,6 @@ import org.tianocore.build.fpd.FpdParserTask;
|
|||||||
import org.tianocore.build.global.GenBuildLogger;
|
import org.tianocore.build.global.GenBuildLogger;
|
||||||
import org.tianocore.build.global.GlobalData;
|
import org.tianocore.build.global.GlobalData;
|
||||||
import org.tianocore.build.global.OutputManager;
|
import org.tianocore.build.global.OutputManager;
|
||||||
import org.tianocore.build.global.PropertyManager;
|
|
||||||
import org.tianocore.build.global.SurfaceAreaQuery;
|
import org.tianocore.build.global.SurfaceAreaQuery;
|
||||||
import org.tianocore.build.id.FpdModuleIdentification;
|
import org.tianocore.build.id.FpdModuleIdentification;
|
||||||
import org.tianocore.build.id.ModuleIdentification;
|
import org.tianocore.build.id.ModuleIdentification;
|
||||||
@ -125,22 +127,24 @@ public class GenBuildTask extends Ant {
|
|||||||
From module build, exception from module surface area invalid.
|
From module build, exception from module surface area invalid.
|
||||||
**/
|
**/
|
||||||
public void execute() throws BuildException {
|
public void execute() throws BuildException {
|
||||||
//
|
if (!FrameworkBuildTask.multithread) {
|
||||||
|
cleanupProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
// set Logger
|
// set Logger
|
||||||
//
|
//
|
||||||
GenBuildLogger logger = new GenBuildLogger(getProject());
|
GenBuildLogger logger = new GenBuildLogger(getProject());
|
||||||
EdkLog.setLogLevel(getProject().getProperty("env.LOGLEVEL"));
|
EdkLog.setLogLevel(getProject().getProperty("env.LOGLEVEL"));
|
||||||
EdkLog.setLogger(logger);
|
EdkLog.setLogger(logger);
|
||||||
|
|
||||||
PropertyManager.setProject(getProject());
|
|
||||||
PropertyManager.save();
|
|
||||||
//
|
//
|
||||||
// Enable all specified properties
|
// Enable all specified properties
|
||||||
//
|
//
|
||||||
Iterator<Property> iter = properties.iterator();
|
Iterator<Property> iter = properties.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
Property item = iter.next();
|
Property item = iter.next();
|
||||||
PropertyManager.setProperty(item.getName(), item.getValue());
|
getProject().setProperty(item.getName(), item.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -181,14 +185,6 @@ public class GenBuildTask extends Ant {
|
|||||||
//
|
//
|
||||||
prepareSingleModuleBuild();
|
prepareSingleModuleBuild();
|
||||||
} else {
|
} else {
|
||||||
//
|
|
||||||
// Platform build. Restore the platform related info
|
|
||||||
//
|
|
||||||
String filename = getProject().getProperty("PLATFORM_FILE");
|
|
||||||
PlatformIdentification platformId = GlobalData.getPlatform(filename);
|
|
||||||
PropertyManager.setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));
|
|
||||||
PropertyManager.setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));
|
|
||||||
|
|
||||||
String packageGuid = getProject().getProperty("PACKAGE_GUID");
|
String packageGuid = getProject().getProperty("PACKAGE_GUID");
|
||||||
String packageVersion = getProject().getProperty("PACKAGE_VERSION");
|
String packageVersion = getProject().getProperty("PACKAGE_VERSION");
|
||||||
PackageIdentification packageId = new PackageIdentification(packageGuid, packageVersion);
|
PackageIdentification packageId = new PackageIdentification(packageGuid, packageVersion);
|
||||||
@ -236,7 +232,7 @@ public class GenBuildTask extends Ant {
|
|||||||
|
|
||||||
for (int k = 0; k < archList.length; k++) {
|
for (int k = 0; k < archList.length; k++) {
|
||||||
|
|
||||||
PropertyManager.setProperty("ARCH", archList[k]);
|
getProject().setProperty("ARCH", archList[k]);
|
||||||
|
|
||||||
FpdModuleIdentification fpdModuleId = new FpdModuleIdentification(moduleId, archList[k]);
|
FpdModuleIdentification fpdModuleId = new FpdModuleIdentification(moduleId, archList[k]);
|
||||||
|
|
||||||
@ -261,7 +257,7 @@ public class GenBuildTask extends Ant {
|
|||||||
// Prepare for target related common properties
|
// Prepare for target related common properties
|
||||||
// TARGET
|
// TARGET
|
||||||
//
|
//
|
||||||
PropertyManager.setProperty("TARGET", targetList[i]);
|
getProject().setProperty("TARGET", targetList[i]);
|
||||||
String[] toolchainList = GlobalData.getToolChainInfo().getTagnames();
|
String[] toolchainList = GlobalData.getToolChainInfo().getTagnames();
|
||||||
for(int j = 0; j < toolchainList.length; j ++){
|
for(int j = 0; j < toolchainList.length; j ++){
|
||||||
//
|
//
|
||||||
@ -277,7 +273,7 @@ public class GenBuildTask extends Ant {
|
|||||||
// Prepare for toolchain related common properties
|
// Prepare for toolchain related common properties
|
||||||
// TOOLCHAIN
|
// TOOLCHAIN
|
||||||
//
|
//
|
||||||
PropertyManager.setProperty("TOOLCHAIN", toolchainList[j]);
|
getProject().setProperty("TOOLCHAIN", toolchainList[j]);
|
||||||
|
|
||||||
System.out.println("Build " + moduleId + " start >>>");
|
System.out.println("Build " + moduleId + " start >>>");
|
||||||
System.out.println("Target: " + targetList[i] + " Tagname: " + toolchainList[j] + " Arch: " + archList[k]);
|
System.out.println("Target: " + targetList[i] + " Tagname: " + toolchainList[j] + " Arch: " + archList[k]);
|
||||||
@ -308,8 +304,6 @@ public class GenBuildTask extends Ant {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyManager.restore();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -347,17 +341,30 @@ public class GenBuildTask extends Ant {
|
|||||||
FpdParserTask fpdParser = new FpdParserTask();
|
FpdParserTask fpdParser = new FpdParserTask();
|
||||||
fpdParser.setProject(getProject());
|
fpdParser.setProject(getProject());
|
||||||
fpdParser.parseFpdFile(platformId.getFpdFile());
|
fpdParser.parseFpdFile(platformId.getFpdFile());
|
||||||
PropertyManager.setProperty("ARCH", fpdParser.getAllArchForModule(moduleId));
|
getProject().setProperty("ARCH", fpdParser.getAllArchForModule(moduleId));
|
||||||
|
|
||||||
//
|
|
||||||
// Prepare for Platform related common properties
|
|
||||||
// PLATFORM, PLATFORM_DIR, PLATFORM_RELATIVE_DIR
|
|
||||||
//
|
|
||||||
PropertyManager.setProperty("PLATFORM", platformId.getName());
|
|
||||||
PropertyManager.setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));
|
|
||||||
PropertyManager.setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void cleanupProperties() {
|
||||||
|
Project newProject = new Project();
|
||||||
|
|
||||||
|
Hashtable<String, String> passdownProperties = FrameworkBuildTask.originalProperties;
|
||||||
|
Iterator<String> iter = passdownProperties.keySet().iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
String item = iter.next();
|
||||||
|
newProject.setProperty(item, passdownProperties.get(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
newProject.setInputHandler(getProject().getInputHandler());
|
||||||
|
|
||||||
|
Iterator listenerIter = getProject().getBuildListeners().iterator();
|
||||||
|
while (listenerIter.hasNext()) {
|
||||||
|
newProject.addBuildListener((BuildListener) listenerIter.next());
|
||||||
|
}
|
||||||
|
|
||||||
|
getProject().initSubProject(newProject);
|
||||||
|
|
||||||
|
setProject(newProject);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Set Module-Related information to properties.
|
Set Module-Related information to properties.
|
||||||
@ -370,29 +377,29 @@ public class GenBuildTask extends Ant {
|
|||||||
// PACKAGE, PACKAGE_GUID, PACKAGE_VERSION, PACKAGE_DIR, PACKAGE_RELATIVE_DIR
|
// PACKAGE, PACKAGE_GUID, PACKAGE_VERSION, PACKAGE_DIR, PACKAGE_RELATIVE_DIR
|
||||||
//
|
//
|
||||||
PackageIdentification packageId = moduleId.getPackage();
|
PackageIdentification packageId = moduleId.getPackage();
|
||||||
PropertyManager.setProperty("PACKAGE", packageId.getName());
|
getProject().setProperty("PACKAGE", packageId.getName());
|
||||||
PropertyManager.setProperty("PACKAGE_GUID", packageId.getGuid());
|
getProject().setProperty("PACKAGE_GUID", packageId.getGuid());
|
||||||
PropertyManager.setProperty("PACKAGE_VERSION", packageId.getVersion());
|
getProject().setProperty("PACKAGE_VERSION", packageId.getVersion());
|
||||||
PropertyManager.setProperty("PACKAGE_DIR", packageId.getPackageDir().replaceAll("(\\\\)", "/"));
|
getProject().setProperty("PACKAGE_DIR", packageId.getPackageDir().replaceAll("(\\\\)", "/"));
|
||||||
PropertyManager.setProperty("PACKAGE_RELATIVE_DIR", packageId.getPackageRelativeDir().replaceAll("(\\\\)", "/"));
|
getProject().setProperty("PACKAGE_RELATIVE_DIR", packageId.getPackageRelativeDir().replaceAll("(\\\\)", "/"));
|
||||||
|
|
||||||
//
|
//
|
||||||
// MODULE or BASE_NAME, GUID or FILE_GUID, VERSION, MODULE_TYPE
|
// MODULE or BASE_NAME, GUID or FILE_GUID, VERSION, MODULE_TYPE
|
||||||
// MODULE_DIR, MODULE_RELATIVE_DIR
|
// MODULE_DIR, MODULE_RELATIVE_DIR
|
||||||
//
|
//
|
||||||
PropertyManager.setProperty("MODULE", moduleId.getName());
|
getProject().setProperty("MODULE", moduleId.getName());
|
||||||
String baseName = saq.getModuleOutputFileBasename();
|
String baseName = saq.getModuleOutputFileBasename();
|
||||||
if (baseName == null) {
|
if (baseName == null) {
|
||||||
PropertyManager.setProperty("BASE_NAME", moduleId.getName());
|
getProject().setProperty("BASE_NAME", moduleId.getName());
|
||||||
} else {
|
} else {
|
||||||
PropertyManager.setProperty("BASE_NAME", baseName);
|
getProject().setProperty("BASE_NAME", baseName);
|
||||||
}
|
}
|
||||||
PropertyManager.setProperty("GUID", moduleId.getGuid());
|
getProject().setProperty("GUID", moduleId.getGuid());
|
||||||
PropertyManager.setProperty("FILE_GUID", moduleId.getGuid());
|
getProject().setProperty("FILE_GUID", moduleId.getGuid());
|
||||||
PropertyManager.setProperty("VERSION", moduleId.getVersion());
|
getProject().setProperty("VERSION", moduleId.getVersion());
|
||||||
PropertyManager.setProperty("MODULE_TYPE", moduleId.getModuleType());
|
getProject().setProperty("MODULE_TYPE", moduleId.getModuleType());
|
||||||
PropertyManager.setProperty("MODULE_DIR", moduleId.getMsaFile().getParent().replaceAll("(\\\\)", "/"));
|
getProject().setProperty("MODULE_DIR", moduleId.getMsaFile().getParent().replaceAll("(\\\\)", "/"));
|
||||||
PropertyManager.setProperty("MODULE_RELATIVE_DIR", moduleId.getModuleRelativePath().replaceAll("(\\\\)", "/"));
|
getProject().setProperty("MODULE_RELATIVE_DIR", moduleId.getModuleRelativePath().replaceAll("(\\\\)", "/"));
|
||||||
|
|
||||||
//
|
//
|
||||||
// SUBSYSTEM
|
// SUBSYSTEM
|
||||||
@ -418,18 +425,18 @@ public class GenBuildTask extends Ant {
|
|||||||
break ;
|
break ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PropertyManager.setProperty("SUBSYSTEM", subsystem);
|
getProject().setProperty("SUBSYSTEM", subsystem);
|
||||||
|
|
||||||
//
|
//
|
||||||
// ENTRYPOINT
|
// ENTRYPOINT
|
||||||
//
|
//
|
||||||
if (arch.equalsIgnoreCase("EBC")) {
|
if (arch.equalsIgnoreCase("EBC")) {
|
||||||
PropertyManager.setProperty("ENTRYPOINT", "EfiStart");
|
getProject().setProperty("ENTRYPOINT", "EfiStart");
|
||||||
} else {
|
} else {
|
||||||
PropertyManager.setProperty("ENTRYPOINT", "_ModuleEntryPoint");
|
getProject().setProperty("ENTRYPOINT", "_ModuleEntryPoint");
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyManager.setProperty("OBJECTS", "");
|
getProject().setProperty("OBJECTS", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getCompilerFlags(String target, String toolchain, FpdModuleIdentification fpdModuleId) throws EdkException {
|
private void getCompilerFlags(String target, String toolchain, FpdModuleIdentification fpdModuleId) throws EdkException {
|
||||||
@ -444,7 +451,7 @@ public class GenBuildTask extends Ant {
|
|||||||
key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_NAME;
|
key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_NAME;
|
||||||
String cmdName = GlobalData.getCommandSetting(key, fpdModuleId);
|
String cmdName = GlobalData.getCommandSetting(key, fpdModuleId);
|
||||||
File cmdFile = new File(cmdPath + File.separatorChar + cmdName);
|
File cmdFile = new File(cmdPath + File.separatorChar + cmdName);
|
||||||
PropertyManager.setProperty(cmd[m], cmdFile.getPath().replaceAll("(\\\\)", "/"));
|
getProject().setProperty(cmd[m], cmdFile.getPath().replaceAll("(\\\\)", "/"));
|
||||||
|
|
||||||
//
|
//
|
||||||
// set CC_FLAGS
|
// set CC_FLAGS
|
||||||
@ -454,7 +461,7 @@ public class GenBuildTask extends Ant {
|
|||||||
Set<String> addset = new LinkedHashSet<String>();
|
Set<String> addset = new LinkedHashSet<String>();
|
||||||
Set<String> subset = new LinkedHashSet<String>();
|
Set<String> subset = new LinkedHashSet<String>();
|
||||||
putFlagsToSet(addset, cmdFlags);
|
putFlagsToSet(addset, cmdFlags);
|
||||||
PropertyManager.setProperty(cmd[m] + "_FLAGS", getProject().replaceProperties(getFlags(addset, subset)));
|
getProject().setProperty(cmd[m] + "_FLAGS", getProject().replaceProperties(getFlags(addset, subset)));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set CC_EXT
|
// Set CC_EXT
|
||||||
@ -462,9 +469,9 @@ public class GenBuildTask extends Ant {
|
|||||||
key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_EXT;
|
key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_EXT;
|
||||||
String extName = GlobalData.getCommandSetting(key, fpdModuleId);
|
String extName = GlobalData.getCommandSetting(key, fpdModuleId);
|
||||||
if ( extName != null && ! extName.equalsIgnoreCase("")) {
|
if ( extName != null && ! extName.equalsIgnoreCase("")) {
|
||||||
PropertyManager.setProperty(cmd[m] + "_EXT", extName);
|
getProject().setProperty(cmd[m] + "_EXT", extName);
|
||||||
} else {
|
} else {
|
||||||
PropertyManager.setProperty(cmd[m] + "_EXT", "");
|
getProject().setProperty(cmd[m] + "_EXT", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -473,7 +480,7 @@ public class GenBuildTask extends Ant {
|
|||||||
key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FAMILY;
|
key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FAMILY;
|
||||||
String toolChainFamily = GlobalData.getCommandSetting(key, fpdModuleId);
|
String toolChainFamily = GlobalData.getCommandSetting(key, fpdModuleId);
|
||||||
if (toolChainFamily != null) {
|
if (toolChainFamily != null) {
|
||||||
PropertyManager.setProperty(cmd[m] + "_FAMILY", toolChainFamily);
|
getProject().setProperty(cmd[m] + "_FAMILY", toolChainFamily);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -482,9 +489,9 @@ public class GenBuildTask extends Ant {
|
|||||||
key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_SPATH;
|
key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_SPATH;
|
||||||
String spath = GlobalData.getCommandSetting(key, fpdModuleId);
|
String spath = GlobalData.getCommandSetting(key, fpdModuleId);
|
||||||
if (spath != null) {
|
if (spath != null) {
|
||||||
PropertyManager.setProperty(cmd[m] + "_SPATH", spath.replaceAll("(\\\\)", "/"));
|
getProject().setProperty(cmd[m] + "_SPATH", spath.replaceAll("(\\\\)", "/"));
|
||||||
} else {
|
} else {
|
||||||
PropertyManager.setProperty(cmd[m] + "_SPATH", "");
|
getProject().setProperty(cmd[m] + "_SPATH", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -493,9 +500,9 @@ public class GenBuildTask extends Ant {
|
|||||||
key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_DPATH;
|
key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_DPATH;
|
||||||
String dpath = GlobalData.getCommandSetting(key, fpdModuleId);
|
String dpath = GlobalData.getCommandSetting(key, fpdModuleId);
|
||||||
if (dpath != null) {
|
if (dpath != null) {
|
||||||
PropertyManager.setProperty(cmd[m] + "_DPATH", dpath.replaceAll("(\\\\)", "/"));
|
getProject().setProperty(cmd[m] + "_DPATH", dpath.replaceAll("(\\\\)", "/"));
|
||||||
} else {
|
} else {
|
||||||
PropertyManager.setProperty(cmd[m] + "_DPATH", "");
|
getProject().setProperty(cmd[m] + "_DPATH", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -566,7 +573,7 @@ public class GenBuildTask extends Ant {
|
|||||||
for (int i = 0; i < libinstances.length; i++) {
|
for (int i = 0; i < libinstances.length; i++) {
|
||||||
propertyLibs += " " + getProject().getProperty("BIN_DIR") + File.separatorChar + libinstances[i].getName() + ".lib";
|
propertyLibs += " " + getProject().getProperty("BIN_DIR") + File.separatorChar + libinstances[i].getName() + ".lib";
|
||||||
}
|
}
|
||||||
PropertyManager.setProperty("LIBS", propertyLibs.replaceAll("(\\\\)", "/"));
|
getProject().setProperty("LIBS", propertyLibs.replaceAll("(\\\\)", "/"));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get all includepath and set to INCLUDE_PATHS
|
// Get all includepath and set to INCLUDE_PATHS
|
||||||
@ -768,7 +775,7 @@ public class GenBuildTask extends Ant {
|
|||||||
includePaths.append(iter.next());
|
includePaths.append(iter.next());
|
||||||
includePaths.append("; ");
|
includePaths.append("; ");
|
||||||
}
|
}
|
||||||
PropertyManager.setProperty("INCLUDE_PATHS", getProject().replaceProperties(includePaths.toString()).replaceAll("(\\\\)", "/"));
|
getProject().setProperty("INCLUDE_PATHS", getProject().replaceProperties(includePaths.toString()).replaceAll("(\\\\)", "/"));
|
||||||
|
|
||||||
return includes.toArray(new String[includes.size()]);
|
return includes.toArray(new String[includes.size()]);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,6 @@ import org.apache.tools.ant.BuildException;
|
|||||||
import org.apache.tools.ant.Project;
|
import org.apache.tools.ant.Project;
|
||||||
import org.tianocore.build.fpd.FpdParserTask;
|
import org.tianocore.build.fpd.FpdParserTask;
|
||||||
import org.tianocore.build.global.SurfaceAreaQuery;
|
import org.tianocore.build.global.SurfaceAreaQuery;
|
||||||
import org.tianocore.build.global.PropertyManager;
|
|
||||||
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.build.id.PackageIdentification;
|
import org.tianocore.build.id.PackageIdentification;
|
||||||
@ -46,7 +45,7 @@ public class ModuleBuildFileGenerator {
|
|||||||
/// Pass: TARGET, TOOLCHAIN, ARCH
|
/// Pass: TARGET, TOOLCHAIN, ARCH
|
||||||
/// PACKAGE, PACKAGE_GUID, PACKAGE_VERSION
|
/// PACKAGE, PACKAGE_GUID, PACKAGE_VERSION
|
||||||
///
|
///
|
||||||
String[] inheritProperties = {"ARCH", "MODULE_GUID", "MODULE_VERSION", "PLATFORM_FILE", "PACKAGE_GUID", "PACKAGE_VERSION"};
|
String[] inheritProperties = {"ARCH", "MODULE_GUID", "MODULE_VERSION", "PACKAGE_GUID", "PACKAGE_VERSION"};
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The information at the header of <em>build.xml</em>.
|
/// The information at the header of <em>build.xml</em>.
|
||||||
@ -418,7 +417,7 @@ public class ModuleBuildFileGenerator {
|
|||||||
for (int i = 0; i < sourceFiles.length; i++) {
|
for (int i = 0; i < sourceFiles.length; i++) {
|
||||||
str += " " + sourceFiles[i][1];
|
str += " " + sourceFiles[i][1];
|
||||||
}
|
}
|
||||||
PropertyManager.setProperty(project, "SOURCE_FILES", str.replaceAll("(\\\\)", "/"));
|
project.setProperty("SOURCE_FILES", str.replaceAll("(\\\\)", "/"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,6 +35,7 @@ import org.apache.xmlbeans.XmlObject;
|
|||||||
import org.tianocore.common.definitions.EdkDefinitions;
|
import org.tianocore.common.definitions.EdkDefinitions;
|
||||||
import org.tianocore.common.exception.EdkException;
|
import org.tianocore.common.exception.EdkException;
|
||||||
import org.tianocore.pcd.action.ActionMessage;
|
import org.tianocore.pcd.action.ActionMessage;
|
||||||
|
import org.tianocore.build.FrameworkBuildTask;
|
||||||
import org.tianocore.build.global.GlobalData;
|
import org.tianocore.build.global.GlobalData;
|
||||||
import org.tianocore.build.global.OutputManager;
|
import org.tianocore.build.global.OutputManager;
|
||||||
import org.tianocore.build.global.SurfaceAreaQuery;
|
import org.tianocore.build.global.SurfaceAreaQuery;
|
||||||
@ -339,6 +340,13 @@ public class FpdParserTask extends Task {
|
|||||||
getProject().setProperty("PLATFORM_FILE", platformId.getRelativeFpdFile().replaceAll("(\\\\)", "/"));
|
getProject().setProperty("PLATFORM_FILE", platformId.getRelativeFpdFile().replaceAll("(\\\\)", "/"));
|
||||||
getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));
|
getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));
|
||||||
getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));
|
getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));
|
||||||
|
|
||||||
|
if( !FrameworkBuildTask.multithread) {
|
||||||
|
FrameworkBuildTask.originalProperties.put("PLATFORM", platformId.getName());
|
||||||
|
FrameworkBuildTask.originalProperties.put("PLATFORM_FILE", platformId.getRelativeFpdFile().replaceAll("(\\\\)", "/"));
|
||||||
|
FrameworkBuildTask.originalProperties.put("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));
|
||||||
|
FrameworkBuildTask.originalProperties.put("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Build mode. User-defined output dir.
|
// Build mode. User-defined output dir.
|
||||||
|
@ -16,7 +16,6 @@ package org.tianocore.build.global;
|
|||||||
|
|
||||||
import org.apache.tools.ant.Project;
|
import org.apache.tools.ant.Project;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import org.tianocore.build.global.PropertyManager;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
OutputManager class is used to setup output directories (BIN_DIR, DEST_DIR_OUTPUT,
|
OutputManager class is used to setup output directories (BIN_DIR, DEST_DIR_OUTPUT,
|
||||||
@ -144,11 +143,11 @@ public class OutputManager {
|
|||||||
//
|
//
|
||||||
// Set properties
|
// Set properties
|
||||||
//
|
//
|
||||||
PropertyManager.setProperty(project, "BUILD_DIR", buildDir.replaceAll("(\\\\)", "/"));
|
project.setProperty("BUILD_DIR", buildDir.replaceAll("(\\\\)", "/"));
|
||||||
PropertyManager.setProperty(project, "FV_DIR", fvDir.replaceAll("(\\\\)", "/"));
|
project.setProperty("FV_DIR", fvDir.replaceAll("(\\\\)", "/"));
|
||||||
PropertyManager.setProperty(project, "BIN_DIR", binDir.replaceAll("(\\\\)", "/"));
|
project.setProperty("BIN_DIR", binDir.replaceAll("(\\\\)", "/"));
|
||||||
PropertyManager.setProperty(project, "DEST_DIR_DEBUG", (destDir + File.separatorChar + "DEBUG").replaceAll("(\\\\)", "/"));
|
project.setProperty("DEST_DIR_DEBUG", (destDir + File.separatorChar + "DEBUG").replaceAll("(\\\\)", "/"));
|
||||||
PropertyManager.setProperty(project, "DEST_DIR_OUTPUT", (destDir + File.separatorChar + "OUTPUT").replaceAll("(\\\\)", "/"));
|
project.setProperty("DEST_DIR_OUTPUT", (destDir + File.separatorChar + "OUTPUT").replaceAll("(\\\\)", "/"));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create all directory if necessary
|
// Create all directory if necessary
|
||||||
@ -187,7 +186,7 @@ public class OutputManager {
|
|||||||
//
|
//
|
||||||
// Set to property
|
// Set to property
|
||||||
//
|
//
|
||||||
PropertyManager.setProperty(project, "BUILD_DIR", buildDir.replaceAll("(\\\\)", "/"));
|
project.setProperty("BUILD_DIR", buildDir.replaceAll("(\\\\)", "/"));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create all directory if necessary
|
// Create all directory if necessary
|
||||||
|
Loading…
x
Reference in New Issue
Block a user