X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Tools%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2Ffpd%2FPlatformBuildFileGenerator.java;h=d4b4622c6098b8279f4e7be393b109a4b56672db;hb=02c768ee72f71bf3fef9c88068081b6112f68614;hp=375122483f7e04f4f9f458c0f939c45d1222ba4e;hpb=4250be6c8493b01da97d4ef2594703a772c8b2a8;p=mirror_edk2.git diff --git a/Tools/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java b/Tools/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java index 375122483f..d4b4622c60 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java +++ b/Tools/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java @@ -47,8 +47,6 @@ import org.w3c.dom.NodeList; **/ public class PlatformBuildFileGenerator { - private String platformName; - /// /// Mapping from modules identification to out put file name /// @@ -64,6 +62,8 @@ public class PlatformBuildFileGenerator { private SurfaceAreaQuery saq = null; + private File platformBuildFile = null; + private Project project; private String info = "DO NOT EDIT \n" @@ -72,13 +72,13 @@ public class PlatformBuildFileGenerator { + "Abstract:\n" + "Auto-generated ANT build file for building EFI Modules and Platforms\n"; - public PlatformBuildFileGenerator(Project project, Map outfiles, Map> fvs, boolean isUnified, SurfaceAreaQuery saq){ + public PlatformBuildFileGenerator(Project project, Map outfiles, Map> fvs, boolean isUnified, SurfaceAreaQuery saq, String platformBuildFile){ this.project = project; this.outfiles = outfiles; this.isUnified = isUnified; this.fvs = fvs; this.saq = saq; - this.platformName = project.getProperty("PLATFORM"); + this.platformBuildFile = new File(platformBuildFile); } /** @@ -164,14 +164,10 @@ public class PlatformBuildFileGenerator { // Source source = new DOMSource(document); // - // Prepare the output file - // - File file = new File(project.getProperty("PLATFORM_DIR") + File.separatorChar + platformName + "_build.xml"); - // // generate all directory path // - (new File(file.getParent())).mkdirs(); - Result result = new StreamResult(file); + (new File(platformBuildFile.getParent())).mkdirs(); + Result result = new StreamResult(platformBuildFile); // // Write the DOM document to the file // @@ -180,7 +176,7 @@ public class PlatformBuildFileGenerator { xformer.setOutputProperty(OutputKeys.INDENT, "yes"); xformer.transform(source, result); } catch (Exception ex) { - throw new BuildException("Generation of the " + platformName + "_build.xml failed!\n" + ex.getMessage()); + throw new BuildException("Generating platform build file [" + platformBuildFile.getPath() + "_build.xml] failed. \n" + ex.getMessage()); } } @@ -613,7 +609,7 @@ public class PlatformBuildFileGenerator { root.appendChild(recursiveNode(childItem, document)); } else if (childItem.getNodeType() == Node.TEXT_NODE){ - if ( ! childItem.getNodeValue().trim().equalsIgnoreCase("")) { + if (!childItem.getNodeValue().trim().equalsIgnoreCase("")) { root.setTextContent(childItem.getNodeValue()); } }