X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FJava%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2FFrameworkBuildTask.java;h=e240150c29c471bc42f1ce79686e42842d80f8d2;hp=fce5108024840d7f3671f491ed8e0cbe565c6947;hb=7432a2144462a36cd8a613a5620963152f03a3f9;hpb=0f769af196276c51fa05b6331796b77aef225c01 diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java b/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java index fce5108024..e240150c29 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java @@ -77,9 +77,9 @@ public class FrameworkBuildTask extends Task{ private Set msaFiles = new LinkedHashSet(); - // - // This is only for none-multi-thread build to reduce overriding message - // + /// + /// This is only for none-multi-thread build to reduce overriding message + /// public static Hashtable originalProperties = new Hashtable(); String toolsDefFilename = ToolDefinitions.DEFAULT_TOOLS_DEF_FILE_PATH; @@ -110,11 +110,17 @@ public class FrameworkBuildTask extends Task{ // set Logger // GenBuildLogger logger = new GenBuildLogger(getProject()); + EdkLog.setLogLevel(EdkLog.EDK_DEBUG); EdkLog.setLogLevel(getProject().getProperty("env.LOGLEVEL")); EdkLog.setLogger(logger); try { processFrameworkBuild(); + }catch (BuildException e) { + // + // Add more logic process here + // + throw new BuildException(e.getMessage()); } catch (PcdAutogenException e) { // // Add more logic process here @@ -191,7 +197,7 @@ public class FrameworkBuildTask extends Task{ // File workspacePath = new File(getProject().getProperty("WORKSPACE")); getProject().setProperty("WORKSPACE_DIR", workspacePath.getPath().replaceAll("(\\\\)", "/")); - GlobalData.initInfo(dbFilename, workspacePath.getPath(), toolsDefFilename); + GlobalData.initInfo(getProject(), dbFilename, workspacePath.getPath(), toolsDefFilename); // // If find MSA file and ACTIVE_PLATFORM is set, build the module; @@ -201,11 +207,10 @@ public class FrameworkBuildTask extends Task{ // If find more than one FPD files, report error. // File buildFile = null; - if (msaFiles.size() > 1) { - throw new BuildException("Found " + msaFiles.size() + " MSA files in current dir. "); - } else if (msaFiles.size() == 1 && activePlatform == null) { - throw new BuildException("If trying to build a single module, please set ACTIVE_PLATFORM in file [" + targetFilename + "]. "); - } else if (msaFiles.size() == 1 && activePlatform != null) { + if (msaFiles.size() > 0) { + if (activePlatform == null) { + throw new BuildException("If trying to build a single module, please set ACTIVE_PLATFORM in file [" + targetFilename + "]. "); + } // // Build the single module // @@ -272,17 +277,21 @@ public class FrameworkBuildTask extends Task{ } File tmpFile = new File(GlobalData.getWorkspacePath() + File.separatorChar + activePlatform); EdkLog.log(this, "Using the FPD file [" + tmpFile.getPath() + "] for the active platform. "); - EdkLog.log(this, "Processing the MSA file [" + buildFile.getPath() + "] ..>> "); - GenBuildTask genBuildTask = new GenBuildTask(); - genBuildTask.setSingleModuleBuild(true); - genBuildTask.setType(type); - getProject().setProperty("PLATFORM_FILE", activePlatform); - if( !multithread) { - originalProperties.put("PLATFORM_FILE", activePlatform); + + File[] moduleFiles = msaFiles.toArray(new File[msaFiles.size()]); + for (int i = 0; i < moduleFiles.length; ++i) { + EdkLog.log(this, "Processing the MSA file [" + moduleFiles[i].getPath() + "] ..>> "); + GenBuildTask genBuildTask = new GenBuildTask(); + genBuildTask.setSingleModuleBuild(true); + genBuildTask.setType(type); + getProject().setProperty("PLATFORM_FILE", activePlatform); + if( !multithread) { + originalProperties.put("PLATFORM_FILE", activePlatform); + } + genBuildTask.setProject(getProject()); + genBuildTask.setMsaFile(moduleFiles[i]); + genBuildTask.perform(); } - genBuildTask.setProject(getProject()); - genBuildTask.setMsaFile(buildFile); - genBuildTask.perform(); } } @@ -324,7 +333,7 @@ public class FrameworkBuildTask extends Task{ private void readTargetFile() throws EdkException{ String targetFile = getProject().getProperty("WORKSPACE_DIR") + File.separatorChar + targetFilename; - String[][] targetFileInfo = ConfigReader.parse(targetFile); + String[][] targetFileInfo = ConfigReader.parse(getProject(), targetFile); // // Get ToolChain Info from target.txt @@ -369,7 +378,10 @@ public class FrameworkBuildTask extends Task{ } str = getValue(ToolDefinitions.TARGET_KEY_MAX_CONCURRENT_THREAD_NUMBER, targetFileInfo); - if (str != null ) { + // + // Need to check the # of threads iff multithread is enabled. + // + if ((multithread) && (str != null )) { try { int threadNum = Integer.parseInt(str); if (threadNum > 0) {