**/\r
public class PlatformBuildFileGenerator {\r
\r
- private String platformName;\r
- \r
///\r
/// Mapping from modules identification to out put file name\r
///\r
\r
private SurfaceAreaQuery saq = null;\r
\r
+ private File platformBuildFile = null;\r
+ \r
private Project project;\r
\r
private String info = "DO NOT EDIT \n" \r
+ "Abstract:\n"\r
+ "Auto-generated ANT build file for building EFI Modules and Platforms\n";\r
\r
- public PlatformBuildFileGenerator(Project project, Map<FpdModuleIdentification, String> outfiles, Map<String, Set<FpdModuleIdentification>> fvs, boolean isUnified, SurfaceAreaQuery saq){\r
+ public PlatformBuildFileGenerator(Project project, Map<FpdModuleIdentification, String> outfiles, Map<String, Set<FpdModuleIdentification>> fvs, boolean isUnified, SurfaceAreaQuery saq, String platformBuildFile){\r
this.project = project;\r
this.outfiles = outfiles;\r
this.isUnified = isUnified;\r
this.fvs = fvs;\r
this.saq = saq;\r
- this.platformName = project.getProperty("PLATFORM");\r
+ this.platformBuildFile = new File(platformBuildFile);\r
}\r
\r
/**\r
//\r
Source source = new DOMSource(document);\r
//\r
- // Prepare the output file\r
- //\r
- File file = new File(project.getProperty("PLATFORM_DIR") + File.separatorChar + platformName + "_build.xml");\r
- //\r
// generate all directory path\r
//\r
- (new File(file.getParent())).mkdirs();\r
- Result result = new StreamResult(file);\r
+ (new File(platformBuildFile.getParent())).mkdirs();\r
+ Result result = new StreamResult(platformBuildFile);\r
//\r
// Write the DOM document to the file\r
//\r
xformer.setOutputProperty(OutputKeys.INDENT, "yes");\r
xformer.transform(source, result);\r
} catch (Exception ex) {\r
- throw new BuildException("Generation of the " + platformName + "_build.xml failed!\n" + ex.getMessage());\r
+ throw new BuildException("Generating platform build file [" + platformBuildFile.getPath() + "_build.xml] failed. \n" + ex.getMessage());\r
}\r
}\r
\r