import org.apache.tools.ant.taskdefs.Ant;\r
import org.apache.xmlbeans.XmlObject;\r
\r
+import org.tianocore.build.global.GenBuildLogger;\r
import org.tianocore.build.global.GlobalData;\r
import org.tianocore.build.global.OutputManager;\r
import org.tianocore.build.id.FpdModuleIdentification;\r
\r
public static int currentRunNumber = 0;\r
\r
+ public static int totalNumber = 0;\r
+ \r
+ public static int remainNumber = 0;\r
+ \r
/**\r
Public construct method. It is necessary for ANT task.\r
**/\r
\r
**/\r
public void execute() throws BuildException {\r
+ \r
+ this.setTaskName(".........");\r
//\r
// Parse FPD file\r
//\r
// Prepare FV_DIR\r
//\r
String ffsCommonDir = buildDir + File.separatorChar\r
- + targetList[i] + File.separatorChar\r
+ + targetList[i] + "_"\r
+ toolchainList[j];\r
File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");\r
fvDir.mkdirs();\r
ant.init();\r
ant.execute();\r
\r
- EdkLog.log(this, "Task number is " + allThreads.size());\r
+ remainNumber = totalNumber = allThreads.size();\r
\r
+ EdkLog.log(this, EdkLog.EDK_ALWAYS, "Total thread number is " + totalNumber);\r
+ GenBuildLogger.setCacheEnable(true);\r
//\r
// Waiting for all thread over, or time out\r
//\r
if (currentQueueCode >= queueList.size()) {\r
break ;\r
}\r
+ \r
+ int percentage = (totalNumber - remainNumber) * 100 / totalNumber;\r
+ EdkLog.log(this, EdkLog.EDK_ALWAYS, percentage + "% finished. Has built " + (totalNumber - remainNumber) + " modules of " + totalNumber + " total. ");\r
\r
Set<FpdModuleIdentification> currentQueueModules = fvs.get(queueList.get(currentQueueCode));\r
\r
//\r
// Exist ready thread\r
//\r
- EdkLog.log(this, "## Exist ready thread");\r
+// EdkLog.log(this, EdkLog.EDK_ALWAYS, "Exist ready thread");\r
\r
} else if (existNoneReady && currentRunNumber == 0) {\r
//\r
// No active thread, but still have dependency not read thread\r
//\r
- throw new BuildException("Found can't resolve dependencies. ");\r
+ throw new BuildException("Existing some modules can't resolve depedencies. ");\r
} else if (!existNoneReady && currentRunNumber == 0) {\r
//\r
// Current queue build finish, move to next\r
//\r
- EdkLog.log(this, "## Current queue build finish, move to next");\r
+ EdkLog.log(this, EdkLog.EDK_ALWAYS, "Current queue build finish, move to next");\r
++currentQueueCode;\r
continue ;\r
} else {\r
//\r
// active thread exist, but no ready thread\r
//\r
- EdkLog.log(this, "## active thread exist, but no ready thread" + currentRunNumber);\r
+ EdkLog.log(this, EdkLog.EDK_ALWAYS, "Active thread exist, but no ready thread. Current running number is " + currentRunNumber);\r
}\r
\r
try {\r
deamonSemaphore.wait();\r
- } catch (InterruptedException e) {\r
- e.printStackTrace();\r
+ } catch (InterruptedException ex) {\r
+ BuildException e = new BuildException("Thread wait Error. \n" + ex.getMessage());\r
+ e.setStackTrace(ex.getStackTrace());\r
+ throw e;\r
}\r
}\r
}\r
- \r
+ GenBuildLogger.setCacheEnable(false);\r
//\r
// call fvs, postbuild\r
//\r
ant.init();\r
ant.execute();\r
\r
+ EdkLog.flushLogToFile(new File(buildDir + File.separatorChar + "build.log"));\r
+ \r
}\r
\r
\r
public synchronized static void subCount() {\r
synchronized (countSemaphore) {\r
--currentRunNumber;\r
+ --remainNumber;\r
}\r
}\r
}\r