X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FFrameworkTasks%2Forg%2Ftianocore%2Fframework%2Ftasks%2FGenCRC32SectionTask.java;h=d7184cd5d37691a0678dec8d23afe35c6a256c8f;hp=d72480a96e0bea68ccc33ede8133226f5fa778af;hb=82810f3b0f9ba49ed2d9f96c5b53e90dd7e66d88;hpb=fad77353ed83a0fdac957509dc2838423ae009fd diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCRC32SectionTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCRC32SectionTask.java index d72480a96e..d7184cd5d3 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCRC32SectionTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCRC32SectionTask.java @@ -30,7 +30,7 @@ import org.apache.tools.ant.types.Commandline; GenCRC32SectionTask is to call GenCRC32Section.exe to generate crc32 section. **/ -public class GenCRC32SectionTask extends Task implements EfiDefine{ +public class GenCRC32SectionTask extends Task implements EfiDefine { /// /// output file /// @@ -38,7 +38,7 @@ public class GenCRC32SectionTask extends Task implements EfiDefine{ /// /// inputFile list /// - private List inputFileList = new ArrayList(); + private List inputFileList = new ArrayList(); /// /// Project @@ -69,7 +69,11 @@ public class GenCRC32SectionTask extends Task implements EfiDefine{ // // string line of input files // - String inputFiles = list2Str(inputFileList, ""); + String inputFiles = " -i "; + for (int i = 0; i < inputFileList.size(); ++i) { + inputFiles += inputFileList.get(i).toString(" "); + } + // // assemble argument // @@ -89,29 +93,25 @@ 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)); + // LAH Added This Line + throw new BuildException("GenCRC32Section failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); - } - + } } /** @@ -137,47 +137,5 @@ public class GenCRC32SectionTask extends Task implements EfiDefine{ */ public void setOutputFile(String outputFile) { this.outputFile = " -o " + outputFile; - }; - - /** - * transfer List to String - * @param list : nested element list - * @param tag : interval tag of parameter - * @return string line of parameters - */ - private String list2Str(List list, String tag) { - /* - * string line for return - */ - String paraStr = " -i"; - /* - * nested element in list - */ - NestElement element; - /* - * iterator of nested element list - */ - Iterator elementIter = list.iterator(); - /* - * string parameter list - */ - List strList = new ArrayList(); - - while (elementIter.hasNext()) { - element = (NestElement) elementIter.next(); - if (null != element.getFile()) { - FileParser.loadFile(project, strList, element.getFile(), tag); - } else { - paraStr = paraStr + element.getName(); - } - } - /* - * iterator of string parameter list - */ - Iterator strIter = strList.iterator(); - while (strIter.hasNext()) { - paraStr = paraStr + " " + strIter.next(); - } - return paraStr; - } + } }