diff --git a/EdkNt32Pkg/Sec/SecMain_build.xml b/EdkNt32Pkg/Sec/SecMain_build.xml index 6c29d22100..6144f521c9 100644 --- a/EdkNt32Pkg/Sec/SecMain_build.xml +++ b/EdkNt32Pkg/Sec/SecMain_build.xml @@ -148,6 +148,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + "${DLINK}" /LIBPATH:"${env.MSVCDir}\Lib" /LIBPATH:"${env.MSVCDir}\PlatformSdk\Lib" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib ${OBJECTS} ${LIBS} /base:0x10000000 /out:${BIN_DIR}\SecMain.exe /pdb:${DEST_DIR_DEBUG}\SecMain.pdb diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/CreateMtFileTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/CreateMtFileTask.java index 07acafd257..2d97d7b620 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/CreateMtFileTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/CreateMtFileTask.java @@ -108,24 +108,21 @@ public class CreateMtFileTask extends Task implements EfiDefine { // // Set debug log information. // - EdkLog.log(EdkLog.EDK_INFO, Commandline.toString(cmdline.getCommandline())); - + EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_INFO, (new File(this.outputFile)).getName()); revl = runner.execute(); if (EFI_SUCCESS == revl) { // // command execution success // - EdkLog.log(EdkLog.EDK_INFO,"CreateMtFile succeeded!"); + EdkLog.log(EdkLog.EDK_VERBOSE, "CreateMtFile succeeded!"); } else { // // command execution fail // - EdkLog.log(EdkLog.EDK_ERROR, "CreateMtFile failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("CreateMtFile failed. (error=" - + Integer.toHexString(revl) + ")"); - + EdkLog.log(EdkLog.EDK_INFO, "ERROR = "+ Integer.toHexString(revl)); + throw new BuildException("CreateMtFile failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiCompressTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiCompressTask.java index 0ee1c10b94..55e7fa74cf 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiCompressTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiCompressTask.java @@ -104,7 +104,8 @@ public class EfiCompressTask extends Task implements EfiDefine { // // Set debug log information. // - EdkLog.log(EdkLog.EDK_INFO, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName()); revl = runner.execute(); @@ -112,15 +113,13 @@ public class EfiCompressTask extends Task implements EfiDefine { // // command execution success // - EdkLog.log(EdkLog.EDK_INFO,"EfiCompress succeeded!"); + EdkLog.log(EdkLog.EDK_VERBOSE, "EfiCompress succeeded!"); } else { // // command execution fail // - EdkLog.log(EdkLog.EDK_ERROR, "EfiCompress failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("Strip failed. (error=" - + Integer.toHexString(revl) + ")"); + EdkLog.log(EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl)); + throw new BuildException("Strip failed!"); } } catch (Exception e) { diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiRomTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiRomTask.java index 0018e2ba84..763b73f339 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiRomTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiRomTask.java @@ -161,8 +161,10 @@ public class EfiRomTask extends Task implements EfiDefine { argList.add(((Input)pe32ComprList.next()).getFile()); } } - EdkLog.log(EdkLog.EDK_INFO, argList.toString().replaceAll(",","")); - + + EdkLog.log(EdkLog.EDK_VERBOSE, argList.toString().replaceAll(",","")); + EdkLog.log(EdkLog.EDK_INFO, " "); + // // lauch the program // @@ -177,15 +179,15 @@ public class EfiRomTask extends Task implements EfiDefine { exitCode = cmdProc.waitFor(); if (exitCode != 0) { int len = cmdOut.read(buf, 0, 1024); - EdkLog.log(EdkLog.EDK_ERROR,new String(buf, 0, len)); + EdkLog.log(EdkLog.EDK_INFO, new String(buf, 0, len)); } else { - EdkLog.log(EdkLog.EDK_INFO, "FlashMap succeed!"); + EdkLog.log(EdkLog.EDK_VERBOSE, "EfiRom succeeded!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); } finally { if (exitCode != 0) { - //throw new BuildException("GenFvImage: failed to generate FV file!"); + throw new BuildException("EfiRom failed!"); } } } diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FlashMapTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FlashMapTask.java index dc3463890e..436fd64826 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FlashMapTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FlashMapTask.java @@ -29,9 +29,9 @@ import org.apache.tools.ant.BuildException; import org.tianocore.logger.EdkLog; /** - * SecFixupTask class. + * FlashMapTask class. * - * SecFixupTask is used to call SecFixup.exe to fix up sec image. + * FlashMapTask is used to call FlashMap.exe to generate flash map defition files and fd files. */ public class FlashMapTask extends Task implements EfiDefine { // / @@ -40,7 +40,7 @@ public class FlashMapTask extends Task implements EfiDefine { private final String toolName = "FlashMap"; // / - // / Flash default file + // / Flash definition file // / private String flashDefFile = ""; @@ -181,7 +181,6 @@ public class FlashMapTask extends Task implements EfiDefine { } } - EdkLog.log(EdkLog.EDK_INFO, argList.toString().replace(",","")); // // lauch the program // @@ -198,19 +197,19 @@ public class FlashMapTask extends Task implements EfiDefine { // // log command line string. // - EdkLog.log(EdkLog.EDK_INFO, cmdProc.getOutputStream().toString()); + EdkLog.log(EdkLog.EDK_VERBOSE, cmdProc.getOutputStream().toString()); + EdkLog.log(EdkLog.EDK_INFO, (new File(this.flashDefFile)).getName()); if (exitCode != 0) { int len = cmdOut.read(buf, 0, 1024); - EdkLog.log(EdkLog.EDK_ERROR, new String(buf, 0, len)); + EdkLog.log(EdkLog.EDK_INFO, new String(buf, 0, len)); } else { - EdkLog.log(EdkLog.EDK_INFO, "FlashMap succeed!"); + EdkLog.log(EdkLog.EDK_VERBOSE, "FlashMap succeeded!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); } finally { if (exitCode != 0) { - // throw new BuildException("GenFvImage: failed to generate FV - // file!"); + throw new BuildException("FlashMap failed!"); } } } diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FrameworkLogger.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FrameworkLogger.java index 28e7d8325c..26d38bb6d2 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FrameworkLogger.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FrameworkLogger.java @@ -25,13 +25,10 @@ class FrameworkLogger implements LogMethod { private String titleName; public FrameworkLogger(Project project, String taskName) { this.project = project; - this.titleName = taskName; - - + this.titleName = taskName; } - public void putMessage(Object msgSource, int msgLevel, String msg) { - + public void putMessage(Object msgSource, int msgLevel, String msg) { String frameworkMsg = " [" + this.titleName + "] " + msg; this.project.log(frameworkMsg, Project.MSG_INFO); } diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FwImageTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FwImageTask.java index 7188d1dba2..1021f1afe6 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FwImageTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FwImageTask.java @@ -16,12 +16,15 @@ **/ package org.tianocore.framework.tasks; -import org.apache.tools.ant.Task; -import org.apache.tools.ant.Project; +import java.io.File; + import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.Task; import org.apache.tools.ant.taskdefs.Execute; import org.apache.tools.ant.taskdefs.LogStreamHandler; import org.apache.tools.ant.types.Commandline; +import org.tianocore.logger.EdkLog; /** @@ -38,6 +41,7 @@ public class FwImageTask extends Task implements EfiDefine{ /// input PE image /// private String peImage = ""; + private String peImageName = ""; /// /// output EFI image /// @@ -93,24 +97,18 @@ public class FwImageTask extends Task implements EfiDefine{ runner.setAntRun(project); runner.setCommandline(cmdline.getCommandline()); - //System.out.println(Commandline.toString(cmdline.getCommandline())); - //GenBuildTask.myLogger.log(Commandline.toString(cmdline.getCommandline()),0); - //getProject().log(Commandline.toString(cmdline.getCommandline())); + + log(Commandline.toString(cmdline.getCommandline()), Project.MSG_VERBOSE); + log(this.peImageName); revl = runner.execute(); if (EFI_SUCCESS == revl) { - // - // command execution success - // - System.out.println("fwimage succeeded!"); + log("fwimage succeeded!", Project.MSG_VERBOSE); } else { // // command execution fail // - System.out.println("fwimage failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("fwimage failed. (error=" - + Integer.toHexString(revl) + ")"); - + log("ERROR = " + Integer.toHexString(revl)); + throw new BuildException("fwimage failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); @@ -155,6 +153,7 @@ public class FwImageTask extends Task implements EfiDefine{ @param peImage name of PE image **/ public void setPeImage(String peImage) { + this.peImageName = (new File(peImage)).getName(); this.peImage = " " + peImage; } diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenAcpiTableTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenAcpiTableTask.java index 156d7e309a..0b17b10dfb 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenAcpiTableTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenAcpiTableTask.java @@ -104,24 +104,21 @@ public class GenAcpiTableTask extends Task implements EfiDefine { // // Set debug log information. // - EdkLog.log(EdkLog.EDK_INFO, Commandline.toString(cmdline.getCommandline())); - + EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName()); revl = runner.execute(); if (EFI_SUCCESS == revl) { // // command execution success // - EdkLog.log(EdkLog.EDK_INFO,"GenAcpiTable successed!"); + EdkLog.log(EdkLog.EDK_VERBOSE, "GenAcpiTable succeeded!"); } else { // // command execution fail // - EdkLog.log(EdkLog.EDK_ERROR, "GenAcpiTable failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("GenAcpiTable failed. (error=" - + Integer.toHexString(revl) + ")"); - + EdkLog.log(EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl)); + throw new BuildException("GenAcpiTable failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCRC32SectionTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCRC32SectionTask.java index d72480a96e..cf02466ab0 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCRC32SectionTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCRC32SectionTask.java @@ -89,29 +89,23 @@ public class GenCRC32SectionTask extends Task implements EfiDefine{ runner.setAntRun(project); runner.setCommandline(cmdline.getCommandline()); - System.out.println(Commandline.toString(cmdline.getCommandline())); - + log(Commandline.toString(cmdline.getCommandline()), Project.MSG_VERBOSE); + log(" "); revl = runner.execute(); if (EFI_SUCCESS == revl){ // // command execution success // - System.out.println("gencrc32section succeeded!"); - } - else - { + log("gencrc32section succeeded!", Project.MSG_VERBOSE); + } else { // // command execution fail // - System.out.println("gencrc32section failed. (error=" + - Integer.toHexString(revl) + - ")" - ); + log("ERROR = " + Integer.toHexString(revl)); } } catch (Exception e) { throw new BuildException(e.getMessage()); - } - + } } /** diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCapsuleHdrTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCapsuleHdrTask.java index 9071e8e772..c532113d45 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCapsuleHdrTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCapsuleHdrTask.java @@ -137,25 +137,21 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine { // // Set debug log information. // - EdkLog.log(EdkLog.EDK_INFO, Commandline.toString(cmdline - .getCommandline())); - + EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_INFO, (new File(scriptFile)).getName()); revl = runner.execute(); if (EFI_SUCCESS == revl) { // // command execution success // - EdkLog.log(EdkLog.EDK_INFO, "GenCapsuleHdr succeeded!"); + EdkLog.log(EdkLog.EDK_VERBOSE, "GenCapsuleHdr succeeded!"); } else { // // command execution fail // - EdkLog.log(EdkLog.EDK_ERROR, "GenCapsuleHdr failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("GenCapsuleHdr failed. (error=" - + Integer.toHexString(revl) + ")"); - + EdkLog.log(EdkLog.EDK_ERROR, "ERROR = " + Integer.toHexString(revl)); + throw new BuildException("GenCapsuleHdr failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenDepexTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenDepexTask.java index 983e4d603c..5a5e115a97 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenDepexTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenDepexTask.java @@ -14,6 +14,8 @@ **/ package org.tianocore.framework.tasks; +import java.io.File; + import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; @@ -35,6 +37,7 @@ public class GenDepexTask extends Task implements EfiDefine { /// input pre-processed dependency text files name /// private String inputFile = ""; + private String inputFileName = ""; /// /// padding integer value /// @@ -79,24 +82,17 @@ public class GenDepexTask extends Task implements EfiDefine { runner.setAntRun(project); runner.setCommandline(commandLine.getCommandline()); - System.out.println(Commandline.toString(commandLine - .getCommandline())); - + log(Commandline.toString(commandLine.getCommandline()), Project.MSG_VERBOSE); + log(inputFileName); returnVal = runner.execute(); if (EFI_SUCCESS == returnVal) { - // - // command execution success - // - System.out.println("GenDepex execute succeeded!"); - + log("GenDepex succeeded!", Project.MSG_VERBOSE); } else { // // command execution fail // - System.out.println("GenDepex failed. (error=" - + Integer.toHexString(returnVal) + ")"); - throw new BuildException("GenDepex failed. (error=" - + Integer.toHexString(returnVal) + ")"); + log("ERROR = " + Integer.toHexString(returnVal)); + throw new BuildException("GenDepex failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); @@ -131,6 +127,7 @@ public class GenDepexTask extends Task implements EfiDefine { @param inputFileName name of inputFile **/ public void setInputFile(String inputFileName) { + this.inputFileName = (new File(inputFileName)).getName(); this.inputFile = " -I " + inputFileName; } diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFfsFileTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFfsFileTask.java index ceff3205fe..3c7ebed362 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFfsFileTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFfsFileTask.java @@ -169,17 +169,16 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes { } - ffsFile = new File (outputPath + this.ffsFileGuid + '-' + this.baseName + ffsSuffix); - System.out.print("General Ffs file: file name is:\n"); - System.out.print(outputPath + this.ffsFileGuid + '-' + this.baseName + ffsSuffix); - System.out.print("\n"); - + String ffsFilePath = outputPath + this.ffsFileGuid + '-' + this.baseName + ffsSuffix; + ffsFile = new File (ffsFilePath); // // Create ffs ORG file. fileName = FfsFileGuid + BaseName + ffsSuffix + // ".org". // - ffsOrgFile = new File(outputPath + this.ffsFileGuid + '-' + this.baseName + ffsSuffix + ".org"); + ffsOrgFile = new File(ffsFilePath + ".org"); + log(ffsFile.getName()); + log(ffsOrgFile.getName()); try { // // Create file output stream -- dataBuffer. @@ -428,8 +427,8 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes { // ffsBuffer.close(); orgFfsBuffer.close(); - System.out.print ("Successful create ffs file!\n"); } catch (Exception e) { + log("genffsfile failed!"); throw new BuildException (e.getMessage()); } } diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFvImageTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFvImageTask.java index dbcf346c17..90a613f3aa 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFvImageTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFvImageTask.java @@ -78,6 +78,7 @@ public class GenFvImageTask extends Task implements EfiDefine{ ProcessBuilder pb = new ProcessBuilder(argList); pb.directory(new File(outputDir)); int exitCode = 0; + log((new File(this.infFile)).getName()); try { Process cmdProc = pb.start(); InputStreamReader cmdOut = new InputStreamReader(cmdProc.getInputStream()); @@ -86,9 +87,9 @@ public class GenFvImageTask extends Task implements EfiDefine{ exitCode = cmdProc.waitFor(); if (exitCode != 0) { int len = cmdOut.read(buf, 0, 1024); - log(new String(buf, 0, len), Project.MSG_ERR); + log(new String(buf, 0, len)); } else { - log("GenFvImage - DONE!", Project.MSG_VERBOSE); + log("GenFvImage succeeded!", Project.MSG_VERBOSE); } } catch (Exception e) { throw new BuildException(e.getMessage()); diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenSectionTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenSectionTask.java index 75b6511ce2..25328a12d8 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenSectionTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenSectionTask.java @@ -16,9 +16,11 @@ package org.tianocore.framework.tasks; +import java.io.File; + +import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; -import org.apache.tools.ant.BuildException; import org.apache.tools.ant.taskdefs.Execute; import org.apache.tools.ant.taskdefs.LogStreamHandler; import org.apache.tools.ant.types.Commandline; @@ -29,6 +31,10 @@ public class GenSectionTask extends Task implements EfiDefine { /// private String inputFile = ""; /// + /// + /// + private String inputFileName = ""; + /// /// outputfile name /// private String outputFile = ""; @@ -86,22 +92,18 @@ public class GenSectionTask extends Task implements EfiDefine { runner.setAntRun(project); runner.setCommandline(cmdline.getCommandline()); - System.out.println(Commandline.toString(cmdline.getCommandline())); + log(inputFileName); + log(Commandline.toString(cmdline.getCommandline()), Project.MSG_VERBOSE); revl = runner.execute(); if (EFI_SUCCESS == revl) { - // - // command execution success - // - System.out.println("gensection succeeded!"); + log("gensection succeeded!", Project.MSG_VERBOSE); } else { // // command execution fail // - System.out.println("gensection failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("gensection failed. (error=" - + Integer.toHexString(revl) + ")"); + log("ERROR = " + Integer.toHexString(revl)); + throw new BuildException("gensection failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); @@ -127,6 +129,7 @@ public class GenSectionTask extends Task implements EfiDefine { @param inputFile name of input file **/ public void setInputFile(String inputFile) { + this.inputFileName = (new File(inputFile)).getName(); this.inputFile = " -i " + inputFile; } diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenTeImageTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenTeImageTask.java index 347ae91e25..9717c6806c 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenTeImageTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenTeImageTask.java @@ -125,8 +125,8 @@ public class GenTeImageTask extends Task implements EfiDefine { // // Set debug log information. // - EdkLog.log(EdkLog.EDK_INFO, Commandline.toString(cmdline - .getCommandline())); + EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName()); revl = runner.execute(); @@ -134,16 +134,13 @@ public class GenTeImageTask extends Task implements EfiDefine { // // command execution success // - EdkLog.log(EdkLog.EDK_INFO, "GenTeImage succeeded!"); + EdkLog.log(EdkLog.EDK_VERBOSE, "GenTeImage succeeded!"); } else { // // command execution fail // - EdkLog.log(EdkLog.EDK_ERROR, "GenTeImage failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("GenTeImage failed. (error=" - + Integer.toHexString(revl) + ")"); - + EdkLog.log(EdkLog.EDK_INFO, "ERROR = "+ Integer.toHexString(revl)); + throw new BuildException("GenTeImage failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GuidChkTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GuidChkTask.java index ebccca4673..8b6943229f 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GuidChkTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GuidChkTask.java @@ -113,7 +113,7 @@ public class GuidChkTask extends Task implements EfiDefine{ printGuiDef + printAllGuid; try { - System.out.println(command + " " + argument); + log(command + " " + argument, Project.MSG_VERBOSE); // // execute command line // @@ -134,17 +134,13 @@ public class GuidChkTask extends Task implements EfiDefine{ else { BufferedReader bin = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line = bin.readLine(); - System.out.println(line); while (line != null ){ - System.out.print(line); line = bin.readLine(); } } - System.out.println("GuidChkTask Success!"); + log("GuidChkTask Succeeded!", Project.MSG_VERBOSE); } catch (Exception e) { - System.out.println("GuidChkTask failed!"); - System.out.println(e.getMessage()); - + throw new BuildException("GuidChkTask failed!"); } } /** diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/MakeDeps.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/MakeDeps.java index c72b1f6672..e927f8c9c9 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/MakeDeps.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/MakeDeps.java @@ -35,6 +35,7 @@ import org.apache.tools.ant.taskdefs.Execute; import org.apache.tools.ant.taskdefs.LogStreamHandler; import org.apache.tools.ant.types.Commandline; import org.apache.tools.ant.types.Path; +import org.tianocore.logger.EdkLog; /** Class MakeDeps is used to wrap MakeDeps.exe as an ANT task. @@ -77,6 +78,10 @@ public class MakeDeps extends Task { Project prj = this.getOwningTarget().getProject(); String toolPath = prj.getProperty("env.FRAMEWORK_TOOLS_PATH"); + FrameworkLogger logger = new FrameworkLogger(prj, "makedeps"); + EdkLog.setLogLevel(prj.getProperty("env.LOGLEVEL")); + EdkLog.setLogger(logger); + /// /// compose full tool path /// @@ -118,8 +123,9 @@ public class MakeDeps extends Task { Iterator iterator = inputFileList.iterator(); while (iterator.hasNext()) { Input inputFile = (Input)iterator.next(); + String inputFileString = cleanupPathName(inputFile.getFile()); args.append(" -f "); - args.append(cleanupPathName(inputFile.getFile())); + args.append(inputFileString); } /// @@ -165,6 +171,9 @@ public class MakeDeps extends Task { runner.setAntRun(prj); runner.setCommandline(cmd.getCommandline()); + EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmd.getCommandline())); + EdkLog.log(EdkLog.EDK_INFO, " "); + int result = 0; try { result = runner.execute(); @@ -173,7 +182,7 @@ public class MakeDeps extends Task { } if (result != 0) { - log ("MakeDeps failed"); + EdkLog.log(EdkLog.EDK_INFO, "MakeDeps failed!"); return; } diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/ModifyInfTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/ModifyInfTask.java index a492cfdd9f..82f161a97e 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/ModifyInfTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/ModifyInfTask.java @@ -119,25 +119,21 @@ public class ModifyInfTask extends Task implements EfiDefine { // // Set debug log information. // - EdkLog.log(EdkLog.EDK_INFO, Commandline.toString(cmdline - .getCommandline())); - + EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFVInfFileName)).getName()); revl = runner.execute(); if (EFI_SUCCESS == revl) { // // command execution success // - EdkLog.log(EdkLog.EDK_INFO, "ModifyInfTask succeeded!"); + EdkLog.log(EdkLog.EDK_VERBOSE, "ModifyInfTask succeeded!"); } else { // // command execution fail // - EdkLog.log(EdkLog.EDK_ERROR, "ModifyInfTask failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("ModifyInfTask failed. (error=" - + Integer.toHexString(revl) + ")"); - + EdkLog.log(EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl)); + throw new BuildException("ModifyInfTask failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/PeiReBaseTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/PeiReBaseTask.java index c033c0d199..ec74651cd0 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/PeiReBaseTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/PeiReBaseTask.java @@ -40,7 +40,7 @@ public class PeiReBaseTask extends Task implements EfiDefine { // / Input file // / private String inputFile = ""; - + private String inputFileName = ""; // / // / Output file // / @@ -128,7 +128,8 @@ public class PeiReBaseTask extends Task implements EfiDefine { // // Set debug log information. // - EdkLog.log(EdkLog.EDK_INFO, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_INFO, this.inputFileName); revl = runner.execute(); @@ -136,16 +137,13 @@ public class PeiReBaseTask extends Task implements EfiDefine { // // command execution success // - EdkLog.log(EdkLog.EDK_INFO,"PeiBase succeeded!"); + EdkLog.log(EdkLog.EDK_VERBOSE, "PeiReBase succeeded!"); } else { // // command execution fail // - EdkLog.log(EdkLog.EDK_ERROR, "PeiBase failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("PeiBase failed. (error=" - + Integer.toHexString(revl) + ")"); - + EdkLog.log(EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl)); + throw new BuildException("PeiReBase failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); @@ -172,6 +170,7 @@ public class PeiReBaseTask extends Task implements EfiDefine { * string of input file name. */ public void setInputFile(String inputFile) { + this.inputFileName = (new File(inputFile)).getName(); this.inputFile = "-I " + inputFile; } diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SecApResetVectorFixupTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SecApResetVectorFixupTask.java index 79a7b54bea..e1b9bd1b63 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SecApResetVectorFixupTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SecApResetVectorFixupTask.java @@ -111,7 +111,8 @@ public class SecApResetVectorFixupTask extends Task implements EfiDefine { // // Set debug log information. // - EdkLog.log(EdkLog.EDK_INFO, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_INFO, (new File(this.fvInputFile)).getName()); revl = runner.execute(); @@ -119,16 +120,13 @@ public class SecApResetVectorFixupTask extends Task implements EfiDefine { // // command execution success // - EdkLog.log(EdkLog.EDK_INFO,"SecApResetVectorFixup succeeded!"); + EdkLog.log(EdkLog.EDK_VERBOSE, "SecApResetVectorFixup succeeded!"); } else { // // command execution fail // - EdkLog.log(EdkLog.EDK_ERROR, "SecApResetVectorFixup failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("SecApResetVectorFixup failed. (error=" - + Integer.toHexString(revl) + ")"); - + EdkLog.log(EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl)); + throw new BuildException("SecApResetVectorFixup failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SecFixupTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SecFixupTask.java index 64c9295da4..38c6d1e0a1 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SecFixupTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SecFixupTask.java @@ -116,8 +116,7 @@ public class SecFixupTask extends Task implements EfiDefine { // // Set debug log information. // - EdkLog.log(EdkLog.EDK_INFO, Commandline.toString(cmdline - .getCommandline())); + EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline())); revl = runner.execute(); @@ -125,16 +124,13 @@ public class SecFixupTask extends Task implements EfiDefine { // // command execution success // - EdkLog.log(EdkLog.EDK_INFO, "SecFixup succeeded!"); + EdkLog.log(EdkLog.EDK_VERBOSE, "SecFixup succeeded!"); } else { // // command execution fail // - EdkLog.log(EdkLog.EDK_ERROR, "SecFixup failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("SecFixup failed. (error=" - + Integer.toHexString(revl) + ")"); - + EdkLog.log(EdkLog.EDK_INFO, "ERROR = "+ Integer.toHexString(revl)); + throw new BuildException("SecFixup failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SetStampTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SetStampTask.java index a59598a529..a06d312d06 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SetStampTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SetStampTask.java @@ -13,6 +13,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ package org.tianocore.framework.tasks; +import java.io.File; + import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; @@ -74,23 +76,18 @@ public class SetStampTask extends Task implements EfiDefine { runner.setAntRun(project); runner.setCommandline(commandLine.getCommandline()); - System.out.println(Commandline.toString(commandLine - .getCommandline())); + log(Commandline.toString(commandLine.getCommandline()), Project.MSG_VERBOSE); + log((new File(this.peFile)).getName()); returnVal = runner.execute(); if (EFI_SUCCESS == returnVal) { - /// - /// command execution success - /// - System.out.println("SetStamp execute succeeded!"); + log("SetStamp succeeded!", Project.MSG_VERBOSE); } else { /// /// command execution fail /// - System.out.println("SetStamp failed. (error=" - + Integer.toHexString(returnVal) + ")"); - throw new BuildException("SetStamp failed. (error=" - + Integer.toHexString(returnVal) + ")"); + log("ERROR = " + Integer.toHexString(returnVal)); + throw new BuildException("SetStamp failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SplitfileTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SplitfileTask.java index b3f813cb09..b2fad5cbb6 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SplitfileTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SplitfileTask.java @@ -98,22 +98,20 @@ public class SplitfileTask extends Task implements EfiDefine { runner.setAntRun(project); runner.setCommandline(cmdline.getCommandline()); - EdkLog.log(EdkLog.EDK_INFO, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName()); revl = runner.execute(); if (EFI_SUCCESS == revl) { // // command execution success // - EdkLog.log(EdkLog.EDK_INFO, "splitfile succeeded!"); + EdkLog.log(EdkLog.EDK_VERBOSE, "splitfile succeeded!"); } else { // // command execution fail // - EdkLog.log(EdkLog.EDK_ERROR, "splitfile failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("splitfile failed. (error=" - + Integer.toHexString(revl) + ")"); - + EdkLog.log(EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl)); + throw new BuildException("splitfile failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/StrGatherTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/StrGatherTask.java index 4aa12eb763..ed8ef2dc8c 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/StrGatherTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/StrGatherTask.java @@ -148,22 +148,18 @@ public class StrGatherTask extends Task implements EfiDefine { runner.setAntRun(project); runner.setCommandline(cmdline.getCommandline()); - System.out.println(Commandline.toString(cmdline.getCommandline())); + log(Commandline.toString(cmdline.getCommandline()), Project.MSG_VERBOSE); + log(this.commandType.substring(2)); revl = runner.execute(); if (EFI_SUCCESS == revl) { - /// - /// command execution success - /// - System.out.println("strgather succeeded!"); + log("strgather succeeded!", Project.MSG_VERBOSE); } else { /// /// command execution fail /// - System.out.println("strgather failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("strgather failed. (error=" - + Integer.toHexString(revl) + ")"); + log("ERROR = " + Integer.toHexString(revl)); + throw new BuildException("strgather failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/StripTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/StripTask.java index 1f5f9ad68d..0f775a5c20 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/StripTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/StripTask.java @@ -105,7 +105,8 @@ public class StripTask extends Task implements EfiDefine { // // Set debug log information. // - EdkLog.log(EdkLog.EDK_INFO, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName()); revl = runner.execute(); @@ -113,16 +114,13 @@ public class StripTask extends Task implements EfiDefine { // // command execution success // - EdkLog.log(EdkLog.EDK_INFO,"Strip succeeded!"); + EdkLog.log(EdkLog.EDK_VERBOSE, "Strip succeeded!"); } else { // // command execution fail // - EdkLog.log(EdkLog.EDK_ERROR, "Strip failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("Strip failed. (error=" - + Integer.toHexString(revl) + ")"); - + EdkLog.log(EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl)); + throw new BuildException("Strip failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/VfrCompilerTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/VfrCompilerTask.java index cf2fe1e476..8d3a22dd17 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/VfrCompilerTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/VfrCompilerTask.java @@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ package org.tianocore.framework.tasks; +import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -39,7 +40,8 @@ public class VfrCompilerTask extends Task implements EfiDefine { private String outPutDir = ""; private String createIfrBinFile = ""; private String processerArg =""; - private String vfrFile; + private String vfrFile = ""; + private String vfrFileName = ""; private List includepathList = new ArrayList(); @@ -116,6 +118,7 @@ public class VfrCompilerTask extends Task implements EfiDefine { @param vfrFile The name of VFR file **/ public void setVfrFile(String vfrFile) { + this.vfrFileName = (new File(vfrFile)).getName(); this.vfrFile = " " + vfrFile; } @@ -203,17 +206,15 @@ public class VfrCompilerTask extends Task implements EfiDefine { runner.setAntRun(project); runner.setCommandline(commandLine.getCommandline()); - System.out.println(Commandline.toString(commandLine.getCommandline())); + log(Commandline.toString(commandLine.getCommandline()), Project.MSG_VERBOSE); + log(vfrFileName); int returnVal = runner.execute(); if (EFI_SUCCESS == returnVal) { - System.out.println("VfrCompiler execution succeeded!"); + log("VfrCompiler succeeded!", Project.MSG_VERBOSE); } else { - System.out.println("VfrCompiler failed. (error=" + - Integer.toHexString(returnVal) + ")"); - throw new BuildException("VfrCompiler failed. (error=" + - Integer.toHexString(returnVal) + ")"); + log("ERROR = " + Integer.toHexString(returnVal)); + throw new BuildException("VfrCompiler failed!"); } - } catch (IOException e) { throw new BuildException(e.getMessage()); } diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/ZeroDebugDataTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/ZeroDebugDataTask.java index 5ef058a35a..eb9707afe1 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/ZeroDebugDataTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/ZeroDebugDataTask.java @@ -105,23 +105,22 @@ public class ZeroDebugDataTask extends Task implements EfiDefine { // // Set debug log information. // - EdkLog.log(EdkLog.EDK_INFO, Commandline.toString(cmdline.getCommandline())); - + EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline())); + EdkLog.log(EdkLog.EDK_INFO, (new File(this.peFile)).getName()); + revl = runner.execute(); if (EFI_SUCCESS == revl) { // // command execution success // - EdkLog.log(EdkLog.EDK_INFO,"ZeroDebug succeeded!"); + EdkLog.log(EdkLog.EDK_VERBOSE, "ZeroDebugData succeeded!"); } else { // // command execution fail // - EdkLog.log(EdkLog.EDK_ERROR, "ZeroDebug failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("ZeroDebug failed. (error=" - + Integer.toHexString(revl) + ")"); + EdkLog.log(EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl)); + throw new BuildException("ZeroDebugData failed!"); } } catch (Exception e) { diff --git a/Tools/Source/TianoTools/GenDepex/GenDepex.c b/Tools/Source/TianoTools/GenDepex/GenDepex.c index 34857fccf1..67ffcd2443 100644 --- a/Tools/Source/TianoTools/GenDepex/GenDepex.c +++ b/Tools/Source/TianoTools/GenDepex/GenDepex.c @@ -854,16 +854,6 @@ Returns: Output_Flag = FALSE; Pad_Flag = FALSE; - // - // Output the calling arguments - // - printf ("\n\n"); - for (Index = 0; Index < argc; Index++) { - printf ("%s ", argv[Index]); - } - - printf ("\n\n"); - if (argc < 5) { printf ("Not enough arguments\n"); PrintGenDepexUsageInfo ();