git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1269
6f19259b-4bc3-4df7-8a09-
765794883524
34 files changed:
-package org.tianocore.definitions;\r
+package org.tianocore.common.definitions;\r
\r
/**\r
This class includes the common EDK definitions.\r
\r
/**\r
This class includes the common EDK definitions.\r
-package org.tianocore.definitions;\r
+package org.tianocore.common.definitions;\r
\r
import java.io.File;\r
\r
\r
import java.io.File;\r
\r
-package org.tianocore.exception;\r
+\r
+package org.tianocore.common.exception;\r
\r
public class EdkException extends Exception {\r
static final long serialVersionUID = -8494188017252114029L;\r
\r
public class EdkException extends Exception {\r
static final long serialVersionUID = -8494188017252114029L;\r
\r
public EdkException(String message, boolean traceStack) {\r
super(message);\r
\r
public EdkException(String message, boolean traceStack) {\r
super(message);\r
public EdkException(){\r
super();\r
}\r
public EdkException(){\r
super();\r
}\r
public EdkException(Exception e, String message){\r
super("[EdkException]:" + message);\r
if (isPrintStack){\r
public EdkException(Exception e, String message){\r
super("[EdkException]:" + message);\r
if (isPrintStack){\r
-package org.tianocore.logger;\r
+package org.tianocore.common.logger;\r
+\r
import java.util.logging.Level;\r
import java.util.logging.Logger;\r
\r
import java.util.logging.Level;\r
import java.util.logging.Logger;\r
\r
-package org.tianocore.logger;\r
-import org.tianocore.logger.LogMethod;\r
+package org.tianocore.common.logger;\r
+import org.tianocore.common.logger.LogMethod;\r
\r
public class EdkLog {\r
private static final String error = "ERROR";\r
\r
public class EdkLog {\r
private static final String error = "ERROR";\r
private static final String info = "INFO";\r
private static final String verbose = "VERBOSE";\r
private static final String debug = "DEBUG";\r
private static final String info = "INFO";\r
private static final String verbose = "VERBOSE";\r
private static final String debug = "DEBUG";\r
public static final int EDK_ERROR = 0;\r
public static final int EDK_WARNING = 1;\r
public static final int EDK_INFO = 2;\r
public static final int EDK_ERROR = 0;\r
public static final int EDK_WARNING = 1;\r
public static final int EDK_INFO = 2;\r
\r
public static void log(int level, String message) {\r
if (level <= logLevel){\r
\r
public static void log(int level, String message) {\r
if (level <= logLevel){\r
- logger.putMessage(null, logLevel, message); \r
+ logger.putMessage(null, logLevel, message);\r
}\r
\r
public static void log(int logLevel, String message, Exception cause) {\r
}\r
\r
public static void log(int logLevel, String message, Exception cause) {\r
public static void setLogger(LogMethod l) {\r
logger = l;\r
}\r
public static void setLogger(LogMethod l) {\r
logger = l;\r
}\r
public static void setLogLevel (int level){\r
logLevel = level;\r
}\r
public static void setLogLevel (int level){\r
logLevel = level;\r
}\r
}\r
if (levelStr.equalsIgnoreCase(debug)){\r
logLevel = EDK_DEBUG;\r
}\r
if (levelStr.equalsIgnoreCase(debug)){\r
logLevel = EDK_DEBUG;\r
if (levelStr.equalsIgnoreCase(info)){\r
logLevel = EDK_INFO;\r
if (levelStr.equalsIgnoreCase(info)){\r
logLevel = EDK_INFO;\r
if (levelStr.equalsIgnoreCase(verbose)){\r
logLevel = EDK_VERBOSE;\r
if (levelStr.equalsIgnoreCase(verbose)){\r
logLevel = EDK_VERBOSE;\r
if (levelStr.equalsIgnoreCase(warning)){\r
logLevel = EDK_WARNING;\r
if (levelStr.equalsIgnoreCase(warning)){\r
logLevel = EDK_WARNING;\r
}\r
public static int getLogLevel (){\r
return logLevel;\r
}\r
public static int getLogLevel (){\r
return logLevel;\r
-package org.tianocore.logger;\r
+package org.tianocore.common.logger;\r
\r
public interface LogMethod {\r
public void putMessage(Object msgSource, int msgLevel, String msg);\r
\r
public interface LogMethod {\r
public void putMessage(Object msgSource, int msgLevel, String msg);\r
CreateMtFileTask class.\r
\r
CreateMtFileTask is used to call CreateMtFile.exe to create MT file.\r
CreateMtFileTask class.\r
\r
CreateMtFileTask is used to call CreateMtFile.exe to create MT file.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
CreateMtFileTask class.\r
\r
/**\r
CreateMtFileTask class.\r
* StripTask execute function is to assemble tool command line & execute\r
* tool command line\r
* StripTask execute function is to assemble tool command line & execute\r
* tool command line\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
File file = new File(outputFile);\r
if (!file.isAbsolute() && (!this.outputDir.equalsIgnoreCase(""))) {\r
argument = outputDir + File.separatorChar + outputFile + " " + this.fileSize;\r
File file = new File(outputFile);\r
if (!file.isAbsolute() && (!this.outputDir.equalsIgnoreCase(""))) {\r
argument = outputDir + File.separatorChar + outputFile + " " + this.fileSize;\r
} else {\r
argument = outputFile + " " + this.fileSize;\r
}\r
} else {\r
argument = outputFile + " " + this.fileSize;\r
}\r
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
EdkLog.log(EdkLog.EDK_INFO, (new File(this.outputFile)).getName());\r
revl = runner.execute();\r
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
EdkLog.log(EdkLog.EDK_INFO, (new File(this.outputFile)).getName());\r
revl = runner.execute();\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
* This function is to get class member "fileSize".\r
* This function is to get class member "fileSize".\r
* @return fileSize string of file size.\r
*/\r
public String getFileSize() {\r
* @return fileSize string of file size.\r
*/\r
public String getFileSize() {\r
* This function is to set class member "fileSize".\r
* This function is to set class member "fileSize".\r
* @param fileSize\r
* string of file size value.\r
*/\r
* @param fileSize\r
* string of file size value.\r
*/\r
\r
/**\r
* getOutputFile\r
\r
/**\r
* getOutputFile\r
* This function is to get class member "outputFile"\r
* This function is to get class member "outputFile"\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
\r
/**\r
* setOutputFile\r
\r
/**\r
* setOutputFile\r
* This function is to set class member "outputFile"\r
* This function is to set class member "outputFile"\r
* @param outputFile\r
* string of output file name.\r
*/\r
* @param outputFile\r
* string of output file name.\r
*/\r
\r
/**\r
* getOutputDir\r
\r
/**\r
* getOutputDir\r
* This function is to get class member "outputDir"\r
* This function is to get class member "outputDir"\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
\r
/**\r
* setOutputDir\r
\r
/**\r
* setOutputDir\r
* This function is to set class member "outputDir"\r
* This function is to set class member "outputDir"\r
* @param outputDir\r
* string of output directory.\r
*/\r
* @param outputDir\r
* string of output directory.\r
*/\r
EfiCompressTask class.\r
\r
EfiCompressTask is used to call EfiCompress.exe to strip input file.\r
EfiCompressTask class.\r
\r
EfiCompressTask is used to call EfiCompress.exe to strip input file.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
EfiCompressTask class.\r
\r
/**\r
EfiCompressTask class.\r
* EfiCompressTask execute function is to assemble tool command line & execute\r
* tool command line\r
* EfiCompressTask execute function is to assemble tool command line & execute\r
* tool command line\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
//\r
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName());\r
//\r
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName());\r
revl = runner.execute();\r
revl = runner.execute();\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
\r
/**\r
* getInputFile\r
\r
/**\r
* getInputFile\r
* This function is to get class member "inputFile".\r
* This function is to get class member "inputFile".\r
* @return string of input file name.\r
*/\r
public String getInputFile() {\r
* @return string of input file name.\r
*/\r
public String getInputFile() {\r
\r
/**\r
* setComponentType\r
\r
/**\r
* setComponentType\r
* This function is to set class member "inputFile".\r
* This function is to set class member "inputFile".\r
* @param inputFile\r
* string of input file name.\r
*/\r
* @param inputFile\r
* string of input file name.\r
*/\r
\r
/**\r
* getOutputFile\r
\r
/**\r
* getOutputFile\r
* This function is to get class member "outputFile"\r
* This function is to get class member "outputFile"\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
\r
/**\r
* setOutputFile\r
\r
/**\r
* setOutputFile\r
* This function is to set class member "outputFile"\r
* This function is to set class member "outputFile"\r
* @param outputFile\r
* string of output file name.\r
*/\r
* @param outputFile\r
* string of output file name.\r
*/\r
\r
/**\r
* getOutputDir\r
\r
/**\r
* getOutputDir\r
* This function is to get class member "outputDir"\r
* This function is to get class member "outputDir"\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
\r
/**\r
* setOutputDir\r
\r
/**\r
* setOutputDir\r
* This function is to set class member "outputDir"\r
* This function is to set class member "outputDir"\r
* @param outputDir\r
* string of output directory.\r
*/\r
* @param outputDir\r
* string of output directory.\r
*/\r
EfiRomTask class.\r
\r
EfiRomTask is used to call FlashMap.exe to lay out the flash.\r
EfiRomTask class.\r
\r
EfiRomTask is used to call FlashMap.exe to lay out the flash.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.Task;\r
import org.apache.tools.ant.Project;\r
import org.apache.tools.ant.BuildException;\r
import org.apache.tools.ant.Task;\r
import org.apache.tools.ant.Project;\r
import org.apache.tools.ant.BuildException;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
* SecFixupTask class.\r
\r
/**\r
* SecFixupTask class.\r
* SecFixupTask is used to call SecFixup.exe to fix up sec image.\r
*/\r
public class EfiRomTask extends Task implements EfiDefine {\r
* SecFixupTask is used to call SecFixup.exe to fix up sec image.\r
*/\r
public class EfiRomTask extends Task implements EfiDefine {\r
/// tool name\r
///\r
private final String toolName = "EfiRom";\r
/// tool name\r
///\r
private final String toolName = "EfiRom";\r
///\r
/// Flash default file\r
///\r
///\r
/// Flash default file\r
///\r
/// Flash device Image\r
///\r
private String deviceId = "";\r
/// Flash device Image\r
///\r
private String deviceId = "";\r
///\r
/// MCI file\r
///\r
private String outputFile = "";\r
///\r
/// MCI file\r
///\r
private String outputFile = "";\r
///\r
/// MCO file\r
///\r
private List<Input> binaryFileList = new ArrayList<Input>();\r
///\r
/// MCO file\r
///\r
private List<Input> binaryFileList = new ArrayList<Input>();\r
///\r
/// Efi PE32 image file\r
///\r
private List<Input> pe32FileList = new ArrayList<Input>();\r
///\r
/// Efi PE32 image file\r
///\r
private List<Input> pe32FileList = new ArrayList<Input>();\r
///\r
/// Compress efi PE32 image file\r
///\r
private List<Input> pe32ComprFileList = new ArrayList<Input>();\r
///\r
/// Compress efi PE32 image file\r
///\r
private List<Input> pe32ComprFileList = new ArrayList<Input>();\r
///\r
/// Hex class code in the PCI data strutor header\r
///\r
private String classCode = "";\r
///\r
/// Hex class code in the PCI data strutor header\r
///\r
private String classCode = "";\r
///\r
/// Hex revision in the PCI data header.\r
///\r
private String revision = "";\r
///\r
/// Hex revision in the PCI data header.\r
///\r
private String revision = "";\r
///\r
/// Dump the headers of an existing option rom image.\r
///\r
private String dump = "";\r
///\r
/// Dump the headers of an existing option rom image.\r
///\r
private String dump = "";\r
///\r
/// output directory\r
///\r
private String outputDir = ".";\r
///\r
/// output directory\r
///\r
private String outputDir = ".";\r
///\r
/// command and argument list\r
///\r
LinkedList<String> argList = new LinkedList<String>();\r
/**\r
* execute\r
///\r
/// command and argument list\r
///\r
LinkedList<String> argList = new LinkedList<String>();\r
/**\r
* execute\r
* EfiRomTask execute function is to assemble tool command line & execute\r
* tool command line\r
* EfiRomTask execute function is to assemble tool command line & execute\r
* tool command line\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
command = path + File.separatorChar + toolName;\r
}\r
argList.addFirst(command);\r
command = path + File.separatorChar + toolName;\r
}\r
argList.addFirst(command);\r
//\r
// add microcode binary files\r
//\r
//\r
// add microcode binary files\r
//\r
argList.add(((Input)binList.next()).getFile());\r
}\r
}\r
argList.add(((Input)binList.next()).getFile());\r
}\r
}\r
//\r
// add pe32 file\r
//\r
//\r
// add pe32 file\r
//\r
argList.add(((Input)pe32List.next()).getFile());\r
}\r
}\r
argList.add(((Input)pe32List.next()).getFile());\r
}\r
}\r
//\r
// add compressed pe32 file\r
//\r
//\r
// add compressed pe32 file\r
//\r
* This function is to get class member "verbose"\r
* This function is to get class member "verbose"\r
* @return verbose for verbose output.\r
*/\r
public String getVerbose() {\r
return verbose;\r
}\r
* @return verbose for verbose output.\r
*/\r
public String getVerbose() {\r
return verbose;\r
}\r
* This function is to set class member "verbose"\r
* This function is to set class member "verbose"\r
* @param verbose for verbose output.\r
*/\r
public void setVerbose(boolean verbose) {\r
if (verbose){\r
this.verbose = "-p";\r
* @param verbose for verbose output.\r
*/\r
public void setVerbose(boolean verbose) {\r
if (verbose){\r
this.verbose = "-p";\r
- argList.add(this.verbose); \r
+ argList.add(this.verbose);\r
* This function is to get class member "venderId"\r
* This function is to get class member "venderId"\r
* @return venderId String of venderId.\r
*/\r
public String getVenderId() {\r
return venderId;\r
}\r
* @return venderId String of venderId.\r
*/\r
public String getVenderId() {\r
return venderId;\r
}\r
* This function is to set class member "venderId"\r
* This function is to set class member "venderId"\r
* @param venderId String of venderId.\r
*/\r
public void setVenderId(String VenderId) {\r
* @param venderId String of venderId.\r
*/\r
public void setVenderId(String VenderId) {\r
argList.add("-v");\r
argList.add(this.venderId);\r
}\r
argList.add("-v");\r
argList.add(this.venderId);\r
}\r
* This function is to get class member "deviceId"\r
* This function is to get class member "deviceId"\r
* @return deviceId String of device ID.\r
*/\r
public String getDeviceId() {\r
return this.deviceId;\r
}\r
* @return deviceId String of device ID.\r
*/\r
public String getDeviceId() {\r
return this.deviceId;\r
}\r
* This function is to set class member "deviceId"\r
* This function is to set class member "deviceId"\r
* @param deviceId String of device ID.\r
*/\r
public void setDeviceId(String deviceId) {\r
* @param deviceId String of device ID.\r
*/\r
public void setDeviceId(String deviceId) {\r
argList.add(this.deviceId);\r
}\r
\r
argList.add(this.deviceId);\r
}\r
\r
* This function is to get class member "outputFile"\r
* This function is to get class member "outputFile"\r
* @return outputFile name of output directory.\r
*/\r
public String getOutputFile() {\r
return outputFile;\r
}\r
* @return outputFile name of output directory.\r
*/\r
public String getOutputFile() {\r
return outputFile;\r
}\r
* This function is to set class member "dscFile"\r
* This function is to set class member "dscFile"\r
* @param outputFile name of DSC file\r
*/\r
public void setOutputFile(String outputFile) {\r
this.outputFile = outputFile;\r
* @param outputFile name of DSC file\r
*/\r
public void setOutputFile(String outputFile) {\r
this.outputFile = outputFile;\r
* This function is to get class member "classCode"\r
* This function is to get class member "classCode"\r
* @return fdImage name of class code file.\r
*/\r
public String getClassCode() {\r
return classCode;\r
}\r
* @return fdImage name of class code file.\r
*/\r
public String getClassCode() {\r
return classCode;\r
}\r
* This function is to set class member "classCode"\r
* This function is to set class member "classCode"\r
* @param fdImage name of class code file.\r
*/\r
public void setclassCode(String classCode) {\r
* @param fdImage name of class code file.\r
*/\r
public void setclassCode(String classCode) {\r
argList.add("-cc");\r
argList.add(this.classCode);\r
}\r
argList.add("-cc");\r
argList.add(this.classCode);\r
}\r
* This function is to get class member "revision".\r
* This function is to get class member "revision".\r
* @return revision hex revision in the PDI data header.\r
*/\r
public String getRevision() {\r
return revision;\r
}\r
* @return revision hex revision in the PDI data header.\r
*/\r
public String getRevision() {\r
return revision;\r
}\r
* This function is to set class member "revision"\r
* This function is to set class member "revision"\r
* @param revision hex revision in the PDI data header.\r
*/\r
public void setRevision(String revision) {\r
* @param revision hex revision in the PDI data header.\r
*/\r
public void setRevision(String revision) {\r
argList.add("-rev");\r
argList.add(this.revision);\r
}\r
argList.add("-rev");\r
argList.add(this.revision);\r
}\r
/**\r
* getFlashDeviceImage\r
/**\r
* getFlashDeviceImage\r
* This function is to get class member "dump"\r
* This function is to get class member "dump"\r
* @return flashDeviceImage name of flash device image\r
*/\r
public String getDump() {\r
return dump;\r
}\r
* @return flashDeviceImage name of flash device image\r
*/\r
public String getDump() {\r
return dump;\r
}\r
/**\r
* setFlashDeviceImage\r
/**\r
* setFlashDeviceImage\r
* This function is to set class member "dump"\r
* This function is to set class member "dump"\r
* @param flashDeviceImage name of flash device image\r
*/\r
public void setDump(boolean dump) {\r
* @param flashDeviceImage name of flash device image\r
*/\r
public void setDump(boolean dump) {\r
\r
/**\r
* getOutputDir\r
\r
/**\r
* getOutputDir\r
* This function is to get class member "outputDir"\r
* This function is to get class member "outputDir"\r
- * \r
- * @return outputDir string of output directory \r
+ *\r
+ * @return outputDir string of output directory\r
*/\r
public String getOutputDir() {\r
return outputDir;\r
}\r
*/\r
public String getOutputDir() {\r
return outputDir;\r
}\r
* This function is to set class member "outputDir"\r
* This function is to set class member "outputDir"\r
* @param outputDir string of output directory\r
*/\r
public void setOutputDir(String outputDir) {\r
* @param outputDir string of output directory\r
*/\r
public void setOutputDir(String outputDir) {\r
}\r
/**\r
* addBinaryFile\r
}\r
/**\r
* addBinaryFile\r
* This function is to add binary file to binaryFile list.\r
* This function is to add binary file to binaryFile list.\r
* @param binaryFile name of binary file.\r
*/\r
public void addBinaryFile(Input binaryFile){\r
this.binaryFileList.add(binaryFile);\r
}\r
* @param binaryFile name of binary file.\r
*/\r
public void addBinaryFile(Input binaryFile){\r
this.binaryFileList.add(binaryFile);\r
}\r
- * \r
- * This function is to add pe32 file to pe32File list. \r
- * \r
+ *\r
+ * This function is to add pe32 file to pe32File list.\r
+ *\r
* @param pe32File name of pe32 file.\r
*/\r
public void addPe32File(Input pe32File){\r
this.pe32FileList.add(pe32File);\r
}\r
* @param pe32File name of pe32 file.\r
*/\r
public void addPe32File(Input pe32File){\r
this.pe32FileList.add(pe32File);\r
}\r
/**\r
* addPe32ComprFile\r
/**\r
* addPe32ComprFile\r
* This function os to add compressed pe32 file to pe32ComprFile list.\r
* This function os to add compressed pe32 file to pe32ComprFile list.\r
* @param pe32ComprFile name of compressed pe32 file.\r
*/\r
public void addPe32ComprFile(Input pe32ComprFile){\r
* @param pe32ComprFile name of compressed pe32 file.\r
*/\r
public void addPe32ComprFile(Input pe32ComprFile){\r
FlashMapTask class.\r
\r
FlashMapTask is used to call FlashMap.exe to lay out the flash.\r
FlashMapTask class.\r
\r
FlashMapTask is used to call FlashMap.exe to lay out the flash.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.Task;\r
import org.apache.tools.ant.Project;\r
import org.apache.tools.ant.BuildException;\r
import org.apache.tools.ant.Task;\r
import org.apache.tools.ant.Project;\r
import org.apache.tools.ant.BuildException;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
* FlashMapTask class.\r
\r
/**\r
* FlashMapTask class.\r
* FlashMapTask is used to call FlashMap.exe to generate flash map defition files and fd files.\r
*/\r
public class FlashMapTask extends Task implements EfiDefine {\r
* FlashMapTask is used to call FlashMap.exe to generate flash map defition files and fd files.\r
*/\r
public class FlashMapTask extends Task implements EfiDefine {\r
* FlashMapTask execute function is to assemble tool command line & execute\r
* tool command line\r
* FlashMapTask execute function is to assemble tool command line & execute\r
* tool command line\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
argList.add(this.inStrFile);\r
argList.add(this.outStrFile);\r
}\r
argList.add(this.inStrFile);\r
argList.add(this.outStrFile);\r
}\r
//\r
// add microcode binary files\r
//\r
//\r
// add microcode binary files\r
//\r
\r
/**\r
* getFlashDefFile\r
\r
/**\r
* getFlashDefFile\r
* This function is to get class member "flashDefFile"\r
* This function is to get class member "flashDefFile"\r
* @return flashDeFile Name of flash definition file.\r
*/\r
public String getFlashDefFile() {\r
* @return flashDeFile Name of flash definition file.\r
*/\r
public String getFlashDefFile() {\r
\r
/**\r
* setFlashDefFile\r
\r
/**\r
* setFlashDefFile\r
* This function is to set class member "flashDefFile"\r
* This function is to set class member "flashDefFile"\r
* @param flashDefFile\r
* Name of flash definition file.\r
*/\r
* @param flashDefFile\r
* Name of flash definition file.\r
*/\r
* This function is to get class member "aligment"\r
* This function is to get class member "aligment"\r
* @return aligment String of aligment value.\r
*/\r
public String getAligment() {\r
* @return aligment String of aligment value.\r
*/\r
public String getAligment() {\r
* This function is to set class member "aligment"\r
* This function is to set class member "aligment"\r
* @param aligment\r
* String of aligment value.\r
*/\r
* @param aligment\r
* String of aligment value.\r
*/\r
\r
/**\r
* getAsmIncFile\r
\r
/**\r
* getAsmIncFile\r
* This function is to get class member "asmIncFile"\r
* This function is to get class member "asmIncFile"\r
* @return asmIncFile String of ASM include file.\r
*/\r
public String getAsmIncFile() {\r
* @return asmIncFile String of ASM include file.\r
*/\r
public String getAsmIncFile() {\r
\r
/**\r
* setAsmIncFile\r
\r
/**\r
* setAsmIncFile\r
* This function is to set class member "asmIncFile"\r
* This function is to set class member "asmIncFile"\r
* @param asmIncFile\r
* String of ASM include file.\r
*/\r
* @param asmIncFile\r
* String of ASM include file.\r
*/\r
* This function is to get class member "baseAddr"\r
* This function is to get class member "baseAddr"\r
* @return baseAddr String of base address value.\r
*/\r
public String getBaseAddr() {\r
* @return baseAddr String of base address value.\r
*/\r
public String getBaseAddr() {\r
* This function is to set class member "baseAddr"\r
* This function is to set class member "baseAddr"\r
* @param baseAddr\r
* String of base address value.\r
*/\r
* @param baseAddr\r
* String of base address value.\r
*/\r
* This function is to get class member "dscFile"\r
* This function is to get class member "dscFile"\r
* @return dscFile name of DSC file\r
*/\r
public String getDscFile() {\r
* @return dscFile name of DSC file\r
*/\r
public String getDscFile() {\r
* This function is to set class member "dscFile"\r
* This function is to set class member "dscFile"\r
* @param dscFile\r
* name of DSC file\r
*/\r
* @param dscFile\r
* name of DSC file\r
*/\r
* This function is to get class member "fdImage"\r
* This function is to get class member "fdImage"\r
* @return fdImage name of input FDI image file.\r
*/\r
public String getFdImage() {\r
* @return fdImage name of input FDI image file.\r
*/\r
public String getFdImage() {\r
* This function is to set class member "fdImage"\r
* This function is to set class member "fdImage"\r
* @param fdImage\r
* name of input FDI image file.\r
*/\r
* @param fdImage\r
* name of input FDI image file.\r
*/\r
\r
/**\r
* getFlashDevice\r
\r
/**\r
* getFlashDevice\r
* This function is to get class member "flashDevice".\r
* This function is to get class member "flashDevice".\r
* @return flashDevice name of flash device.\r
*/\r
public String getFlashDevice() {\r
* @return flashDevice name of flash device.\r
*/\r
public String getFlashDevice() {\r
\r
/**\r
* setFlashDevice\r
\r
/**\r
* setFlashDevice\r
* This function is to set class member "flashDevice"\r
* This function is to set class member "flashDevice"\r
* @param flashDevice\r
* name of flash device.\r
*/\r
* @param flashDevice\r
* name of flash device.\r
*/\r
\r
/**\r
* getFlashDeviceImage\r
\r
/**\r
* getFlashDeviceImage\r
* This function is to get class member "flashDeviceImage"\r
* This function is to get class member "flashDeviceImage"\r
* @return flashDeviceImage name of flash device image\r
*/\r
public String getFlashDeviceImage() {\r
* @return flashDeviceImage name of flash device image\r
*/\r
public String getFlashDeviceImage() {\r
\r
/**\r
* setFlashDeviceImage\r
\r
/**\r
* setFlashDeviceImage\r
* This function is to set class member "flashDeviceImage"\r
* This function is to set class member "flashDeviceImage"\r
* @param flashDeviceImage\r
* name of flash device image\r
*/\r
* @param flashDeviceImage\r
* name of flash device image\r
*/\r
\r
/**\r
* getHeaderFile\r
\r
/**\r
* getHeaderFile\r
* This function is to get class member "headerFile"\r
* This function is to get class member "headerFile"\r
* @return headerFile name of include file\r
*/\r
public String getHeaderFile() {\r
* @return headerFile name of include file\r
*/\r
public String getHeaderFile() {\r
\r
/**\r
* setHeaderFile\r
\r
/**\r
* setHeaderFile\r
* This function is to set class member "headerFile"\r
* This function is to set class member "headerFile"\r
* @param headerFile\r
* name of include file\r
*/\r
* @param headerFile\r
* name of include file\r
*/\r
\r
/**\r
* getImageOutFile\r
\r
/**\r
* getImageOutFile\r
* This function is to get class member "imageOutFile"\r
* This function is to get class member "imageOutFile"\r
* @return imageOutFile name of output image file\r
*/\r
public String getImageOutFile() {\r
* @return imageOutFile name of output image file\r
*/\r
public String getImageOutFile() {\r
\r
/**\r
* setImageOutFile\r
\r
/**\r
* setImageOutFile\r
* This function is to set class member "ImageOutFile"\r
* This function is to set class member "ImageOutFile"\r
* @param imageOutFile\r
* name of output image file\r
*/\r
* @param imageOutFile\r
* name of output image file\r
*/\r
\r
/**\r
* getInStrFile\r
\r
/**\r
* getInStrFile\r
* This function is to get class member "inStrFile"\r
* This function is to get class member "inStrFile"\r
* @return inStrFile name of input file which used to replace symbol names.\r
*/\r
public String getInStrFile() {\r
* @return inStrFile name of input file which used to replace symbol names.\r
*/\r
public String getInStrFile() {\r
\r
/**\r
* setInStrFile\r
\r
/**\r
* setInStrFile\r
* This function is to set class member "inStrFile"\r
* This function is to set class member "inStrFile"\r
* @param inStrFile\r
* name of input file which used to replace symbol names.\r
*/\r
* @param inStrFile\r
* name of input file which used to replace symbol names.\r
*/\r
* This function is to get class member "mciFile"\r
* This function is to get class member "mciFile"\r
* @return mciFile name of input microcode file\r
*/\r
public String getMciFile() {\r
* @return mciFile name of input microcode file\r
*/\r
public String getMciFile() {\r
* This function is to set class member "mciFile"\r
* This function is to set class member "mciFile"\r
* @param mciFile\r
* name of input microcode file\r
*/\r
* @param mciFile\r
* name of input microcode file\r
*/\r
* This function is to get class member "mcoFile"\r
* This function is to get class member "mcoFile"\r
* @return mcoFile name of output binary microcode image\r
*/\r
public String getMcoFile() {\r
* @return mcoFile name of output binary microcode image\r
*/\r
public String getMcoFile() {\r
* This function is to set class member "mcoFile"\r
* This function is to set class member "mcoFile"\r
* @param mcoFile\r
* name of output binary microcode image\r
*/\r
* @param mcoFile\r
* name of output binary microcode image\r
*/\r
\r
/**\r
* getOutStrFile\r
\r
/**\r
* getOutStrFile\r
* This function is to get class member "outStrFile"\r
* This function is to get class member "outStrFile"\r
* @return outStrFile name of output string substitution file\r
*/\r
public String getOutStrFile() {\r
* @return outStrFile name of output string substitution file\r
*/\r
public String getOutStrFile() {\r
\r
/**\r
* setOutStrFile\r
\r
/**\r
* setOutStrFile\r
* This function is to set class member "outStrFile"\r
* This function is to set class member "outStrFile"\r
* @param outStrFile\r
* name of output string substitution file\r
*/\r
* @param outStrFile\r
* name of output string substitution file\r
*/\r
* This function is to get class member "padValue"\r
* This function is to get class member "padValue"\r
* @return padValue string of byte value to use as padding\r
*/\r
public String getPadValue() {\r
* @return padValue string of byte value to use as padding\r
*/\r
public String getPadValue() {\r
* This function is to set class member "padValue"\r
* This function is to set class member "padValue"\r
* @param padValue\r
* string of byte value to use as padding\r
*/\r
* @param padValue\r
* string of byte value to use as padding\r
*/\r
* This function is to add Microcode binary file\r
* This function is to add Microcode binary file\r
* @param mciFile\r
* instance of input class\r
*/\r
* @param mciFile\r
* instance of input class\r
*/\r
\r
/**\r
* getOutputDir\r
\r
/**\r
* getOutputDir\r
* This function is to get class member "outputDir"\r
* This function is to get class member "outputDir"\r
* @return outputDir string of output directory\r
*/\r
public String getOutputDir() {\r
* @return outputDir string of output directory\r
*/\r
public String getOutputDir() {\r
\r
/**\r
* setOutputDir\r
\r
/**\r
* setOutputDir\r
* This function is to set class member "outputDir"\r
* This function is to set class member "outputDir"\r
* @param outputDir\r
* string of output directory\r
*/\r
* @param outputDir\r
* string of output directory\r
*/\r
--*/\r
\r
package org.tianocore.framework.tasks;\r
--*/\r
\r
package org.tianocore.framework.tasks;\r
import org.apache.tools.ant.Project;\r
import org.apache.tools.ant.Project;\r
-import org.tianocore.logger.LogMethod;\r
+\r
+import org.tianocore.common.logger.LogMethod;\r
\r
class FrameworkLogger implements LogMethod {\r
private Project project;\r
private String titleName;\r
public FrameworkLogger(Project project, String taskName) {\r
this.project = project;\r
\r
class FrameworkLogger implements LogMethod {\r
private Project project;\r
private String titleName;\r
public FrameworkLogger(Project project, String taskName) {\r
this.project = project;\r
- this.titleName = taskName; \r
+ this.titleName = taskName;\r
- public void putMessage(Object msgSource, int msgLevel, String msg) { \r
+ public void putMessage(Object msgSource, int msgLevel, String msg) {\r
String frameworkMsg = " [" + this.titleName + "] " + msg;\r
this.project.log(frameworkMsg, Project.MSG_INFO);\r
}\r
String frameworkMsg = " [" + this.titleName + "] " + msg;\r
this.project.log(frameworkMsg, Project.MSG_INFO);\r
}\r
FwImageTask class.\r
\r
FwImageTask is used to call FwImage.ext to generate the FwImage.\r
FwImageTask class.\r
\r
FwImageTask is used to call FwImage.ext to generate the FwImage.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
**/\r
public class FwImageTask extends Task implements EfiDefine{\r
///\r
**/\r
public class FwImageTask extends Task implements EfiDefine{\r
///\r
///\r
private String time = "";\r
///\r
/// input PE image\r
///\r
private String time = "";\r
///\r
/// input PE image\r
private String peImage = "";\r
private String peImageName = "";\r
///\r
/// output EFI image\r
private String peImage = "";\r
private String peImageName = "";\r
///\r
/// output EFI image\r
private String outImage = "";\r
///\r
/// component type\r
private String outImage = "";\r
///\r
/// component type\r
\r
/**\r
* assemble tool command line & execute tool command line\r
\r
/**\r
* assemble tool command line & execute tool command line\r
* @throws BuildException\r
*/\r
/**\r
* @throws BuildException\r
*/\r
/**\r
FwimageTask execute function is to assemble tool command line & execute\r
tool command line\r
FwimageTask execute function is to assemble tool command line & execute\r
tool command line\r
@throws BuidException\r
**/\r
public void execute() throws BuildException {\r
@throws BuidException\r
**/\r
public void execute() throws BuildException {\r
This function is to set operation of class member "time".\r
This function is to set operation of class member "time".\r
@param time string of time\r
**/\r
public void setTime(String time) {\r
@param time string of time\r
**/\r
public void setTime(String time) {\r
This function is to get class member "time"\r
@return time string of time\r
**/\r
This function is to get class member "time"\r
@return time string of time\r
**/\r
This function is to get class member "peImage".\r
@return name of PE image\r
**/\r
This function is to get class member "peImage".\r
@return name of PE image\r
**/\r
This function is to set class member "peImage"\r
@param peImage name of PE image\r
**/\r
This function is to set class member "peImage"\r
@param peImage name of PE image\r
**/\r
This function is to get class member "outImage".\r
@return name of output EFI image\r
**/\r
This function is to get class member "outImage".\r
@return name of output EFI image\r
**/\r
This function is to set class member "outImage".\r
@param outImage name of output EFI image\r
**/\r
This function is to set class member "outImage".\r
@param outImage name of output EFI image\r
**/\r
\r
/**\r
getComponentType\r
\r
/**\r
getComponentType\r
This function is to get class member "componentType".\r
This function is to get class member "componentType".\r
@return string of componentType\r
**/\r
public String getComponentType() {\r
@return string of componentType\r
**/\r
public String getComponentType() {\r
\r
/**\r
setComponentType\r
\r
/**\r
setComponentType\r
This function is to set class member "componentType".\r
@param componentType string of component type\r
**/\r
This function is to set class member "componentType".\r
@param componentType string of component type\r
**/\r
GenAcpiTable class.\r
\r
GenAcpiTable is used to call GenAcpiTable.exe to generate ACPI Table image .\r
GenAcpiTable class.\r
\r
GenAcpiTable is used to call GenAcpiTable.exe to generate ACPI Table image .\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
GenAcpiTable class.\r
\r
/**\r
GenAcpiTable class.\r
* StripTask execute function is to assemble tool command line & execute\r
* tool command line\r
* StripTask execute function is to assemble tool command line & execute\r
* tool command line\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName());\r
revl = runner.execute();\r
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName());\r
revl = runner.execute();\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
\r
/**\r
* getInputFile\r
\r
/**\r
* getInputFile\r
* This function is to get class member "inputFile".\r
* This function is to get class member "inputFile".\r
* @return string of input file name.\r
*/\r
public String getInputFile() {\r
* @return string of input file name.\r
*/\r
public String getInputFile() {\r
\r
/**\r
* setComponentType\r
\r
/**\r
* setComponentType\r
* This function is to set class member "inputFile".\r
* This function is to set class member "inputFile".\r
* @param inputFile\r
* string of input file name.\r
*/\r
* @param inputFile\r
* string of input file name.\r
*/\r
\r
/**\r
* getOutputFile\r
\r
/**\r
* getOutputFile\r
* This function is to get class member "outputFile"\r
* This function is to get class member "outputFile"\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
\r
/**\r
* setOutputFile\r
\r
/**\r
* setOutputFile\r
* This function is to set class member "outputFile"\r
* This function is to set class member "outputFile"\r
* @param outputFile\r
* string of output file name.\r
*/\r
* @param outputFile\r
* string of output file name.\r
*/\r
\r
/**\r
* getOutputDir\r
\r
/**\r
* getOutputDir\r
* This function is to get class member "outputDir"\r
* This function is to get class member "outputDir"\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
\r
/**\r
* setOutputDir\r
\r
/**\r
* setOutputDir\r
* This function is to set class member "outputDir"\r
* This function is to set class member "outputDir"\r
* @param outputDir\r
* string of output directory.\r
*/\r
* @param outputDir\r
* string of output directory.\r
*/\r
GenCapsuleHdrTask class.\r
\r
GenCapsuleHdrTask is used to call GenCapsuleHdr.exe to generate capsule.\r
GenCapsuleHdrTask class.\r
\r
GenCapsuleHdrTask is used to call GenCapsuleHdr.exe to generate capsule.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
GenCapsuleHdrTask class.\r
\r
/**\r
GenCapsuleHdrTask class.\r
/// tool name\r
///\r
private String toolName = "GenCapsuleHdr";\r
/// tool name\r
///\r
private String toolName = "GenCapsuleHdr";\r
///\r
/// script file\r
///\r
///\r
/// script file\r
///\r
/// Dump flag\r
///\r
private String dump = "";\r
/// Dump flag\r
///\r
private String dump = "";\r
///\r
/// Split size\r
///\r
private String size = "";\r
///\r
/// Split size\r
///\r
private String size = "";\r
///\r
/// capsule into one image flag\r
///\r
private String joinFlag = "";\r
///\r
/// capsule into one image flag\r
///\r
private String joinFlag = "";\r
///\r
/// capsule file\r
///\r
///\r
/// capsule file\r
///\r
* GenCapsuleHdrTask execute function is to assemble tool command line & execute\r
* tool command line\r
* GenCapsuleHdrTask execute function is to assemble tool command line & execute\r
* tool command line\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
\r
/**\r
* getInputFile\r
\r
/**\r
* getInputFile\r
* This function is to get class member "scriptFile".\r
* This function is to get class member "scriptFile".\r
* @return string of input file name.\r
*/\r
public String getScriptFile() {\r
* @return string of input file name.\r
*/\r
public String getScriptFile() {\r
\r
/**\r
* setComponentType\r
\r
/**\r
* setComponentType\r
* This function is to set class member "inputFile".\r
* This function is to set class member "inputFile".\r
* @param inputFile\r
* string of input file name.\r
*/\r
* @param inputFile\r
* string of input file name.\r
*/\r
\r
/**\r
* getOutputFile\r
\r
/**\r
* getOutputFile\r
* This function is to get class member "outputFile"\r
* This function is to get class member "outputFile"\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
\r
/**\r
* setOutputFile\r
\r
/**\r
* setOutputFile\r
* This function is to set class member "outputFile"\r
* This function is to set class member "outputFile"\r
* @param outputFile\r
* string of output file name.\r
*/\r
* @param outputFile\r
* string of output file name.\r
*/\r
\r
/**\r
* getOutputDir\r
\r
/**\r
* getOutputDir\r
* This function is to get class member "outputDir"\r
* This function is to get class member "outputDir"\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
\r
/**\r
* setOutputDir\r
\r
/**\r
* setOutputDir\r
* This function is to set class member "outputDir"\r
* This function is to set class member "outputDir"\r
* @param outputDir\r
* string of output directory.\r
*/\r
* @param outputDir\r
* string of output directory.\r
*/\r
* This function is to get class member "verbose"\r
* This function is to get class member "verbose"\r
* @return verbose the flag of verbose.\r
*/\r
public String getVerbose() {\r
* @return verbose the flag of verbose.\r
*/\r
public String getVerbose() {\r
* This function is to set class member "verbose"\r
* This function is to set class member "verbose"\r
* @param verbose\r
* True or False.\r
*/\r
* @param verbose\r
* True or False.\r
*/\r
* This function is to get class member "dump"\r
* This function is to get class member "dump"\r
* @return verbose the flag of dump.\r
*/\r
public String getDump() {\r
* @return verbose the flag of dump.\r
*/\r
public String getDump() {\r
* This function is to set class member "dump".\r
* This function is to set class member "dump".\r
* @param dump\r
* True or False.\r
*/\r
* @param dump\r
* True or False.\r
*/\r
* This function is to set class member "size".\r
* This function is to set class member "size".\r
* @return size string of size value\r
*/\r
public String getSize() {\r
* @return size string of size value\r
*/\r
public String getSize() {\r
* This function is to set class member "size".\r
* This function is to set class member "size".\r
* @param size string of size value.\r
*/\r
public void setSize(String size) {\r
* @param size string of size value.\r
*/\r
public void setSize(String size) {\r
\r
/**\r
* getCapsuleFile\r
\r
/**\r
* getCapsuleFile\r
* This function is to get class member "capsuleFile"\r
* This function is to get class member "capsuleFile"\r
* @return capsuleFile capsule file name\r
*/\r
public String getCapsuleFile() {\r
* @return capsuleFile capsule file name\r
*/\r
public String getCapsuleFile() {\r
\r
/**\r
* setCapsuleFile\r
\r
/**\r
* setCapsuleFile\r
* This function is to set class member "capsuleFile"\r
* This function is to set class member "capsuleFile"\r
* @param capsuleFile capsule file name\r
*/\r
public void setCapsuleFile(String capsuleFile) {\r
* @param capsuleFile capsule file name\r
*/\r
public void setCapsuleFile(String capsuleFile) {\r
* This function is to get class member "joinFlag"\r
* This function is to get class member "joinFlag"\r
- * \r
- * @return joinFlag flag of if need to join split capsule images into \r
+ *\r
+ * @return joinFlag flag of if need to join split capsule images into\r
* a single image.\r
*/\r
public String getJoinFlag() {\r
* a single image.\r
*/\r
public String getJoinFlag() {\r
* This function is to set class member "joinFlag"\r
* This function is to set class member "joinFlag"\r
- * \r
- * @param joinFlag flag of if need to join split capsule images into \r
- * a single image. \r
+ *\r
+ * @param joinFlag flag of if need to join split capsule images into\r
+ * a single image.\r
*/\r
public void setJoinFlag(boolean joinFlag) {\r
if (joinFlag){\r
*/\r
public void setJoinFlag(boolean joinFlag) {\r
if (joinFlag){\r
- this.joinFlag = "-j "; \r
+ this.joinFlag = "-j ";\r
GenTeImageTask class.\r
\r
GenTeImageTask is used to call GenTEImage.exe to generate TE image .\r
GenTeImageTask class.\r
\r
GenTeImageTask is used to call GenTEImage.exe to generate TE image .\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
* GenTeImageTask class.\r
\r
/**\r
* GenTeImageTask class.\r
* GenTeImageTask is used to call GenAcpiTable.exe to generate ACPI Table image .\r
*/\r
public class GenTeImageTask extends Task implements EfiDefine {\r
* GenTeImageTask is used to call GenAcpiTable.exe to generate ACPI Table image .\r
*/\r
public class GenTeImageTask extends Task implements EfiDefine {\r
\r
/**\r
* assemble tool command line & execute tool command line\r
\r
/**\r
* assemble tool command line & execute tool command line\r
* @throws BuildException\r
*/\r
/**\r
* execute\r
* @throws BuildException\r
*/\r
/**\r
* execute\r
* GenTeImgaeTask execute function is to assemble tool command line & execute\r
* tool command line\r
* GenTeImgaeTask execute function is to assemble tool command line & execute\r
* tool command line\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
\r
/**\r
* getInputFile\r
\r
/**\r
* getInputFile\r
* This function is to get class member "inputFile".\r
* This function is to get class member "inputFile".\r
* @return string of input file name.\r
*/\r
public String getInputFile() {\r
* @return string of input file name.\r
*/\r
public String getInputFile() {\r
\r
/**\r
* setComponentType\r
\r
/**\r
* setComponentType\r
* This function is to set class member "inputFile".\r
* This function is to set class member "inputFile".\r
* @param inputFile\r
* string of input file name.\r
*/\r
* @param inputFile\r
* string of input file name.\r
*/\r
\r
/**\r
* getOutputFile\r
\r
/**\r
* getOutputFile\r
* This function is to get class member "outputFile"\r
* This function is to get class member "outputFile"\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
\r
/**\r
* setOutputFile\r
\r
/**\r
* setOutputFile\r
* This function is to set class member "outputFile"\r
* This function is to set class member "outputFile"\r
* @param outputFile\r
* string of output file name.\r
*/\r
* @param outputFile\r
* string of output file name.\r
*/\r
\r
/**\r
* getOutputDir\r
\r
/**\r
* getOutputDir\r
* This function is to get class member "outputDir"\r
* This function is to get class member "outputDir"\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
\r
/**\r
* setOutputDir\r
\r
/**\r
* setOutputDir\r
* This function is to set class member "outputDir"\r
* This function is to set class member "outputDir"\r
* @param outputDir\r
* string of output directory.\r
*/\r
* @param outputDir\r
* string of output directory.\r
*/\r
* This function is to get class member "verbose"\r
* This function is to get class member "verbose"\r
* @return verbose the flag of verbose.\r
*/\r
public String getVerbose() {\r
* @return verbose the flag of verbose.\r
*/\r
public String getVerbose() {\r
* This function is to set class member "verbose"\r
* This function is to set class member "verbose"\r
* @param verbose\r
* True or False.\r
*/\r
* @param verbose\r
* True or False.\r
*/\r
* This function is to get class member "dump"\r
* This function is to get class member "dump"\r
* @return verbose the flag of dump.\r
*/\r
public String getDump() {\r
* @return verbose the flag of dump.\r
*/\r
public String getDump() {\r
* This function is to set class member "dump"\r
* This function is to set class member "dump"\r
* @param dump\r
* True or False.\r
*/\r
* @param dump\r
* True or False.\r
*/\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.types.Path;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.types.Path;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
Class MakeDeps is used to wrap MakeDeps.exe as an ANT task.\r
\r
/**\r
Class MakeDeps is used to wrap MakeDeps.exe as an ANT task.\r
\r
///\r
/// if there's no source files, we can do nothing about dependency\r
\r
///\r
/// if there's no source files, we can do nothing about dependency\r
if (inputFileList.size() == 0) {\r
throw new BuildException("No source files specified to scan");\r
}\r
if (inputFileList.size() == 0) {\r
throw new BuildException("No source files specified to scan");\r
}\r
\r
///\r
/// compose the final file content\r
\r
///\r
/// compose the final file content\r
StringBuffer cleanedLines = new StringBuffer(40960);\r
Iterator<String> it = lineSet.iterator();\r
while (it.hasNext()) {\r
StringBuffer cleanedLines = new StringBuffer(40960);\r
Iterator<String> it = lineSet.iterator();\r
while (it.hasNext()) {\r
ModifyInfTask class.\r
\r
ModifyInfTask is used to call Modify.exe to generate inf file.\r
ModifyInfTask class.\r
\r
ModifyInfTask is used to call Modify.exe to generate inf file.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
ModifyInfTask class.\r
\r
/**\r
ModifyInfTask class.\r
/// tool name\r
///\r
private String toolName = "ModifyInf";\r
/// tool name\r
///\r
private String toolName = "ModifyInf";\r
///\r
/// input FV inf file\r
///\r
///\r
/// input FV inf file\r
///\r
\r
///\r
/// Output dir\r
\r
///\r
/// Output dir\r
private String outputDir = "";\r
private String outputDir = "";\r
* ModifyInfTask execute function is to assemble tool command line & execute\r
* tool command line\r
* ModifyInfTask execute function is to assemble tool command line & execute\r
* tool command line\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
File file = new File(outputFVInfFileName);\r
if (!file.isAbsolute() && (!this.outputDir.equalsIgnoreCase(""))) {\r
argument = this.inputFVInfFileName +\r
File file = new File(outputFVInfFileName);\r
if (!file.isAbsolute() && (!this.outputDir.equalsIgnoreCase(""))) {\r
argument = this.inputFVInfFileName +\r
File.separatorChar +\r
this.outputFVInfFileName +\r
this.patternStr;\r
} else {\r
File.separatorChar +\r
this.outputFVInfFileName +\r
this.patternStr;\r
} else {\r
- argument = this.inputFVInfFileName + \r
+ argument = this.inputFVInfFileName +\r
this.outputFVInfFileName +\r
this.patternStr;\r
}\r
this.outputFVInfFileName +\r
this.patternStr;\r
}\r
\r
/**\r
* getinputFVInfFileName\r
\r
/**\r
* getinputFVInfFileName\r
* This function is to get class member "inputFVInfFileName".\r
* This function is to get class member "inputFVInfFileName".\r
* @return string of input inf file name.\r
*/\r
public String getinputFVInfFileName() {\r
* @return string of input inf file name.\r
*/\r
public String getinputFVInfFileName() {\r
\r
/**\r
* setinputFVInfFileName\r
\r
/**\r
* setinputFVInfFileName\r
* This function is to set class member "inputFVInfFileName".\r
* This function is to set class member "inputFVInfFileName".\r
* @param inputFile\r
* string of input inf file name.\r
*/\r
* @param inputFile\r
* string of input inf file name.\r
*/\r
\r
/**\r
* getoutputFVInfFileName\r
\r
/**\r
* getoutputFVInfFileName\r
* This function is to get class member "outputFVInfFileName"\r
* This function is to get class member "outputFVInfFileName"\r
* @return outputFVInfFileName string of output inf file name.\r
*/\r
public String getoutputFVInfFileName() {\r
* @return outputFVInfFileName string of output inf file name.\r
*/\r
public String getoutputFVInfFileName() {\r
\r
/**\r
* setoutputFVInfFileName\r
\r
/**\r
* setoutputFVInfFileName\r
* This function is to set class member "outputFVInfFileName"\r
* This function is to set class member "outputFVInfFileName"\r
* @param outputFVInfFileName\r
* string of output inf file name.\r
*/\r
* @param outputFVInfFileName\r
* string of output inf file name.\r
*/\r
\r
/**\r
* getpatternStr\r
\r
/**\r
* getpatternStr\r
* This function is to get class member "patternStr"\r
* This function is to get class member "patternStr"\r
* @return patternStr string of pattern.\r
*/\r
public String getpatternStr() {\r
* @return patternStr string of pattern.\r
*/\r
public String getpatternStr() {\r
\r
/**\r
* setpatternStr\r
\r
/**\r
* setpatternStr\r
* This function is to set class member "patternStr"\r
* This function is to set class member "patternStr"\r
* @param patternStr\r
* string of patternStr.\r
*/\r
* @param patternStr\r
* string of patternStr.\r
*/\r
\r
/**\r
* getoutputDir\r
\r
/**\r
* getoutputDir\r
* This function is to get class member "outputDir"\r
* This function is to get class member "outputDir"\r
* @return outputDir string of output directory.\r
*/\r
public String getoutputDir() {\r
* @return outputDir string of output directory.\r
*/\r
public String getoutputDir() {\r
\r
/**\r
* setoutputDir\r
\r
/**\r
* setoutputDir\r
* This function is to set class member "outputDir"\r
* This function is to set class member "outputDir"\r
* @param patternStr\r
* string of output directory.\r
*/\r
* @param patternStr\r
* string of output directory.\r
*/\r
PeiReBaseTask class.\r
\r
PeiReBaseTask is used to call PeiReBase.exe to rebase efi fv file.\r
PeiReBaseTask class.\r
\r
PeiReBaseTask is used to call PeiReBase.exe to rebase efi fv file.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
PeiReBaseTask class.\r
\r
/**\r
PeiReBaseTask class.\r
// / Output directory, this variable is added by jave wrap\r
// /\r
private String outputDir = "";\r
// / Output directory, this variable is added by jave wrap\r
// /\r
private String outputDir = "";\r
///\r
/// Base address\r
///\r
private String baseAddr = "";\r
///\r
/// Base address\r
///\r
private String baseAddr = "";\r
///\r
private String arch = "";\r
///\r
private String arch = "";\r
* PeiReBaseTask execute function is to assemble tool command line & execute\r
* tool command line\r
* PeiReBaseTask execute function is to assemble tool command line & execute\r
* tool command line\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
FrameworkLogger logger = new FrameworkLogger(project, toolName.toLowerCase());\r
EdkLog.setLogLevel(project.getProperty("env.LOGLEVEL"));\r
EdkLog.setLogger(logger);\r
FrameworkLogger logger = new FrameworkLogger(project, toolName.toLowerCase());\r
EdkLog.setLogLevel(project.getProperty("env.LOGLEVEL"));\r
EdkLog.setLogger(logger);\r
//\r
// absolute path of efi tools\r
//\r
//\r
// absolute path of efi tools\r
//\r
if (path != null) {\r
command = path + File.separatorChar + command;\r
}\r
if (path != null) {\r
command = path + File.separatorChar + command;\r
}\r
//\r
// argument of tools\r
//\r
//\r
// argument of tools\r
//\r
} else {\r
argument = inputFile + " " + "-O " + outputFile + " " + this.baseAddr+ " " + "-M " + outputFile + ".map";\r
}\r
} else {\r
argument = inputFile + " " + "-O " + outputFile + " " + this.baseAddr+ " " + "-M " + outputFile + ".map";\r
}\r
//\r
// return value of fwimage execution\r
//\r
//\r
// return value of fwimage execution\r
//\r
//\r
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
EdkLog.log(EdkLog.EDK_INFO, this.inputFileName);\r
//\r
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
EdkLog.log(EdkLog.EDK_INFO, this.inputFileName);\r
revl = runner.execute();\r
revl = runner.execute();\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
\r
/**\r
* getInputFile\r
\r
/**\r
* getInputFile\r
* This function is to get class member "inputFile".\r
* This function is to get class member "inputFile".\r
* @return string of input file name.\r
*/\r
public String getInputFile() {\r
* @return string of input file name.\r
*/\r
public String getInputFile() {\r
\r
/**\r
* setComponentType\r
\r
/**\r
* setComponentType\r
* This function is to set class member "inputFile".\r
* This function is to set class member "inputFile".\r
* @param inputFile\r
* string of input file name.\r
*/\r
* @param inputFile\r
* string of input file name.\r
*/\r
\r
/**\r
* getOutputFile\r
\r
/**\r
* getOutputFile\r
* This function is to get class member "outputFile"\r
* This function is to get class member "outputFile"\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
\r
/**\r
* setOutputFile\r
\r
/**\r
* setOutputFile\r
* This function is to set class member "outputFile"\r
* This function is to set class member "outputFile"\r
* @param outputFile\r
* string of output file name.\r
*/\r
* @param outputFile\r
* string of output file name.\r
*/\r
\r
/**\r
* getOutputDir\r
\r
/**\r
* getOutputDir\r
* This function is to get class member "outputDir"\r
* This function is to get class member "outputDir"\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
\r
/**\r
* setOutputDir\r
\r
/**\r
* setOutputDir\r
* This function is to set class member "outputDir"\r
* This function is to set class member "outputDir"\r
* @param outputDir\r
* string of output directory.\r
*/\r
* @param outputDir\r
* string of output directory.\r
*/\r
* This function is to get class member "baseAddr"\r
* This function is to get class member "baseAddr"\r
* @return baseAddr string of base address.\r
*/\r
public String getBaseAddr() {\r
* @return baseAddr string of base address.\r
*/\r
public String getBaseAddr() {\r
* This function is to set class member "baseAddr"\r
* This function is to set class member "baseAddr"\r
* @param baseAddr string of base address\r
*/\r
public void setBaseAddr(String baseAddr) {\r
* @param baseAddr string of base address\r
*/\r
public void setBaseAddr(String baseAddr) {\r
* This function is to get class member "arch".\r
* This function is to get class member "arch".\r
* @return arch Architecture\r
*/\r
public String getArch() {\r
* @return arch Architecture\r
*/\r
public String getArch() {\r
- * \r
- * This function is to set class member "arch" \r
- * \r
+ *\r
+ * This function is to set class member "arch"\r
+ *\r
* @param arch Architecture\r
*/\r
public void setArch(String arch) {\r
* @param arch Architecture\r
*/\r
public void setArch(String arch) {\r
\r
SecApResetVectorFixupTask is used to call SecApResetVectorFixup.exe to place\r
Ap reset vector.\r
\r
SecApResetVectorFixupTask is used to call SecApResetVectorFixup.exe to place\r
Ap reset vector.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
SecApResetVectorFixupTask class.\r
\r
/**\r
SecApResetVectorFixupTask class.\r
* SecApResetVectorFixupTask execute function is to assemble tool command line & execute\r
* tool command line\r
* SecApResetVectorFixupTask execute function is to assemble tool command line & execute\r
* tool command line\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
//\r
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
EdkLog.log(EdkLog.EDK_INFO, (new File(this.fvInputFile)).getName());\r
//\r
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
EdkLog.log(EdkLog.EDK_INFO, (new File(this.fvInputFile)).getName());\r
revl = runner.execute();\r
revl = runner.execute();\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
\r
/**\r
* getInputFile\r
\r
/**\r
* getInputFile\r
* This function is to get class member "fvInputFile".\r
* This function is to get class member "fvInputFile".\r
* @return string of input file name.\r
*/\r
public String getfvInputFile() {\r
* @return string of input file name.\r
*/\r
public String getfvInputFile() {\r
\r
/**\r
* setComponentType\r
\r
/**\r
* setComponentType\r
* This function is to set class member "fvInputFile".\r
* This function is to set class member "fvInputFile".\r
* @param inputFile\r
* string of input file name.\r
*/\r
* @param inputFile\r
* string of input file name.\r
*/\r
\r
/**\r
* getOutputFile\r
\r
/**\r
* getOutputFile\r
* This function is to get class member "fvOutputFile"\r
* This function is to get class member "fvOutputFile"\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
\r
/**\r
* setOutputFile\r
\r
/**\r
* setOutputFile\r
* This function is to set class member "fvOutputFile"\r
* This function is to set class member "fvOutputFile"\r
* @param outputFile\r
* string of output file name.\r
*/\r
* @param outputFile\r
* string of output file name.\r
*/\r
\r
/**\r
* getOutputDir\r
\r
/**\r
* getOutputDir\r
* This function is to get class member "outputDir"\r
* This function is to get class member "outputDir"\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
\r
/**\r
* setOutputDir\r
\r
/**\r
* setOutputDir\r
* This function is to set class member "outputDir"\r
* This function is to set class member "outputDir"\r
* @param outputDir\r
* string of output directory.\r
*/\r
* @param outputDir\r
* string of output directory.\r
*/\r
SecFixupTask class.\r
\r
SecFixupTask is used to call SecFixup.exe to fix up sec image.\r
SecFixupTask class.\r
\r
SecFixupTask is used to call SecFixup.exe to fix up sec image.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
* SecFixupTask class.\r
\r
/**\r
* SecFixupTask class.\r
* SecFixupTask is used to call SecFixup.exe to fix up sec image.\r
*/\r
public class SecFixupTask extends Task implements EfiDefine {\r
* SecFixupTask is used to call SecFixup.exe to fix up sec image.\r
*/\r
public class SecFixupTask extends Task implements EfiDefine {\r
* SecFixupTask execute function is to assemble tool command line & execute\r
* tool command line\r
* SecFixupTask execute function is to assemble tool command line & execute\r
* tool command line\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
\r
/**\r
* getSecExeFile\r
\r
/**\r
* getSecExeFile\r
* This function is to get class member "secExeFile".\r
* This function is to get class member "secExeFile".\r
* @return string of sectExe file name.\r
*/\r
public String getSecExeFile() {\r
* @return string of sectExe file name.\r
*/\r
public String getSecExeFile() {\r
\r
/**\r
* setSecExeFile\r
\r
/**\r
* setSecExeFile\r
* This function is to set class member "secExeFile".\r
* This function is to set class member "secExeFile".\r
* @param secExeFile\r
* string of secExe file name.\r
*/\r
* @param secExeFile\r
* string of secExe file name.\r
*/\r
\r
/**\r
* getResetVectorDataFile\r
\r
/**\r
* getResetVectorDataFile\r
* This function is to get class member "resetVectorDataFile"\r
* This function is to get class member "resetVectorDataFile"\r
* @return resetVectorDataFile string of resetVectorData file name.\r
*/\r
public String getResetVectorDataFile() {\r
* @return resetVectorDataFile string of resetVectorData file name.\r
*/\r
public String getResetVectorDataFile() {\r
\r
/**\r
* setResetVectorDataFile\r
\r
/**\r
* setResetVectorDataFile\r
* This function is to set class member "resetVectorDataFile"\r
* This function is to set class member "resetVectorDataFile"\r
* @param resetVectorDataFile\r
* string of resetVectorData file name.\r
*/\r
* @param resetVectorDataFile\r
* string of resetVectorData file name.\r
*/\r
\r
/**\r
* getOutputFile\r
\r
/**\r
* getOutputFile\r
* This function is to get class member "outputFile"\r
* This function is to get class member "outputFile"\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
\r
/**\r
* setOutputFile\r
\r
/**\r
* setOutputFile\r
* This function is to set class member "outputFile"\r
* This function is to set class member "outputFile"\r
* @param outputFile\r
* string of output file name.\r
*/\r
* @param outputFile\r
* string of output file name.\r
*/\r
\r
/**\r
* getOutputDir\r
\r
/**\r
* getOutputDir\r
* This function is to get class member "outputDir"\r
* This function is to get class member "outputDir"\r
* @return outputDir name of output directory\r
*/\r
public String getOutputDir() {\r
* @return outputDir name of output directory\r
*/\r
public String getOutputDir() {\r
\r
/**\r
* setOutputDir\r
\r
/**\r
* setOutputDir\r
* This function is to set class member "outputDir"\r
* This function is to set class member "outputDir"\r
* @param outputDir\r
* name of output directory\r
*/\r
* @param outputDir\r
* name of output directory\r
*/\r
/** @file\r
SplitfileTask class.\r
\r
/** @file\r
SplitfileTask class.\r
\r
- SplitfileTask is used to call splitfile.exe to split input file to 2 output \r
+ SplitfileTask is used to call splitfile.exe to split input file to 2 output\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
SplitfileTask class.\r
\r
\r
/**\r
SplitfileTask class.\r
\r
- SplitfileTask is used to call splitfile.exe to split input file to 2 output \r
+ SplitfileTask is used to call splitfile.exe to split input file to 2 output\r
file.\r
**/\r
public class SplitfileTask extends Task implements EfiDefine {\r
file.\r
**/\r
public class SplitfileTask extends Task implements EfiDefine {\r
///\r
private String offset = "";\r
\r
///\r
private String offset = "";\r
\r
* SplitfleTask execute function is to assemble tool command line & execute\r
* tool command line\r
* SplitfleTask execute function is to assemble tool command line & execute\r
* tool command line\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
\r
Project project = this.getOwningTarget().getProject();\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
\r
Project project = this.getOwningTarget().getProject();\r
//\r
// set Logger\r
//\r
FrameworkLogger logger = new FrameworkLogger(project, "splitfile");\r
EdkLog.setLogLevel(project.getProperty("env.LOGLEVEL"));\r
EdkLog.setLogger(logger);\r
//\r
// set Logger\r
//\r
FrameworkLogger logger = new FrameworkLogger(project, "splitfile");\r
EdkLog.setLogLevel(project.getProperty("env.LOGLEVEL"));\r
EdkLog.setLogger(logger);\r
//\r
// absolute path of efi tools\r
//\r
//\r
// absolute path of efi tools\r
//\r
} else {\r
command = path + File.separatorChar + "SplitFile";\r
}\r
} else {\r
command = path + File.separatorChar + "SplitFile";\r
}\r
//\r
// argument of tools\r
//\r
argument = inputFile + " " + offset;\r
//\r
// argument of tools\r
//\r
argument = inputFile + " " + offset;\r
//\r
// return value of fwimage execution\r
//\r
//\r
// return value of fwimage execution\r
//\r
\r
runner.setAntRun(project);\r
runner.setCommandline(cmdline.getCommandline());\r
\r
runner.setAntRun(project);\r
runner.setCommandline(cmdline.getCommandline());\r
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName());\r
revl = runner.execute();\r
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName());\r
revl = runner.execute();\r
\r
/**\r
* getInputFile\r
\r
/**\r
* getInputFile\r
* This function is to get class member "inputFile".\r
* This function is to get class member "inputFile".\r
* @return string of input file name.\r
*/\r
public String getInputFile() {\r
* @return string of input file name.\r
*/\r
public String getInputFile() {\r
\r
/**\r
* setComponentType\r
\r
/**\r
* setComponentType\r
* This function is to set class member "inputFile".\r
* This function is to set class member "inputFile".\r
* @param inputFile\r
* string of input file name.\r
*/\r
* @param inputFile\r
* string of input file name.\r
*/\r
This function is to get class member "offset"\r
This function is to get class member "offset"\r
@return offset value of string.\r
**/\r
public String getOffset() {\r
@return offset value of string.\r
**/\r
public String getOffset() {\r
This function is to set class member "offset"\r
This function is to set class member "offset"\r
@param offset\r
string of offset value.\r
**/\r
public void setOffset(String offset) {\r
this.offset = offset;\r
}\r
@param offset\r
string of offset value.\r
**/\r
public void setOffset(String offset) {\r
this.offset = offset;\r
}\r
StripTask class.\r
\r
StripTask is used to call Strip.exe to strip input file.\r
StripTask class.\r
\r
StripTask is used to call Strip.exe to strip input file.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
StripTask class.\r
\r
/**\r
StripTask class.\r
// /\r
private String outputDir = "";\r
\r
// /\r
private String outputDir = "";\r
\r
* StripTask execute function is to assemble tool command line & execute\r
* tool command line\r
* StripTask execute function is to assemble tool command line & execute\r
* tool command line\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
//\r
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName());\r
//\r
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName());\r
revl = runner.execute();\r
revl = runner.execute();\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
\r
/**\r
* getInputFile\r
\r
/**\r
* getInputFile\r
* This function is to get class member "inputFile".\r
* This function is to get class member "inputFile".\r
* @return string of input file name.\r
*/\r
public String getInputFile() {\r
* @return string of input file name.\r
*/\r
public String getInputFile() {\r
\r
/**\r
* setComponentType\r
\r
/**\r
* setComponentType\r
* This function is to set class member "inputFile".\r
* This function is to set class member "inputFile".\r
* @param inputFile\r
* string of input file name.\r
*/\r
* @param inputFile\r
* string of input file name.\r
*/\r
\r
/**\r
* getOutputFile\r
\r
/**\r
* getOutputFile\r
* This function is to get class member "outputFile"\r
* This function is to get class member "outputFile"\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
\r
/**\r
* setOutputFile\r
\r
/**\r
* setOutputFile\r
* This function is to set class member "outputFile"\r
* This function is to set class member "outputFile"\r
* @param outputFile\r
* string of output file name.\r
*/\r
* @param outputFile\r
* string of output file name.\r
*/\r
\r
/**\r
* getOutputDir\r
\r
/**\r
* getOutputDir\r
* This function is to get class member "outputDir"\r
* This function is to get class member "outputDir"\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
\r
/**\r
* setOutputDir\r
\r
/**\r
* setOutputDir\r
* This function is to set class member "outputDir"\r
* This function is to set class member "outputDir"\r
* @param outputDir\r
* string of output directory.\r
*/\r
* @param outputDir\r
* string of output directory.\r
*/\r
ZeroDebugDataTask class.\r
\r
ZeroDebugDataTask is used to call ZeroDebugData.exe to remove debug data.\r
ZeroDebugDataTask class.\r
\r
ZeroDebugDataTask is used to call ZeroDebugData.exe to remove debug data.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
ZeroDebugDataTask class.\r
\r
/**\r
ZeroDebugDataTask class.\r
* ZeroDebugDataTask execute function is to assemble tool command line & execute\r
* tool command line\r
* ZeroDebugDataTask execute function is to assemble tool command line & execute\r
* tool command line\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
EdkLog.log(EdkLog.EDK_INFO, (new File(this.peFile)).getName());\r
\r
revl = runner.execute();\r
EdkLog.log(EdkLog.EDK_INFO, (new File(this.peFile)).getName());\r
\r
revl = runner.execute();\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
* This function is to get class member "inputFile".\r
* This function is to get class member "inputFile".\r
* @return string of input file name.\r
*/\r
public String getPeFile() {\r
* @return string of input file name.\r
*/\r
public String getPeFile() {\r
* This function is to set class member "peFile".\r
* This function is to set class member "peFile".\r
* @param peFile\r
* string of input file name.\r
*/\r
* @param peFile\r
* string of input file name.\r
*/\r
\r
/**\r
* getOutputFile\r
\r
/**\r
* getOutputFile\r
* This function is to get class member "outputFile"\r
* This function is to get class member "outputFile"\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
* @return outputFile string of output file name.\r
*/\r
public String getOutputFile() {\r
\r
/**\r
* setOutputFile\r
\r
/**\r
* setOutputFile\r
* This function is to set class member "outputFile"\r
* This function is to set class member "outputFile"\r
* @param outputFile\r
* string of output file name.\r
*/\r
* @param outputFile\r
* string of output file name.\r
*/\r
\r
/**\r
* getOutputDir\r
\r
/**\r
* getOutputDir\r
* This function is to get class member "outputDir"\r
* This function is to get class member "outputDir"\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
* @return outputDir string of output directory.\r
*/\r
public String getOutputDir() {\r
\r
/**\r
* setOutputDir\r
\r
/**\r
* setOutputDir\r
* This function is to set class member "outputDir"\r
* This function is to set class member "outputDir"\r
* @param outputDir\r
* string of output directory.\r
*/\r
* @param outputDir\r
* string of output directory.\r
*/\r
- This file is ANT task GenBuild. \r
- \r
- The file is used to parse a specified Module, and generate its build time \r
+ This file is ANT task GenBuild.\r
+\r
+ The file is used to parse a specified Module, and generate its build time\r
ANT script build.xml, then call the the ANT script to build the module.\r
ANT script build.xml, then call the the ANT script to build the module.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
import org.apache.tools.ant.taskdefs.Property;\r
import org.apache.xmlbeans.XmlObject;\r
\r
import org.apache.tools.ant.taskdefs.Property;\r
import org.apache.xmlbeans.XmlObject;\r
\r
+import org.tianocore.common.exception.EdkException;\r
+import org.tianocore.common.logger.EdkLog;\r
import org.tianocore.build.autogen.AutoGen;\r
import org.tianocore.build.fpd.FpdParserTask;\r
import org.tianocore.build.global.GenBuildLogger;\r
import org.tianocore.build.autogen.AutoGen;\r
import org.tianocore.build.fpd.FpdParserTask;\r
import org.tianocore.build.global.GenBuildLogger;\r
import org.tianocore.build.id.PackageIdentification;\r
import org.tianocore.build.id.PlatformIdentification;\r
import org.tianocore.build.tools.ModuleItem;\r
import org.tianocore.build.id.PackageIdentification;\r
import org.tianocore.build.id.PlatformIdentification;\r
import org.tianocore.build.tools.ModuleItem;\r
-import org.tianocore.exception.EdkException;\r
-import org.tianocore.logger.EdkLog;\r
system. The main function of this task is to parse module's surface area,\r
then generate the corresponding <em>BaseName_build.xml</em> (the real ANT\r
build script) and call this to build the module. The whole process including:\r
system. The main function of this task is to parse module's surface area,\r
then generate the corresponding <em>BaseName_build.xml</em> (the real ANT\r
build script) and call this to build the module. The whole process including:\r
- 1. generate AutoGen.c and AutoGen.h; 2. build all dependent library instances; \r
+ 1. generate AutoGen.c and AutoGen.h; 2. build all dependent library instances;\r
3. build all source files inlcude AutoGen.c; 4. generate sections;\r
3. build all source files inlcude AutoGen.c; 4. generate sections;\r
- 5. generate FFS file if it is driver module while LIB file if it is Library module. \r
+ 5. generate FFS file if it is driver module while LIB file if it is Library module.\r
<p>\r
The usage is (take module <em>HelloWorld</em> for example):\r
</p>\r
<p>\r
The usage is (take module <em>HelloWorld</em> for example):\r
</p>\r
- <GenBuild \r
- msaFilename="HelloWorld.msa"/> \r
+ <GenBuild\r
+ msaFilename="HelloWorld.msa"/>\r
processTo="ALL"/>\r
</pre>\r
processTo="ALL"/>\r
</pre>\r
- \r
- <p><code>processTo</code> provides a way to customize the whole build process. \r
- processTo can be one value of ALL, AUTOGEN, FILES, LIBRARYINSTANCES, SECTIONS, NONE. \r
- Default is ALL, means whole \r
+\r
+ <p><code>processTo</code> provides a way to customize the whole build process.\r
+ processTo can be one value of ALL, AUTOGEN, FILES, LIBRARYINSTANCES, SECTIONS, NONE.\r
+ Default is ALL, means whole\r
<p>\r
This task calls <code>AutoGen</code> to generate <em>AutoGen.c</em> and\r
<em>AutoGen.h</em>. The task also parses the development environment\r
configuration files, such as collecting package information, setting compiler\r
flags and so on.\r
</p>\r
<p>\r
This task calls <code>AutoGen</code> to generate <em>AutoGen.c</em> and\r
<em>AutoGen.h</em>. The task also parses the development environment\r
configuration files, such as collecting package information, setting compiler\r
flags and so on.\r
</p>\r
@since GenBuild 1.0\r
**/\r
public class GenBuildTask extends Ant {\r
@since GenBuild 1.0\r
**/\r
public class GenBuildTask extends Ant {\r
///\r
/// Module surface area file.\r
///\r
File msaFile;\r
\r
///\r
///\r
/// Module surface area file.\r
///\r
File msaFile;\r
\r
///\r
///\r
private String type = "all"; // = "build";\r
///\r
private String type = "all"; // = "build";\r
///\r
/// Module's Identification.\r
///\r
///\r
/// Module's Identification.\r
///\r
private Vector<Property> properties = new Vector<Property>();\r
\r
private static Stack<Hashtable> backupPropertiesStack = new Stack<Hashtable>();\r
private Vector<Property> properties = new Vector<Property>();\r
\r
private static Stack<Hashtable> backupPropertiesStack = new Stack<Hashtable>();\r
private boolean isSingleModuleBuild = false;\r
private boolean isSingleModuleBuild = false;\r
/**\r
Public construct method. It is necessary for ANT task.\r
**/\r
/**\r
Public construct method. It is necessary for ANT task.\r
**/\r
@throws BuildException\r
From module build, exception from module surface area invalid.\r
**/\r
@throws BuildException\r
From module build, exception from module surface area invalid.\r
**/\r
Property item = iter.next();\r
getProject().setProperty(item.getName(), item.getValue());\r
}\r
Property item = iter.next();\r
getProject().setProperty(item.getName(), item.getValue());\r
}\r
//\r
// GenBuild should specify either msaFile or moduleGuid & packageGuid\r
//\r
//\r
// GenBuild should specify either msaFile or moduleGuid & packageGuid\r
//\r
else {\r
moduleId.setLibrary(true);\r
}\r
else {\r
moduleId.setLibrary(true);\r
}\r
//\r
// Judge whether it is single module build or not\r
//\r
//\r
// Judge whether it is single module build or not\r
//\r
PlatformIdentification platformId = GlobalData.getPlatform(filename);\r
getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));\r
getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));\r
PlatformIdentification platformId = GlobalData.getPlatform(filename);\r
getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));\r
getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));\r
String packageGuid = getProject().getProperty("PACKAGE_GUID");\r
String packageVersion = getProject().getProperty("PACKAGE_VERSION");\r
PackageIdentification packageId = new PackageIdentification(packageGuid, packageVersion);\r
moduleId.setPackage(packageId);\r
}\r
String packageGuid = getProject().getProperty("PACKAGE_GUID");\r
String packageVersion = getProject().getProperty("PACKAGE_VERSION");\r
PackageIdentification packageId = new PackageIdentification(packageGuid, packageVersion);\r
moduleId.setPackage(packageId);\r
}\r
//\r
// If single module : intersection MSA supported ARCHs and tools def!!\r
// else, get arch from pass down\r
//\r
//\r
// If single module : intersection MSA supported ARCHs and tools def!!\r
// else, get arch from pass down\r
//\r
- Set<String> archListSupByToolChain = new LinkedHashSet<String>(); \r
- String[] archs = GlobalData.getToolChainInfo().getArchs(); \r
- \r
+ Set<String> archListSupByToolChain = new LinkedHashSet<String>();\r
+ String[] archs = GlobalData.getToolChainInfo().getArchs();\r
+\r
for (int i = 0; i < archs.length; i ++) {\r
archListSupByToolChain.add(archs[i]);\r
}\r
for (int i = 0; i < archs.length; i ++) {\r
archListSupByToolChain.add(archs[i]);\r
}\r
Set<String> archSet = new LinkedHashSet<String>();\r
Set<String> archSet = new LinkedHashSet<String>();\r
if ( getProject().getProperty("ARCH") != null) {\r
String[] fpdArchList = getProject().getProperty("ARCH").split(" ");\r
if ( getProject().getProperty("ARCH") != null) {\r
String[] fpdArchList = getProject().getProperty("ARCH").split(" ");\r
for (int i = 0; i < fpdArchList.length; i++) {\r
if (archListSupByToolChain.contains(fpdArchList[i])) {\r
archSet.add(fpdArchList[i]);\r
for (int i = 0; i < fpdArchList.length; i++) {\r
if (archListSupByToolChain.contains(fpdArchList[i])) {\r
archSet.add(fpdArchList[i]);\r
- archSet = archListSupByToolChain; \r
+ archSet = archListSupByToolChain;\r
String[] archList = archSet.toArray(new String[archSet.size()]);\r
String[] archList = archSet.toArray(new String[archSet.size()]);\r
//\r
// Judge if arch is all supported by current module. If not, throw Exception.\r
//\r
//\r
// Judge if arch is all supported by current module. If not, throw Exception.\r
//\r
for (int k = 0; k < archList.length; k++) {\r
for (int k = 0; k < archList.length; k++) {\r
getProject().setProperty("ARCH", archList[k]);\r
getProject().setProperty("ARCH", archList[k]);\r
FpdModuleIdentification fpdModuleId = new FpdModuleIdentification(moduleId, archList[k]);\r
FpdModuleIdentification fpdModuleId = new FpdModuleIdentification(moduleId, archList[k]);\r
//\r
// Whether the module is built before\r
//\r
//\r
// Whether the module is built before\r
//\r
} else {\r
GlobalData.registerBuiltModule(fpdModuleId);\r
}\r
} else {\r
GlobalData.registerBuiltModule(fpdModuleId);\r
}\r
//\r
// For Every TOOLCHAIN, TARGET\r
//\r
//\r
// For Every TOOLCHAIN, TARGET\r
//\r
//\r
// check if any tool is defined for current target + toolchain + arch\r
// don't do anything if no tools found\r
//\r
// check if any tool is defined for current target + toolchain + arch\r
// don't do anything if no tools found\r
if (GlobalData.isCommandSet(targetList[i], toolchainList[j], archList[k]) == false) {\r
System.out.println("Warning: No build issued. No tools were found for [target=" + targetList[i] + " toolchain=" + toolchainList[j] + " arch=" + archList[k] + "]\n");\r
continue;\r
if (GlobalData.isCommandSet(targetList[i], toolchainList[j], archList[k]) == false) {\r
System.out.println("Warning: No build issued. No tools were found for [target=" + targetList[i] + " toolchain=" + toolchainList[j] + " arch=" + archList[k] + "]\n");\r
continue;\r
System.out.println("Build " + moduleId + " start >>>");\r
System.out.println("Target: " + targetList[i] + " Tagname: " + toolchainList[j] + " Arch: " + archList[k]);\r
SurfaceAreaQuery.setDoc(GlobalData.getDoc(fpdModuleId));\r
System.out.println("Build " + moduleId + " start >>>");\r
System.out.println("Target: " + targetList[i] + " Tagname: " + toolchainList[j] + " Arch: " + archList[k]);\r
SurfaceAreaQuery.setDoc(GlobalData.getDoc(fpdModuleId));\r
//\r
// Prepare for all other common properties\r
// PACKAGE, PACKAGE_GUID, PACKAGE_VERSION, PACKAGE_DIR, PACKAGE_RELATIVE_DIR\r
//\r
// Prepare for all other common properties\r
// PACKAGE, PACKAGE_GUID, PACKAGE_VERSION, PACKAGE_DIR, PACKAGE_RELATIVE_DIR\r
// SUBSYSTEM, ENTRYPOINT, EBC_TOOL_LIB_PATH\r
//\r
setModuleCommonProperties(archList[k]);\r
// SUBSYSTEM, ENTRYPOINT, EBC_TOOL_LIB_PATH\r
//\r
setModuleCommonProperties(archList[k]);\r
- // OutputManage prepare for \r
+ // OutputManage prepare for\r
// BIN_DIR, DEST_DIR_DEBUG, DEST_DIR_OUTPUT, BUILD_DIR, FV_DIR\r
//\r
OutputManager.getInstance().update(getProject());\r
// BIN_DIR, DEST_DIR_DEBUG, DEST_DIR_OUTPUT, BUILD_DIR, FV_DIR\r
//\r
OutputManager.getInstance().update(getProject());\r
if (type.equalsIgnoreCase("all") || type.equalsIgnoreCase("build")) {\r
applyBuild(targetList[i], toolchainList[j], fpdModuleId);\r
}\r
if (type.equalsIgnoreCase("all") || type.equalsIgnoreCase("build")) {\r
applyBuild(targetList[i], toolchainList[j], fpdModuleId);\r
}\r
- This method is used to prepare Platform-related information. \r
- \r
+ This method is used to prepare Platform-related information.\r
+\r
<p>In Single Module Build mode, platform-related information is not ready.\r
<p>In Single Module Build mode, platform-related information is not ready.\r
- The method read the system environment variable <code>ACTIVE_PLATFORM</code> \r
+ The method read the system environment variable <code>ACTIVE_PLATFORM</code>\r
and search in the Framework Database. Note that platform name in the Framework\r
Database must be unique. </p>\r
and search in the Framework Database. Note that platform name in the Framework\r
Database must be unique. </p>\r
**/\r
private void prepareSingleModuleBuild(){\r
//\r
**/\r
private void prepareSingleModuleBuild(){\r
//\r
// TBD: Enhance it!!!!\r
//\r
PackageIdentification packageId = GlobalData.getPackageForModule(moduleId);\r
// TBD: Enhance it!!!!\r
//\r
PackageIdentification packageId = GlobalData.getPackageForModule(moduleId);\r
moduleId.setPackage(packageId);\r
moduleId.setPackage(packageId);\r
//\r
// Read ACTIVE_PLATFORM's FPD file (Call FpdParserTask's method)\r
//\r
String filename = getProject().getProperty("PLATFORM_FILE");\r
//\r
// Read ACTIVE_PLATFORM's FPD file (Call FpdParserTask's method)\r
//\r
String filename = getProject().getProperty("PLATFORM_FILE");\r
if (filename == null){\r
throw new BuildException("Please set ACTIVE_PLATFORM in the file: Tools/Conf/target.txt if you want to build a single module!");\r
}\r
if (filename == null){\r
throw new BuildException("Please set ACTIVE_PLATFORM in the file: Tools/Conf/target.txt if you want to build a single module!");\r
}\r
PlatformIdentification platformId = GlobalData.getPlatform(filename);\r
PlatformIdentification platformId = GlobalData.getPlatform(filename);\r
//\r
// Read FPD file\r
//\r
FpdParserTask fpdParser = new FpdParserTask();\r
fpdParser.setProject(getProject());\r
fpdParser.parseFpdFile(platformId.getFpdFile());\r
//\r
// Read FPD file\r
//\r
FpdParserTask fpdParser = new FpdParserTask();\r
fpdParser.setProject(getProject());\r
fpdParser.parseFpdFile(platformId.getFpdFile());\r
//\r
// Prepare for Platform related common properties\r
// PLATFORM, PLATFORM_DIR, PLATFORM_RELATIVE_DIR\r
//\r
// Prepare for Platform related common properties\r
// PLATFORM, PLATFORM_DIR, PLATFORM_RELATIVE_DIR\r
getProject().setProperty("PACKAGE_VERSION", packageId.getVersion());\r
getProject().setProperty("PACKAGE_DIR", packageId.getPackageDir().replaceAll("(\\\\)", "/"));\r
getProject().setProperty("PACKAGE_RELATIVE_DIR", packageId.getPackageRelativeDir().replaceAll("(\\\\)", "/"));\r
getProject().setProperty("PACKAGE_VERSION", packageId.getVersion());\r
getProject().setProperty("PACKAGE_DIR", packageId.getPackageDir().replaceAll("(\\\\)", "/"));\r
getProject().setProperty("PACKAGE_RELATIVE_DIR", packageId.getPackageRelativeDir().replaceAll("(\\\\)", "/"));\r
//\r
// MODULE or BASE_NAME, GUID or FILE_GUID, VERSION, MODULE_TYPE\r
// MODULE_DIR, MODULE_RELATIVE_DIR\r
//\r
// MODULE or BASE_NAME, GUID or FILE_GUID, VERSION, MODULE_TYPE\r
// MODULE_DIR, MODULE_RELATIVE_DIR\r
getProject().setProperty("MODULE_TYPE", moduleId.getModuleType());\r
getProject().setProperty("MODULE_DIR", moduleId.getMsaFile().getParent().replaceAll("(\\\\)", "/"));\r
getProject().setProperty("MODULE_RELATIVE_DIR", moduleId.getModuleRelativePath().replaceAll("(\\\\)", "/"));\r
getProject().setProperty("MODULE_TYPE", moduleId.getModuleType());\r
getProject().setProperty("MODULE_DIR", moduleId.getMsaFile().getParent().replaceAll("(\\\\)", "/"));\r
getProject().setProperty("MODULE_RELATIVE_DIR", moduleId.getModuleRelativePath().replaceAll("(\\\\)", "/"));\r
//\r
// SUBSYSTEM\r
//\r
String[][] subsystemMap = { { "BASE", "EFI_BOOT_SERVICE_DRIVER"},\r
//\r
// SUBSYSTEM\r
//\r
String[][] subsystemMap = { { "BASE", "EFI_BOOT_SERVICE_DRIVER"},\r
- { "SEC", "EFI_BOOT_SERVICE_DRIVER" }, \r
- { "PEI_CORE", "EFI_BOOT_SERVICE_DRIVER" }, \r
- { "PEIM", "EFI_BOOT_SERVICE_DRIVER" }, \r
+ { "SEC", "EFI_BOOT_SERVICE_DRIVER" },\r
+ { "PEI_CORE", "EFI_BOOT_SERVICE_DRIVER" },\r
+ { "PEIM", "EFI_BOOT_SERVICE_DRIVER" },\r
{ "DXE_CORE", "EFI_BOOT_SERVICE_DRIVER" },\r
{ "DXE_CORE", "EFI_BOOT_SERVICE_DRIVER" },\r
- { "DXE_DRIVER", "EFI_BOOT_SERVICE_DRIVER" }, \r
- { "DXE_RUNTIME_DRIVER", "EFI_RUNTIME_DRIVER" }, \r
- { "DXE_SAL_DRIVER", "EFI_BOOT_SERVICE_DRIVER" }, \r
- { "DXE_SMM_DRIVER", "EFI_BOOT_SERVICE_DRIVER" }, \r
- { "TOOL", "EFI_BOOT_SERVICE_DRIVER" }, \r
+ { "DXE_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },\r
+ { "DXE_RUNTIME_DRIVER", "EFI_RUNTIME_DRIVER" },\r
+ { "DXE_SAL_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },\r
+ { "DXE_SMM_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },\r
+ { "TOOL", "EFI_BOOT_SERVICE_DRIVER" },\r
{ "UEFI_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },\r
{ "UEFI_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },\r
- { "UEFI_APPLICATION", "EFI_APPLICATION" }, \r
- { "USER_DEFINED", "EFI_BOOT_SERVICE_DRIVER"} }; \r
- \r
+ { "UEFI_APPLICATION", "EFI_APPLICATION" },\r
+ { "USER_DEFINED", "EFI_BOOT_SERVICE_DRIVER"} };\r
+\r
String subsystem = "EFI_BOOT_SERVICE_DRIVER";\r
for (int i = 0; i < subsystemMap.length; i++) {\r
if (moduleId.getModuleType().equalsIgnoreCase(subsystemMap[i][0])) {\r
String subsystem = "EFI_BOOT_SERVICE_DRIVER";\r
for (int i = 0; i < subsystemMap.length; i++) {\r
if (moduleId.getModuleType().equalsIgnoreCase(subsystemMap[i][0])) {\r
}\r
}\r
getProject().setProperty("SUBSYSTEM", subsystem);\r
}\r
}\r
getProject().setProperty("SUBSYSTEM", subsystem);\r
//\r
// ENTRYPOINT\r
//\r
//\r
// ENTRYPOINT\r
//\r
else {\r
getProject().setProperty("ENTRYPOINT", "_ModuleEntryPoint");\r
}\r
else {\r
getProject().setProperty("ENTRYPOINT", "_ModuleEntryPoint");\r
}\r
getProject().setProperty("OBJECTS", "");\r
}\r
\r
getProject().setProperty("OBJECTS", "");\r
}\r
\r
String cmdName = GlobalData.getCommandSetting(key, fpdModuleId);\r
File cmdFile = new File(cmdPath + File.separatorChar + cmdName);\r
getProject().setProperty(cmd[m], cmdFile.getPath().replaceAll("(\\\\)", "/"));\r
String cmdName = GlobalData.getCommandSetting(key, fpdModuleId);\r
File cmdFile = new File(cmdPath + File.separatorChar + cmdName);\r
getProject().setProperty(cmd[m], cmdFile.getPath().replaceAll("(\\\\)", "/"));\r
//\r
// set CC_FLAGS\r
//\r
//\r
// set CC_FLAGS\r
//\r
Set<String> subset = new LinkedHashSet<String>();\r
putFlagsToSet(addset, cmdFlags);\r
getProject().setProperty(cmd[m] + "_FLAGS", getProject().replaceProperties(getFlags(addset, subset)));\r
Set<String> subset = new LinkedHashSet<String>();\r
putFlagsToSet(addset, cmdFlags);\r
getProject().setProperty(cmd[m] + "_FLAGS", getProject().replaceProperties(getFlags(addset, subset)));\r
//\r
// Set CC_EXT\r
//\r
//\r
// Set CC_EXT\r
//\r
else {\r
getProject().setProperty(cmd[m] + "_EXT", "");\r
}\r
else {\r
getProject().setProperty(cmd[m] + "_EXT", "");\r
}\r
//\r
// set CC_FAMILY\r
//\r
//\r
// set CC_FAMILY\r
//\r
if (toolChainFamily != null) {\r
getProject().setProperty(cmd[m] + "_FAMILY", toolChainFamily);\r
}\r
if (toolChainFamily != null) {\r
getProject().setProperty(cmd[m] + "_FAMILY", toolChainFamily);\r
}\r
//\r
// set CC_SPATH\r
//\r
//\r
// set CC_SPATH\r
//\r
else {\r
getProject().setProperty(cmd[m] + "_SPATH", "");\r
}\r
else {\r
getProject().setProperty(cmd[m] + "_SPATH", "");\r
}\r
//\r
// set CC_DPATH\r
//\r
//\r
// set CC_DPATH\r
//\r
public void setMsaFile(File msaFile) {\r
this.msaFile = msaFile;\r
}\r
\r
/**\r
public void setMsaFile(File msaFile) {\r
this.msaFile = msaFile;\r
}\r
\r
/**\r
- Method is for ANT to initialize MSA file. \r
- \r
+ Method is for ANT to initialize MSA file.\r
+\r
@param msaFilename MSA file name\r
**/\r
public void setMsaFile(String msaFilename) {\r
String moduleDir = getProject().getProperty("MODULE_DIR");\r
@param msaFilename MSA file name\r
**/\r
public void setMsaFile(String msaFilename) {\r
String moduleDir = getProject().getProperty("MODULE_DIR");\r
//\r
// If is Single Module Build, then use the Base Dir defined in build.xml\r
//\r
//\r
// If is Single Module Build, then use the Base Dir defined in build.xml\r
//\r
}\r
msaFile = new File(moduleDir + File.separatorChar + msaFilename);\r
}\r
}\r
msaFile = new File(moduleDir + File.separatorChar + msaFilename);\r
}\r
public void addConfiguredModuleItem(ModuleItem moduleItem) {\r
PackageIdentification packageId = new PackageIdentification(moduleItem.getPackageGuid(), moduleItem.getPackageVersion());\r
ModuleIdentification moduleId = new ModuleIdentification(moduleItem.getModuleGuid(), moduleItem.getModuleVersion());\r
moduleId.setPackage(packageId);\r
this.moduleId = moduleId;\r
}\r
public void addConfiguredModuleItem(ModuleItem moduleItem) {\r
PackageIdentification packageId = new PackageIdentification(moduleItem.getPackageGuid(), moduleItem.getPackageVersion());\r
ModuleIdentification moduleId = new ModuleIdentification(moduleItem.getModuleGuid(), moduleItem.getModuleVersion());\r
moduleId.setPackage(packageId);\r
this.moduleId = moduleId;\r
}\r
- Add a property. \r
- \r
@param p property\r
**/\r
public void addProperty(Property p) {\r
@param p property\r
**/\r
public void addProperty(Property p) {\r
public void setType(String type) {\r
this.type = type;\r
}\r
public void setType(String type) {\r
this.type = type;\r
}\r
private void applyBuild(String buildTarget, String buildTagname, FpdModuleIdentification fpdModuleId) throws EdkException{\r
//\r
// AutoGen\r
//\r
private void applyBuild(String buildTarget, String buildTagname, FpdModuleIdentification fpdModuleId) throws EdkException{\r
//\r
// AutoGen\r
//\r
AutoGen autogen = new AutoGen(getProject().getProperty("FV_DIR"), getProject().getProperty("DEST_DIR_DEBUG"), fpdModuleId.getModule(),fpdModuleId.getArch());\r
autogen.genAutogen();\r
AutoGen autogen = new AutoGen(getProject().getProperty("FV_DIR"), getProject().getProperty("DEST_DIR_DEBUG"), fpdModuleId.getModule(),fpdModuleId.getArch());\r
autogen.genAutogen();\r
//\r
// Get compiler flags\r
//\r
getCompilerFlags(buildTarget, buildTagname, fpdModuleId);\r
//\r
// Get compiler flags\r
//\r
getCompilerFlags(buildTarget, buildTagname, fpdModuleId);\r
//\r
// Prepare LIBS\r
//\r
//\r
// Prepare LIBS\r
//\r
propertyLibs += " " + getProject().getProperty("BIN_DIR") + File.separatorChar + libinstances[i].getName() + ".lib";\r
}\r
getProject().setProperty("LIBS", propertyLibs.replaceAll("(\\\\)", "/"));\r
propertyLibs += " " + getProject().getProperty("BIN_DIR") + File.separatorChar + libinstances[i].getName() + ".lib";\r
}\r
getProject().setProperty("LIBS", propertyLibs.replaceAll("(\\\\)", "/"));\r
//\r
// if it is CUSTOM_BUILD\r
// then call the exist BaseName_build.xml directly.\r
//\r
// if it is CUSTOM_BUILD\r
// then call the exist BaseName_build.xml directly.\r
ant.execute();\r
return ;\r
}\r
ant.execute();\r
return ;\r
}\r
//\r
// Generate ${BASE_NAME}_build.xml\r
// TBD\r
//\r
// Generate ${BASE_NAME}_build.xml\r
// TBD\r
ModuleBuildFileGenerator fileGenerator = new ModuleBuildFileGenerator(getProject(), ffsKeyword, fpdModuleId);\r
String buildFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml";\r
fileGenerator.genBuildFile(buildFilename);\r
ModuleBuildFileGenerator fileGenerator = new ModuleBuildFileGenerator(getProject(), ffsKeyword, fpdModuleId);\r
String buildFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml";\r
fileGenerator.genBuildFile(buildFilename);\r
//\r
// Ant call ${BASE_NAME}_build.xml\r
//\r
//\r
// Ant call ${BASE_NAME}_build.xml\r
//\r
ant.init();\r
ant.execute();\r
}\r
ant.init();\r
ant.execute();\r
}\r
private void applyClean(FpdModuleIdentification fpdModuleId){\r
//\r
// if it is CUSTOM_BUILD\r
private void applyClean(FpdModuleIdentification fpdModuleId){\r
//\r
// if it is CUSTOM_BUILD\r
ant.execute();\r
return ;\r
}\r
ant.execute();\r
return ;\r
}\r
Ant ant = new Ant();\r
ant.setProject(getProject());\r
ant.setAntfile(getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml");\r
Ant ant = new Ant();\r
ant.setProject(getProject());\r
ant.setAntfile(getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml");\r
ant.setInheritAll(true);\r
ant.init();\r
ant.execute();\r
ant.setInheritAll(true);\r
ant.init();\r
ant.execute();\r
//\r
// Delete current module's DEST_DIR_OUTPUT\r
// TBD\r
}\r
//\r
// Delete current module's DEST_DIR_OUTPUT\r
// TBD\r
}\r
private void applyCleanall(FpdModuleIdentification fpdModuleId){\r
//\r
// if it is CUSTOM_BUILD\r
private void applyCleanall(FpdModuleIdentification fpdModuleId){\r
//\r
// if it is CUSTOM_BUILD\r
ant.execute();\r
return ;\r
}\r
ant.execute();\r
return ;\r
}\r
Ant ant = new Ant();\r
ant.setProject(getProject());\r
ant.setAntfile(getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml");\r
Ant ant = new Ant();\r
ant.setProject(getProject());\r
ant.setAntfile(getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml");\r
ant.setInheritAll(true);\r
ant.init();\r
ant.execute();\r
ant.setInheritAll(true);\r
ant.init();\r
ant.execute();\r
//\r
// Delete current module's DEST_DIR_OUTPUT\r
// TBD\r
//\r
// Delete current module's DEST_DIR_OUTPUT\r
// TBD\r
\r
/**\r
Separate the string and instore in set.\r
\r
/**\r
Separate the string and instore in set.\r
- \r
- <p> String is separated by Java Regulation Expression \r
+\r
+ <p> String is separated by Java Regulation Expression\r
"[^\\\\]?(\".*?[^\\\\]\")[ \t,]+". </p>\r
"[^\\\\]?(\".*?[^\\\\]\")[ \t,]+". </p>\r
<pre>\r
"/nologo", "/W3", "/WX"\r
"/C", "/DSTRING_DEFINES_FILE=\"BdsStrDefs.h\""\r
</pre>\r
<pre>\r
"/nologo", "/W3", "/WX"\r
"/C", "/DSTRING_DEFINES_FILE=\"BdsStrDefs.h\""\r
</pre>\r
@param set store the separated string\r
@param str string to separate\r
**/\r
@param set store the separated string\r
@param str string to separate\r
**/\r
- Generate the final flags string will be used by compile command. \r
- \r
+ Generate the final flags string will be used by compile command.\r
+\r
@param add the add flags set\r
@param sub the sub flags set\r
@return final flags after add set substract sub set\r
@param add the add flags set\r
@param sub the sub flags set\r
@return final flags after add set substract sub set\r
private void pushProperties() {\r
backupPropertiesStack.push(getProject().getProperties());\r
}\r
private void pushProperties() {\r
backupPropertiesStack.push(getProject().getProperties());\r
}\r
private void popProperties() {\r
Hashtable backupProperties = backupPropertiesStack.pop();\r
Set keys = backupProperties.keySet();\r
private void popProperties() {\r
Hashtable backupProperties = backupPropertiesStack.pop();\r
Set keys = backupProperties.keySet();\r
\r
This class is to generate Autogen.h and Autogen.c according to module surface area\r
or library surface area.\r
\r
This class is to generate Autogen.h and Autogen.c according to module surface area\r
or library surface area.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.tianocore.build.id.ModuleIdentification;\r
import org.tianocore.build.id.PackageIdentification;\r
import org.tianocore.build.pcd.action.PCDAutoGenAction;\r
import org.tianocore.build.id.ModuleIdentification;\r
import org.tianocore.build.id.PackageIdentification;\r
import org.tianocore.build.pcd.action.PCDAutoGenAction;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
* This class is to generate Autogen.h and Autogen.c according to module surface\r
\r
/**\r
* This class is to generate Autogen.h and Autogen.c according to module surface\r
// / The output path of Autogen.h and Autogen.c\r
// /\r
private String outputPath;\r
// / The output path of Autogen.h and Autogen.c\r
// /\r
private String outputPath;\r
- /// \r
- /// The name of FV directory \r
- /// \r
+ ///\r
+ /// The name of FV directory\r
+ ///\r
private String fvDir;\r
// /\r
// / The base name of module or library.\r
private String fvDir;\r
// /\r
// / The base name of module or library.\r
// / dependence on library instance surface area.\r
// /\r
private Set<String> mGuidList = new HashSet<String>();\r
// / dependence on library instance surface area.\r
// /\r
private Set<String> mGuidList = new HashSet<String>();\r
//\r
// The dependence package list which recoreded in module or library surface\r
// area and it's dependence on library instance surface are.\r
//\r
// The dependence package list which recoreded in module or library surface\r
// area and it's dependence on library instance surface are.\r
private List<PackageIdentification> mDepPkgList = new LinkedList<PackageIdentification>();\r
\r
//\r
private List<PackageIdentification> mDepPkgList = new LinkedList<PackageIdentification>();\r
\r
//\r
- // For non library module, add its library instance's construct and destructor to \r
+ // For non library module, add its library instance's construct and destructor to\r
private List<String> libConstructList = new ArrayList<String>();\r
private List<String> libDestructList = new ArrayList<String>();\r
\r
//\r
private List<String> libConstructList = new ArrayList<String>();\r
private List<String> libDestructList = new ArrayList<String>();\r
\r
//\r
- // List to store SetVirtalAddressMapCallBack, ExitBootServiceCallBack \r
- // \r
+ // List to store SetVirtalAddressMapCallBack, ExitBootServiceCallBack\r
+ //\r
private List<String> setVirtalAddList = new ArrayList<String>();\r
private List<String> exitBootServiceList = new ArrayList<String>();\r
\r
private List<String> setVirtalAddList = new ArrayList<String>();\r
private List<String> exitBootServiceList = new ArrayList<String>();\r
\r
/**\r
* Construct function\r
/**\r
* Construct function\r
* This function mainly initialize some member variable.\r
* This function mainly initialize some member variable.\r
* @param outputPath\r
* Output path of AutoGen file.\r
* @param baseName\r
* @param outputPath\r
* Output path of AutoGen file.\r
* @param baseName\r
\r
/**\r
* saveFile function\r
\r
/**\r
* saveFile function\r
* This function save the content in stringBuffer to file.\r
* This function save the content in stringBuffer to file.\r
* @param fileName\r
* The name of file.\r
* @param fileBuffer\r
* @param fileName\r
* The name of file.\r
* @param fileBuffer\r
\r
/**\r
* genAutogen function\r
\r
/**\r
* genAutogen function\r
* This function call libGenAutoGen or moduleGenAutogen function, which\r
* dependence on generate library autogen or module autogen.\r
* This function call libGenAutoGen or moduleGenAutogen function, which\r
* dependence on generate library autogen or module autogen.\r
* @throws BuildException\r
* Failed to creat AutoGen.c & AutoGen.h.\r
*/\r
* @throws BuildException\r
* Failed to creat AutoGen.c & AutoGen.h.\r
*/\r
\r
/**\r
* moduleGenAutogen function\r
\r
/**\r
* moduleGenAutogen function\r
* This function generates AutoGen.c & AutoGen.h for module.\r
* This function generates AutoGen.c & AutoGen.h for module.\r
* @throws BuildException\r
* Faile to create module AutoGen.c & AutoGen.h.\r
*/\r
* @throws BuildException\r
* Faile to create module AutoGen.c & AutoGen.h.\r
*/\r
\r
/**\r
* libGenAutogen function\r
\r
/**\r
* libGenAutogen function\r
* This function generates AutoGen.c & AutoGen.h for library.\r
* This function generates AutoGen.c & AutoGen.h for library.\r
* @throws BuildException\r
* Faile to create library AutoGen.c & AutoGen.h\r
*/\r
* @throws BuildException\r
* Faile to create library AutoGen.c & AutoGen.h\r
*/\r
\r
/**\r
* moduleGenAutogenH\r
\r
/**\r
* moduleGenAutogenH\r
* This function generates AutoGen.h for module.\r
* This function generates AutoGen.h for module.\r
* @throws BuildException\r
* Failed to generate AutoGen.h.\r
*/\r
* @throws BuildException\r
* Failed to generate AutoGen.h.\r
*/\r
fileBuffer.append("\r\n");\r
\r
//\r
fileBuffer.append("\r\n");\r
\r
//\r
- // If is TianoR8FlashMap, copy {Fv_DIR}/FlashMap.h to \r
+ // If is TianoR8FlashMap, copy {Fv_DIR}/FlashMap.h to\r
// {DEST_DIR_DRBUG}/FlashMap.h\r
// {DEST_DIR_DRBUG}/FlashMap.h\r
if (SurfaceAreaQuery.isHaveTianoR8FlashMap()) {\r
fileBuffer.append(CommonDefinition.include);\r
fileBuffer.append(" <");\r
if (SurfaceAreaQuery.isHaveTianoR8FlashMap()) {\r
fileBuffer.append(CommonDefinition.include);\r
fileBuffer.append(" <");\r
\r
/**\r
* moduleGenAutogenC\r
\r
/**\r
* moduleGenAutogenC\r
* This function generates AutoGen.c for module.\r
* This function generates AutoGen.c for module.\r
* @throws BuildException\r
* Failed to generate AutoGen.c.\r
*/\r
* @throws BuildException\r
* Failed to generate AutoGen.c.\r
*/\r
// autogen.c\r
//\r
LibInstanceToAutogenC(fileBuffer);\r
// autogen.c\r
//\r
LibInstanceToAutogenC(fileBuffer);\r
//\r
// Get module dependent Package identification.\r
//\r
//\r
// Get module dependent Package identification.\r
//\r
if (!this.mDepPkgList.contains(packages[i])){\r
this.mDepPkgList.add(packages[i]);\r
}\r
if (!this.mDepPkgList.contains(packages[i])){\r
this.mDepPkgList.add(packages[i]);\r
}\r
//\r
// Write consumed ppi, guid, protocol to autogen.c\r
//\r
//\r
// Write consumed ppi, guid, protocol to autogen.c\r
//\r
GuidGuidToAutogenC(fileBuffer);\r
\r
//\r
GuidGuidToAutogenC(fileBuffer);\r
\r
//\r
- // Call pcd autogen. \r
//\r
this.myPcdAutogen = new PCDAutoGenAction(moduleId, this.arch, false, null);\r
try {\r
//\r
this.myPcdAutogen = new PCDAutoGenAction(moduleId, this.arch, false, null);\r
try {\r
} catch (Exception exp) {\r
throw new PcdAutogenException (exp.getMessage());\r
}\r
} catch (Exception exp) {\r
throw new PcdAutogenException (exp.getMessage());\r
}\r
if (this.myPcdAutogen != null) {\r
fileBuffer.append("\r\n");\r
fileBuffer.append(this.myPcdAutogen.OutputC());\r
if (this.myPcdAutogen != null) {\r
fileBuffer.append("\r\n");\r
fileBuffer.append(this.myPcdAutogen.OutputC());\r
\r
/**\r
* libGenAutogenH\r
\r
/**\r
* libGenAutogenH\r
* This function generates AutoGen.h for library.\r
* This function generates AutoGen.h for library.\r
* @throws BuildException\r
* Failed to generate AutoGen.c.\r
*/\r
* @throws BuildException\r
* Failed to generate AutoGen.c.\r
*/\r
\r
//\r
// Write consumed package's mdouleInfo related *.h file to autogen.h.\r
\r
//\r
// Write consumed package's mdouleInfo related *.h file to autogen.h.\r
moduleType = SurfaceAreaQuery.getModuleType();\r
PackageIdentification[] cosumedPkglist = SurfaceAreaQuery\r
.getDependencePkg(this.arch);\r
moduleType = SurfaceAreaQuery.getModuleType();\r
PackageIdentification[] cosumedPkglist = SurfaceAreaQuery\r
.getDependencePkg(this.arch);\r
fileBuffer.append("\r\n");\r
\r
//\r
fileBuffer.append("\r\n");\r
\r
//\r
- // If is TianoR8FlashMap, copy {Fv_DIR}/FlashMap.h to \r
+ // If is TianoR8FlashMap, copy {Fv_DIR}/FlashMap.h to\r
// {DEST_DIR_DRBUG}/FlashMap.h\r
// {DEST_DIR_DRBUG}/FlashMap.h\r
if (SurfaceAreaQuery.isHaveTianoR8FlashMap()) {\r
fileBuffer.append(CommonDefinition.include);\r
fileBuffer.append(" <");\r
if (SurfaceAreaQuery.isHaveTianoR8FlashMap()) {\r
fileBuffer.append(CommonDefinition.include);\r
fileBuffer.append(" <");\r
\r
/**\r
* libGenAutogenC\r
\r
/**\r
* libGenAutogenC\r
* This function generates AutoGen.h for library.\r
* This function generates AutoGen.h for library.\r
* @throws BuildException\r
* Failed to generate AutoGen.c.\r
*/\r
* @throws BuildException\r
* Failed to generate AutoGen.c.\r
*/\r
fileBuffer.append("\r\n");\r
\r
//\r
fileBuffer.append("\r\n");\r
\r
//\r
- // Call pcd autogen. \r
//\r
this.myPcdAutogen = new PCDAutoGenAction(this.moduleId,\r
this.arch,\r
//\r
this.myPcdAutogen = new PCDAutoGenAction(this.moduleId,\r
this.arch,\r
SurfaceAreaQuery.getModulePcdEntryNameArray());\r
try {\r
this.myPcdAutogen.execute();\r
SurfaceAreaQuery.getModulePcdEntryNameArray());\r
try {\r
this.myPcdAutogen.execute();\r
\r
/**\r
* LibraryClassToAutogenH\r
\r
/**\r
* LibraryClassToAutogenH\r
* This function returns *.h files declared by library classes which are\r
* consumed or produced by current build module or library.\r
* This function returns *.h files declared by library classes which are\r
* consumed or produced by current build module or library.\r
* @param libClassList\r
* List of library class which consumed or produce by current\r
* build module or library.\r
* @param libClassList\r
* List of library class which consumed or produce by current\r
* build module or library.\r
\r
/**\r
* IncludesToAutogenH\r
\r
/**\r
* IncludesToAutogenH\r
* This function add include file in AutoGen.h file.\r
* This function add include file in AutoGen.h file.\r
* @param packageNameList\r
* List of module depended package.\r
* @param moduleType\r
* @param packageNameList\r
* List of module depended package.\r
* @param moduleType\r
\r
/**\r
* EntryPointToAutoGen\r
\r
/**\r
* EntryPointToAutoGen\r
* This function convert <ModuleEntryPoint> & <ModuleUnloadImage>\r
* information in mas to AutoGen.c\r
* This function convert <ModuleEntryPoint> & <ModuleUnloadImage>\r
* information in mas to AutoGen.c\r
* @param entryPointList\r
* List of entry point.\r
* @param fileBuffer\r
* @param entryPointList\r
* List of entry point.\r
* @param fileBuffer\r
.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");\r
fileBuffer.append(" );\r\n");\r
entryPointCount++;\r
.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");\r
fileBuffer.append(" );\r\n");\r
entryPointCount++;\r
}\r
\r
fileBuffer.append("EFI_STATUS\r\n");\r
}\r
\r
fileBuffer.append("EFI_STATUS\r\n");\r
fileBuffer.append(" )\r\n\r\n");\r
fileBuffer.append("{\r\n");\r
\r
fileBuffer.append(" )\r\n\r\n");\r
fileBuffer.append("{\r\n");\r
\r
for (int i = 0; i < entryPointList.length; i++) {\r
fileBuffer\r
.append(" if (SetJump (&mJumpContext) == 0) {\r\n");\r
for (int i = 0; i < entryPointList.length; i++) {\r
fileBuffer\r
.append(" if (SetJump (&mJumpContext) == 0) {\r\n");\r
fileBuffer.append(" (ImageHandle, SystemTable));\r\n");\r
fileBuffer.append(" ASSERT (FALSE);\r\n");\r
fileBuffer.append(" }\r\n");\r
fileBuffer.append(" (ImageHandle, SystemTable));\r\n");\r
fileBuffer.append(" ASSERT (FALSE);\r\n");\r
fileBuffer.append(" }\r\n");\r
}\r
fileBuffer.append(" return mDriverEntryPointStatus;\r\n");\r
fileBuffer.append("}\r\n\r\n");\r
}\r
fileBuffer.append(" return mDriverEntryPointStatus;\r\n");\r
fileBuffer.append("}\r\n\r\n");\r
fileBuffer.append(" LongJump (&mJumpContext, (UINTN)-1);\r\n");\r
fileBuffer.append(" ASSERT (FALSE);\r\n");\r
fileBuffer.append("}\r\n\r\n");\r
fileBuffer.append(" LongJump (&mJumpContext, (UINTN)-1);\r\n");\r
fileBuffer.append(" ASSERT (FALSE);\r\n");\r
fileBuffer.append("}\r\n\r\n");\r
//\r
// Add "ModuleUnloadImage" for DxeSmmDriver module type;\r
//\r
//\r
// Add "ModuleUnloadImage" for DxeSmmDriver module type;\r
//\r
fileBuffer.append("{\r\n");\r
fileBuffer.append(" return EFI_SUCCESS;\r\n");\r
fileBuffer.append("}\r\n");\r
fileBuffer.append("{\r\n");\r
fileBuffer.append(" return EFI_SUCCESS;\r\n");\r
fileBuffer.append("}\r\n");\r
}else {\r
for (int i = 0; i < entryPointList.length; i++) {\r
}else {\r
for (int i = 0; i < entryPointList.length; i++) {\r
fileBuffer.append("EFI_STATUS\r\n");\r
fileBuffer.append("EFIAPI\r\n");\r
fileBuffer.append(entryPointList[i]);\r
fileBuffer.append("EFI_STATUS\r\n");\r
fileBuffer.append("EFIAPI\r\n");\r
fileBuffer.append(entryPointList[i]);\r
fileBuffer.append("}\r\n\r\n");\r
\r
}\r
fileBuffer.append("}\r\n\r\n");\r
\r
}\r
//\r
// Add ModuleUnloadImage for DxeDriver and UefiDriver module type.\r
//\r
//\r
// Add ModuleUnloadImage for DxeDriver and UefiDriver module type.\r
//\r
\r
/**\r
* PpiGuidToAutogenc\r
\r
/**\r
* PpiGuidToAutogenc\r
* This function gets GUIDs from SPD file accrodeing to <PPIs> information\r
* and write those GUIDs to AutoGen.c.\r
* This function gets GUIDs from SPD file accrodeing to <PPIs> information\r
* and write those GUIDs to AutoGen.c.\r
* @param fileBuffer\r
* String Buffer for Autogen.c file.\r
* @throws BuildException\r
* @param fileBuffer\r
* String Buffer for Autogen.c file.\r
* @throws BuildException\r
// Get the all PPI adn PPI Notify from MSA file,\r
// then add those PPI ,and PPI Notify name to list.\r
//\r
// Get the all PPI adn PPI Notify from MSA file,\r
// then add those PPI ,and PPI Notify name to list.\r
//\r
String[] ppiList = SurfaceAreaQuery.getPpiArray(this.arch);\r
for (int i = 0; i < ppiList.length; i++) {\r
this.mPpiList.add(ppiList[i]);\r
String[] ppiList = SurfaceAreaQuery.getPpiArray(this.arch);\r
for (int i = 0; i < ppiList.length; i++) {\r
this.mPpiList.add(ppiList[i]);\r
\r
/**\r
* ProtocolGuidToAutogenc\r
\r
/**\r
* ProtocolGuidToAutogenc\r
* This function gets GUIDs from SPD file accrodeing to <Protocol>\r
* information and write those GUIDs to AutoGen.c.\r
* This function gets GUIDs from SPD file accrodeing to <Protocol>\r
* information and write those GUIDs to AutoGen.c.\r
* @param fileBuffer\r
* String Buffer for Autogen.c file.\r
* @throws BuildException\r
* @param fileBuffer\r
* String Buffer for Autogen.c file.\r
* @throws BuildException\r
//\r
Iterator protocolIterator = this.mProtocolList.iterator();\r
String protocolKeyWord = null;\r
//\r
Iterator protocolIterator = this.mProtocolList.iterator();\r
String protocolKeyWord = null;\r
while (protocolIterator.hasNext()) {\r
protocolKeyWord = protocolIterator.next().toString();\r
cNameGuid = GlobalData.getProtocolGuid(this.mDepPkgList, protocolKeyWord);\r
while (protocolIterator.hasNext()) {\r
protocolKeyWord = protocolIterator.next().toString();\r
cNameGuid = GlobalData.getProtocolGuid(this.mDepPkgList, protocolKeyWord);\r
\r
/**\r
* GuidGuidToAutogenc\r
\r
/**\r
* GuidGuidToAutogenc\r
* This function gets GUIDs from SPD file accrodeing to <Guids> information\r
* and write those GUIDs to AutoGen.c.\r
* This function gets GUIDs from SPD file accrodeing to <Guids> information\r
* and write those GUIDs to AutoGen.c.\r
* @param fileBuffer\r
* String Buffer for Autogen.c file.\r
* @param fileBuffer\r
* String Buffer for Autogen.c file.\r
*/\r
void GuidGuidToAutogenC(StringBuffer fileBuffer) throws AutoGenException {\r
String[] cNameGuid = null;\r
*/\r
void GuidGuidToAutogenC(StringBuffer fileBuffer) throws AutoGenException {\r
String[] cNameGuid = null;\r
\r
/**\r
* LibInstanceToAutogenC\r
\r
/**\r
* LibInstanceToAutogenC\r
* This function adds dependent library instance to autogen.c,which\r
* includeing library's constructor, destructor, and library dependent ppi,\r
* protocol, guid, pcd information.\r
* This function adds dependent library instance to autogen.c,which\r
* includeing library's constructor, destructor, and library dependent ppi,\r
* protocol, guid, pcd information.\r
* @param fileBuffer\r
* String buffer for AutoGen.c\r
* @throws BuildException\r
* @param fileBuffer\r
* String buffer for AutoGen.c\r
* @throws BuildException\r
\r
/**\r
* LibConstructorToAutogenc\r
\r
/**\r
* LibConstructorToAutogenc\r
* This function writes library constructor list to AutoGen.c. The library\r
* constructor's parameter and return value depend on module type.\r
* This function writes library constructor list to AutoGen.c. The library\r
* constructor's parameter and return value depend on module type.\r
* @param libInstanceList\r
* List of library construct name.\r
* @param moduleType\r
* @param libInstanceList\r
* List of library construct name.\r
* @param moduleType\r
\r
/**\r
* LibDestructorToAutogenc\r
\r
/**\r
* LibDestructorToAutogenc\r
* This function writes library destructor list to AutoGen.c. The library\r
* destructor's parameter and return value depend on module type.\r
* This function writes library destructor list to AutoGen.c. The library\r
* destructor's parameter and return value depend on module type.\r
* @param libInstanceList\r
* List of library destructor name.\r
* @param moduleType\r
* @param libInstanceList\r
* List of library destructor name.\r
* @param moduleType\r
//\r
// If no library destructor function, return EFI_SUCCESS.\r
//\r
//\r
// If no library destructor function, return EFI_SUCCESS.\r
//\r
for (int i = 0; i < libInstanceList.size(); i++) {\r
if (isFirst) {\r
fileBuffer.append(" EFI_STATUS Status;\r\n");\r
for (int i = 0; i < libInstanceList.size(); i++) {\r
if (isFirst) {\r
fileBuffer.append(" EFI_STATUS Status;\r\n");\r
\r
/**\r
* ExternsDriverBindingToAutoGenC\r
\r
/**\r
* ExternsDriverBindingToAutoGenC\r
* This function is to write DRIVER_BINDING, COMPONENT_NAME,\r
* DRIVER_CONFIGURATION, DRIVER_DIAGNOSTIC in AutoGen.c.\r
* This function is to write DRIVER_BINDING, COMPONENT_NAME,\r
* DRIVER_CONFIGURATION, DRIVER_DIAGNOSTIC in AutoGen.c.\r
* @param fileBuffer\r
* String buffer for AutoGen.c\r
*/\r
* @param fileBuffer\r
* String buffer for AutoGen.c\r
*/\r
\r
/**\r
* ExternCallBackToAutoGenC\r
\r
/**\r
* ExternCallBackToAutoGenC\r
* This function adds <SetVirtualAddressMapCallBack> and\r
* <ExitBootServicesCallBack> infomation to AutoGen.c\r
* This function adds <SetVirtualAddressMapCallBack> and\r
* <ExitBootServicesCallBack> infomation to AutoGen.c\r
* @param fileBuffer\r
* String buffer for AutoGen.c\r
* @throws BuildException\r
* @param fileBuffer\r
* String buffer for AutoGen.c\r
* @throws BuildException\r
void ExternCallBackToAutoGenC(StringBuffer fileBuffer)\r
throws BuildException {\r
//\r
void ExternCallBackToAutoGenC(StringBuffer fileBuffer)\r
throws BuildException {\r
//\r
- // Collect module's <SetVirtualAddressMapCallBack> and \r
- // <ExitBootServiceCallBack> and add to setVirtualAddList \r
+ // Collect module's <SetVirtualAddressMapCallBack> and\r
+ // <ExitBootServiceCallBack> and add to setVirtualAddList\r
// exitBootServiceList.\r
// exitBootServiceList.\r
String[] setVirtuals = SurfaceAreaQuery.getSetVirtualAddressMapCallBackArray();\r
String[] exitBoots = SurfaceAreaQuery.getExitBootServicesCallBackArray();\r
if (setVirtuals != null) {\r
String[] setVirtuals = SurfaceAreaQuery.getSetVirtualAddressMapCallBackArray();\r
String[] exitBoots = SurfaceAreaQuery.getExitBootServicesCallBackArray();\r
if (setVirtuals != null) {\r
}\r
//\r
// Add c code in autogen.c which relate to <SetVirtualAddressMapCallBack>\r
}\r
//\r
// Add c code in autogen.c which relate to <SetVirtualAddressMapCallBack>\r
- // and <ExitBootServicesCallBack> \r
- // \r
+ // and <ExitBootServicesCallBack>\r
+ //\r
String moduleType = this.moduleId.getModuleType();\r
boolean UefiOrDxeModule = false;\r
int Count = 0;\r
String moduleType = this.moduleId.getModuleType();\r
boolean UefiOrDxeModule = false;\r
int Count = 0;\r
}\r
//\r
// If module is not DXE_DRIVER, DXE_RUNTIME_DIRVER, UEFI_DRIVER\r
}\r
//\r
// If module is not DXE_DRIVER, DXE_RUNTIME_DIRVER, UEFI_DRIVER\r
- // UEFI_APPLICATION and DXE_SAL_DRIVER add the NULL at the end of \r
- // _gDriverSetVirtualAddressMapEvent list. \r
+ // UEFI_APPLICATION and DXE_SAL_DRIVER add the NULL at the end of\r
+ // _gDriverSetVirtualAddressMapEvent list.\r
//\r
if (!UefiOrDxeModule) {\r
fileBuffer.append(",\r\n NULL");\r
//\r
if (!UefiOrDxeModule) {\r
fileBuffer.append(",\r\n NULL");\r
}\r
\r
private void copyFlashMapHToDebugDir() throws AutoGenException{\r
}\r
\r
private void copyFlashMapHToDebugDir() throws AutoGenException{\r
File inFile = new File(fvDir + File.separatorChar + CommonDefinition.flashMapH);\r
int size = (int)inFile.length();\r
byte[] buffer = new byte[size];\r
File outFile = new File (this.outputPath + File.separatorChar + CommonDefinition.tianoR8FlashMapH);\r
//\r
File inFile = new File(fvDir + File.separatorChar + CommonDefinition.flashMapH);\r
int size = (int)inFile.length();\r
byte[] buffer = new byte[size];\r
File outFile = new File (this.outputPath + File.separatorChar + CommonDefinition.tianoR8FlashMapH);\r
//\r
- // If TianoR8FlashMap.h existed and the flashMap.h don't change, \r
+ // If TianoR8FlashMap.h existed and the flashMap.h don't change,\r
if ((!outFile.exists()) ||(inFile.lastModified() - outFile.lastModified()) >= 0) {\r
try{\r
if (inFile.exists()) {\r
if ((!outFile.exists()) ||(inFile.lastModified() - outFile.lastModified()) >= 0) {\r
try{\r
if (inFile.exists()) {\r
/**\r
*This function first order the library instances, then collect\r
*library instance 's PPI, Protocol, GUID,\r
/**\r
*This function first order the library instances, then collect\r
*library instance 's PPI, Protocol, GUID,\r
.getLibDestructorName();\r
\r
//\r
.getLibDestructorName();\r
\r
//\r
- // Collect SetVirtualAddressMapCallBack and \r
+ // Collect SetVirtualAddressMapCallBack and\r
// ExitBootServiceCallBack.\r
// ExitBootServiceCallBack.\r
setVirtuals = SurfaceAreaQuery.getSetVirtualAddressMapCallBackArray();\r
exitBoots = SurfaceAreaQuery.getExitBootServicesCallBackArray();\r
if (setVirtuals != null) {\r
setVirtuals = SurfaceAreaQuery.getSetVirtualAddressMapCallBackArray();\r
exitBoots = SurfaceAreaQuery.getExitBootServicesCallBackArray();\r
if (setVirtuals != null) {\r
GenBuildException class.\r
\r
The class handle the exception throwed by entity class.\r
GenBuildException class.\r
\r
The class handle the exception throwed by entity class.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
package org.tianocore.build.exception;\r
\r
package org.tianocore.build.exception;\r
\r
-import org.tianocore.exception.EdkException;\r
+import org.tianocore.common.exception.EdkException;\r
\r
/**\r
The class handle the exception throwed by entity class.\r
\r
/**\r
The class handle the exception throwed by entity class.\r
static final long serialVersionUID = -8034897190740066937L;\r
/**\r
Constructure function\r
static final long serialVersionUID = -8034897190740066937L;\r
/**\r
Constructure function\r
@param expStr exception message string.\r
**/\r
public GenBuildException(String expStr) {\r
super("[GenBuildException]:" + expStr);\r
}\r
@param expStr exception message string.\r
**/\r
public GenBuildException(String expStr) {\r
super("[GenBuildException]:" + expStr);\r
}\r
public GenBuildException() {\r
super();\r
}\r
public GenBuildException() {\r
super();\r
}\r
TianoToolsException class.\r
\r
The class handle the exception throwed by entity class.\r
TianoToolsException class.\r
\r
The class handle the exception throwed by entity class.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
package org.tianocore.build.exception;\r
\r
package org.tianocore.build.exception;\r
\r
-import org.tianocore.exception.EdkException;\r
+import org.tianocore.common.exception.EdkException;\r
\r
/**\r
The class handle the exception throwed by entity class.\r
\r
/**\r
The class handle the exception throwed by entity class.\r
static final long serialVersionUID = -8034897190740066935L;\r
/**\r
Constructure function\r
static final long serialVersionUID = -8034897190740066935L;\r
/**\r
Constructure function\r
@param expStr exception message string.\r
**/\r
public TianoToolsException(String expStr) {\r
super("[TianoToolsException]:" + expStr);\r
}\r
@param expStr exception message string.\r
**/\r
public TianoToolsException(String expStr) {\r
super("[TianoToolsException]:" + expStr);\r
}\r
public TianoToolsException() {\r
super();\r
}\r
public TianoToolsException() {\r
super();\r
}\r
public TianoToolsException (Exception e, String message){\r
super(e, message);\r
}\r
public TianoToolsException (Exception e, String message){\r
super(e, message);\r
}\r
- This file is ANT task FpdParserTask. \r
- \r
+ This file is ANT task FpdParserTask.\r
+\r
FpdParserTask is used to parse FPD (Framework Platform Description) and generate\r
FpdParserTask is used to parse FPD (Framework Platform Description) and generate\r
- build.out.xml. It is for Package or Platform build use. \r
- \r
+ build.out.xml. It is for Package or Platform build use.\r
+\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
import org.apache.tools.ant.taskdefs.Property;\r
import org.apache.xmlbeans.XmlObject;\r
\r
import org.apache.tools.ant.taskdefs.Property;\r
import org.apache.xmlbeans.XmlObject;\r
\r
+import org.tianocore.common.exception.EdkException;\r
+import org.tianocore.pcd.action.ActionMessage;\r
import org.tianocore.build.global.GlobalData;\r
import org.tianocore.build.global.OutputManager;\r
import org.tianocore.build.global.SurfaceAreaQuery;\r
import org.tianocore.build.id.FpdModuleIdentification;\r
import org.tianocore.build.id.ModuleIdentification;\r
import org.tianocore.build.id.PlatformIdentification;\r
import org.tianocore.build.global.GlobalData;\r
import org.tianocore.build.global.OutputManager;\r
import org.tianocore.build.global.SurfaceAreaQuery;\r
import org.tianocore.build.id.FpdModuleIdentification;\r
import org.tianocore.build.id.ModuleIdentification;\r
import org.tianocore.build.id.PlatformIdentification;\r
-import org.tianocore.pcd.action.ActionMessage;\r
import org.tianocore.build.pcd.action.PlatformPcdPreprocessActionForBuilding;\r
import org.tianocore.build.toolchain.ToolChainAttribute;\r
import org.tianocore.build.toolchain.ToolChainElement;\r
import org.tianocore.build.toolchain.ToolChainMap;\r
import org.tianocore.build.pcd.action.PlatformPcdPreprocessActionForBuilding;\r
import org.tianocore.build.toolchain.ToolChainAttribute;\r
import org.tianocore.build.toolchain.ToolChainElement;\r
import org.tianocore.build.toolchain.ToolChainMap;\r
-import org.tianocore.exception.EdkException;\r
\r
/**\r
<code>FpdParserTask</code> is an ANT task. The main function is parsing Framework\r
\r
/**\r
<code>FpdParserTask</code> is an ANT task. The main function is parsing Framework\r
- Platform Descritpion (FPD) XML file and generating its ANT build script for \r
- corresponding platform. \r
+ Platform Descritpion (FPD) XML file and generating its ANT build script for\r
+ corresponding platform.\r
\r
<p>The task sets global properties PLATFORM, PLATFORM_DIR, PLATFORM_RELATIVE_DIR\r
and BUILD_DIR. </p>\r
\r
<p>The task sets global properties PLATFORM, PLATFORM_DIR, PLATFORM_RELATIVE_DIR\r
and BUILD_DIR. </p>\r
<p>The task generates ${PLATFORM}_build.xml file which will be called by top level\r
<p>The task generates ${PLATFORM}_build.xml file which will be called by top level\r
- build.xml. The task also generate Fv.inf files (File is for Tool GenFvImage) \r
+ build.xml. The task also generate Fv.inf files (File is for Tool GenFvImage)\r
and flash definition file (File is for Tool FlashMap) if necessary. </p>\r
and flash definition file (File is for Tool FlashMap) if necessary. </p>\r
<p>FpdParserTask task stores all FPD information to GlobalData. And parse\r
tools definition file to set up compiler options for different Target and\r
different ToolChainTag. </p>\r
<p>FpdParserTask task stores all FPD information to GlobalData. And parse\r
tools definition file to set up compiler options for different Target and\r
different ToolChainTag. </p>\r
<p>The method parseFpdFile is also prepared for single module build. </p>\r
<p>The method parseFpdFile is also prepared for single module build. </p>\r
<p>The usage is (take NT32 Platform for example):</p>\r
\r
<pre>\r
<FPDParser platformName="Nt32" />\r
</pre>\r
\r
<p>The usage is (take NT32 Platform for example):</p>\r
\r
<pre>\r
<FPDParser platformName="Nt32" />\r
</pre>\r
\r
- <p>The task will initialize all information through parsing Framework Database, \r
+ <p>The task will initialize all information through parsing Framework Database,\r
SPD, Tool chain configuration files. </p>\r
\r
@since GenBuild 1.0\r
**/\r
public class FpdParserTask extends Task {\r
SPD, Tool chain configuration files. </p>\r
\r
@since GenBuild 1.0\r
**/\r
public class FpdParserTask extends Task {\r
private String platformName;\r
\r
private File fpdFile = null;\r
private String platformName;\r
\r
private File fpdFile = null;\r
private PlatformIdentification platformId;\r
private PlatformIdentification platformId;\r
///\r
private String type;\r
///\r
private String type;\r
///\r
/// Mapping from modules identification to out put file name\r
///\r
///\r
/// Mapping from modules identification to out put file name\r
///\r
private Map<String, Set<FpdModuleIdentification>> fvs = new HashMap<String, Set<FpdModuleIdentification>>();\r
\r
///\r
private Map<String, Set<FpdModuleIdentification>> fvs = new HashMap<String, Set<FpdModuleIdentification>>();\r
\r
///\r
- /// FpdParserTask can specify some ANT properties. \r
+ /// FpdParserTask can specify some ANT properties.\r
///\r
private Vector<Property> properties = new Vector<Property>();\r
///\r
private Vector<Property> properties = new Vector<Property>();\r
private boolean isUnified = true;\r
\r
\r
private boolean isUnified = true;\r
\r
\r
- ANT task's entry method. The main steps is described as following: \r
- \r
+ ANT task's entry method. The main steps is described as following:\r
+\r
- <li>Initialize global information (Framework DB, SPD files and all MSA files \r
+ <li>Initialize global information (Framework DB, SPD files and all MSA files\r
listed in SPD). This step will execute only once in whole build process;</li>\r
<li>Parse specified FPD file; </li>\r
<li>Generate FV.inf files; </li>\r
<li>Generate PlatformName_build.xml file for Flatform build; </li>\r
<li>Collect PCD information. </li>\r
</ul>\r
listed in SPD). This step will execute only once in whole build process;</li>\r
<li>Parse specified FPD file; </li>\r
<li>Generate FV.inf files; </li>\r
<li>Generate PlatformName_build.xml file for Flatform build; </li>\r
<li>Collect PCD information. </li>\r
</ul>\r
- Surface area is not valid. \r
+ Surface area is not valid.\r
**/\r
public void execute() throws BuildException {\r
// Remove !!\r
**/\r
public void execute() throws BuildException {\r
// Remove !!\r
platformId = GlobalData.getPlatformByName(platformName);\r
fpdFile = platformId.getFpdFile();\r
}\r
platformId = GlobalData.getPlatformByName(platformName);\r
fpdFile = platformId.getFpdFile();\r
}\r
//\r
// Parse FPD file\r
//\r
parseFpdFile();\r
//\r
// Parse FPD file\r
//\r
parseFpdFile();\r
//\r
// Prepare BUILD_DIR\r
//\r
isUnified = OutputManager.getInstance().prepareBuildDir(getProject());\r
//\r
// Prepare BUILD_DIR\r
//\r
isUnified = OutputManager.getInstance().prepareBuildDir(getProject());\r
//\r
// For every Target and ToolChain\r
//\r
//\r
// For every Target and ToolChain\r
//\r
//\r
// Prepare FV_DIR\r
//\r
//\r
// Prepare FV_DIR\r
//\r
- String ffsCommonDir = getProject().getProperty("BUILD_DIR") + File.separatorChar \r
- + targetList[i] + File.separatorChar \r
+ String ffsCommonDir = getProject().getProperty("BUILD_DIR") + File.separatorChar\r
+ + targetList[i] + File.separatorChar\r
+ toolchainList[j];\r
File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");\r
fvDir.mkdirs();\r
getProject().setProperty("FV_DIR", fvDir.getPath().replaceAll("(\\\\)", "/"));\r
+ toolchainList[j];\r
File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");\r
fvDir.mkdirs();\r
getProject().setProperty("FV_DIR", fvDir.getPath().replaceAll("(\\\\)", "/"));\r
//\r
// Gen Fv.inf files\r
//\r
//\r
// Gen Fv.inf files\r
//\r
//\r
PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, isUnified);\r
fileGenerator.genBuildFile();\r
//\r
PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, isUnified);\r
fileGenerator.genBuildFile();\r
//\r
// Ant call ${PLATFORM}_build.xml\r
//\r
//\r
// Ant call ${PLATFORM}_build.xml\r
//\r
Ant ant = new Ant();\r
ant.setProject(getProject());\r
ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");\r
Ant ant = new Ant();\r
ant.setProject(getProject());\r
ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");\r
ant.setInheritAll(true);\r
ant.init();\r
ant.execute();\r
ant.setInheritAll(true);\r
ant.init();\r
ant.execute();\r
// GlobalData.log.info("Fpd build end. ");\r
}\r
\r
/**\r
// GlobalData.log.info("Fpd build end. ");\r
}\r
\r
/**\r
- Generate Fv.inf files. The Fv.inf file is composed with four \r
- parts: Options, Attributes, Components and Files. The Fv.inf files \r
+ Generate Fv.inf files. The Fv.inf file is composed with four\r
+ parts: Options, Attributes, Components and Files. The Fv.inf files\r
- File write FV.inf files error. \r
+ File write FV.inf files error.\r
**/\r
private void genFvInfFiles(String ffsCommonDir) throws BuildException {\r
String[] validFv = SurfaceAreaQuery.getFpdValidImageNames();\r
**/\r
private void genFvInfFiles(String ffsCommonDir) throws BuildException {\r
String[] validFv = SurfaceAreaQuery.getFpdValidImageNames();\r
}\r
\r
getProject().setProperty("FV_FILENAME", validFv[i]);\r
}\r
\r
getProject().setProperty("FV_FILENAME", validFv[i]);\r
File fvFile = new File(getProject().replaceProperties( getProject().getProperty("FV_DIR") + File.separatorChar + validFv[i] + ".inf"));\r
fvFile.getParentFile().mkdirs();\r
\r
try {\r
FileWriter fw = new FileWriter(fvFile);\r
BufferedWriter bw = new BufferedWriter(fw);\r
File fvFile = new File(getProject().replaceProperties( getProject().getProperty("FV_DIR") + File.separatorChar + validFv[i] + ".inf"));\r
fvFile.getParentFile().mkdirs();\r
\r
try {\r
FileWriter fw = new FileWriter(fvFile);\r
BufferedWriter bw = new BufferedWriter(fw);\r
//\r
// Attributes;\r
//\r
//\r
// Attributes;\r
//\r
//\r
// Components\r
//\r
//\r
// Components\r
//\r
}\r
/**\r
This method is used for Single Module Build.\r
}\r
/**\r
This method is used for Single Module Build.\r
- FPD file is not valid. \r
+ FPD file is not valid.\r
**/\r
public void parseFpdFile(File fpdFile) throws BuildException {\r
this.fpdFile = fpdFile;\r
**/\r
public void parseFpdFile(File fpdFile) throws BuildException {\r
this.fpdFile = fpdFile;\r
- Parse FPD file. \r
- \r
- FPD file is not valid. \r
+ FPD file is not valid.\r
**/\r
private void parseFpdFile() throws BuildException {\r
try {\r
XmlObject doc = XmlObject.Factory.parse(fpdFile);\r
**/\r
private void parseFpdFile() throws BuildException {\r
try {\r
XmlObject doc = XmlObject.Factory.parse(fpdFile);\r
if (!doc.validate()) {\r
throw new BuildException("Platform Surface Area file [" + fpdFile.getPath() + "] format is invalid!");\r
}\r
if (!doc.validate()) {\r
throw new BuildException("Platform Surface Area file [" + fpdFile.getPath() + "] format is invalid!");\r
}\r
Map<String, XmlObject> map = new HashMap<String, XmlObject>();\r
map.put("PlatformSurfaceArea", doc);\r
SurfaceAreaQuery.setDoc(map);\r
Map<String, XmlObject> map = new HashMap<String, XmlObject>();\r
map.put("PlatformSurfaceArea", doc);\r
SurfaceAreaQuery.setDoc(map);\r
getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));\r
\r
//\r
getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));\r
\r
//\r
- // Build mode. User-defined output dir. \r
+ // Build mode. User-defined output dir.\r
//\r
String buildMode = SurfaceAreaQuery.getFpdIntermediateDirectories();\r
String userDefinedOutputDir = SurfaceAreaQuery.getFpdOutputDirectory();\r
//\r
String buildMode = SurfaceAreaQuery.getFpdIntermediateDirectories();\r
String userDefinedOutputDir = SurfaceAreaQuery.getFpdOutputDirectory();\r
// TBD. Deal PCD and BuildOption related Info\r
//\r
GlobalData.setFpdBuildOptions(SurfaceAreaQuery.getFpdBuildOptions());\r
// TBD. Deal PCD and BuildOption related Info\r
//\r
GlobalData.setFpdBuildOptions(SurfaceAreaQuery.getFpdBuildOptions());\r
GlobalData.setToolChainPlatformInfo(SurfaceAreaQuery.getFpdToolChainInfo());\r
GlobalData.setToolChainPlatformInfo(SurfaceAreaQuery.getFpdToolChainInfo());\r
//\r
// Parse all list modules SA\r
//\r
//\r
// Parse all list modules SA\r
//\r
parseToolChainOptions();\r
\r
SurfaceAreaQuery.setDoc(map);\r
parseToolChainOptions();\r
\r
SurfaceAreaQuery.setDoc(map);\r
//\r
// Pcd Collection. Call CollectPCDAction to collect pcd info.\r
//\r
//\r
// Pcd Collection. Call CollectPCDAction to collect pcd info.\r
//\r
- Parse all modules listed in FPD file. \r
+ Parse all modules listed in FPD file.\r
**/\r
private void parseModuleSAFiles() throws EdkException{\r
Map<FpdModuleIdentification, Map<String, XmlObject>> moduleSAs = SurfaceAreaQuery.getFpdModules();\r
**/\r
private void parseModuleSAFiles() throws EdkException{\r
Map<FpdModuleIdentification, Map<String, XmlObject>> moduleSAs = SurfaceAreaQuery.getFpdModules();\r
Iterator iter = keys.iterator();\r
while (iter.hasNext()) {\r
FpdModuleIdentification fpdModuleId = (FpdModuleIdentification) iter.next();\r
Iterator iter = keys.iterator();\r
while (iter.hasNext()) {\r
FpdModuleIdentification fpdModuleId = (FpdModuleIdentification) iter.next();\r
- // Judge if Module is existed? \r
+ // Judge if Module is existed?\r
GlobalData.registerFpdModuleSA(fpdModuleId, moduleSAs.get(fpdModuleId));\r
\r
//\r
GlobalData.registerFpdModuleSA(fpdModuleId, moduleSAs.get(fpdModuleId));\r
\r
//\r
\r
fpdModuleId.setFvBinding(fvBinding);\r
updateFvs(fvBinding, fpdModuleId);\r
\r
fpdModuleId.setFvBinding(fvBinding);\r
updateFvs(fvBinding, fpdModuleId);\r
//\r
// Prepare for out put file name\r
//\r
//\r
// Prepare for out put file name\r
//\r
if (baseName == null) {\r
baseName = moduleId.getName();\r
}\r
if (baseName == null) {\r
baseName = moduleId.getName();\r
}\r
- outfiles.put(fpdModuleId, fpdModuleId.getArch() + File.separatorChar \r
- + moduleId.getGuid() + "-" + baseName \r
+ outfiles.put(fpdModuleId, fpdModuleId.getArch() + File.separatorChar\r
+ + moduleId.getGuid() + "-" + baseName\r
+ getSuffix(moduleId.getModuleType()));\r
\r
//\r
// parse module build options, if any\r
+ getSuffix(moduleId.getModuleType()));\r
\r
//\r
// parse module build options, if any\r
SurfaceAreaQuery.push(GlobalData.getDoc(fpdModuleId));\r
GlobalData.addModuleToolChainOption(fpdModuleId, parseModuleBuildOptions(false));\r
GlobalData.addModuleToolChainFamilyOption(fpdModuleId, parseModuleBuildOptions(true));\r
SurfaceAreaQuery.push(GlobalData.getDoc(fpdModuleId));\r
GlobalData.addModuleToolChainOption(fpdModuleId, parseModuleBuildOptions(false));\r
GlobalData.addModuleToolChainFamilyOption(fpdModuleId, parseModuleBuildOptions(true));\r
}\r
return parseOptions(options);\r
}\r
}\r
return parseOptions(options);\r
}\r
private ToolChainMap parsePlatformBuildOptions(boolean toolChainFamilyFlag) throws EdkException {\r
String[][] options = SurfaceAreaQuery.getPlatformBuildOptions(toolChainFamilyFlag);\r
if (options == null || options.length == 0) {\r
private ToolChainMap parsePlatformBuildOptions(boolean toolChainFamilyFlag) throws EdkException {\r
String[][] options = SurfaceAreaQuery.getPlatformBuildOptions(toolChainFamilyFlag);\r
if (options == null || options.length == 0) {\r
private void parseToolChainFamilyOptions() throws EdkException {\r
GlobalData.setPlatformToolChainFamilyOption(parsePlatformBuildOptions(true));\r
}\r
private void parseToolChainFamilyOptions() throws EdkException {\r
GlobalData.setPlatformToolChainFamilyOption(parsePlatformBuildOptions(true));\r
}\r
- Add the current module to corresponding FV. \r
- \r
+ Add the current module to corresponding FV.\r
+\r
@param fvName current FV name\r
@param moduleName current module identification\r
**/\r
@param fvName current FV name\r
@param moduleName current module identification\r
**/\r
- Get the suffix based on module type. Current relationship are listed: \r
- \r
+ Get the suffix based on module type. Current relationship are listed:\r
+\r
<pre>\r
<b>ModuleType</b> <b>Suffix</b>\r
BASE .FFS\r
<pre>\r
<b>ModuleType</b> <b>Suffix</b>\r
BASE .FFS\r
UEFI_APPLICATION .APP\r
USER_DEFINED .FFS\r
</pre>\r
UEFI_APPLICATION .APP\r
USER_DEFINED .FFS\r
</pre>\r
@param moduleType module type\r
@return\r
@throws BuildException\r
@param moduleType module type\r
@return\r
@throws BuildException\r
}\r
\r
String[][] suffix = { { "BASE", ".FFS"},\r
}\r
\r
String[][] suffix = { { "BASE", ".FFS"},\r
- { "SEC", ".SEC" }, { "PEI_CORE", ".PEI" }, \r
+ { "SEC", ".SEC" }, { "PEI_CORE", ".PEI" },\r
{ "PEIM", ".PEI" }, { "DXE_CORE", ".DXE" },\r
{ "PEIM", ".PEI" }, { "DXE_CORE", ".DXE" },\r
- { "DXE_DRIVER", ".DXE" }, { "DXE_RUNTIME_DRIVER", ".DXE" }, \r
- { "DXE_SAL_DRIVER", ".DXE" }, { "DXE_SMM_DRIVER", ".DXE" }, \r
+ { "DXE_DRIVER", ".DXE" }, { "DXE_RUNTIME_DRIVER", ".DXE" },\r
+ { "DXE_SAL_DRIVER", ".DXE" }, { "DXE_SMM_DRIVER", ".DXE" },\r
{ "TOOL", ".FFS" }, { "UEFI_DRIVER", ".DXE" },\r
{ "UEFI_APPLICATION", ".APP" }, { "USER_DEFINED", ".FFS" } };\r
{ "TOOL", ".FFS" }, { "UEFI_DRIVER", ".DXE" },\r
{ "UEFI_APPLICATION", ".APP" }, { "USER_DEFINED", ".FFS" } };\r
for (int i = 0; i < suffix.length; i++) {\r
if (suffix[i][0].equalsIgnoreCase(moduleType)) {\r
return suffix[i][1];\r
for (int i = 0; i < suffix.length; i++) {\r
if (suffix[i][0].equalsIgnoreCase(moduleType)) {\r
return suffix[i][1];\r
return ".FFS";\r
}\r
/**\r
return ".FFS";\r
}\r
/**\r
- Add a property. \r
- \r
@param p property\r
**/\r
public void addProperty(Property p) {\r
@param p property\r
**/\r
public void addProperty(Property p) {\r
public void setType(String type) {\r
this.type = type;\r
}\r
public void setType(String type) {\r
this.type = type;\r
}\r
--*/\r
\r
package org.tianocore.build.global;\r
--*/\r
\r
package org.tianocore.build.global;\r
import org.apache.tools.ant.Project;\r
import org.apache.tools.ant.Project;\r
-import org.tianocore.logger.LogMethod;\r
+\r
+import org.tianocore.common.logger.LogMethod;\r
\r
public class GenBuildLogger implements LogMethod {\r
private Project project;\r
public GenBuildLogger(Project project) {\r
this.project = project;\r
\r
public class GenBuildLogger implements LogMethod {\r
private Project project;\r
public GenBuildLogger(Project project) {\r
this.project = project;\r
}\r
\r
public void putMessage(Object msgSource, int msgLevel, String msg) {\r
if (this.project != null){\r
this.project.log(msg, Project.MSG_INFO);\r
}\r
}\r
\r
public void putMessage(Object msgSource, int msgLevel, String msg) {\r
if (this.project != null){\r
this.project.log(msg, Project.MSG_INFO);\r
}\r
}\r
}
\ No newline at end of file
}\r
}
\ No newline at end of file
- GlobalData class. \r
- \r
+ GlobalData class.\r
+\r
GlobalData provide initializing, instoring, querying and update global data.\r
It is a bridge to intercommunicate between multiple component, such as AutoGen,\r
GlobalData provide initializing, instoring, querying and update global data.\r
It is a bridge to intercommunicate between multiple component, such as AutoGen,\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
import org.apache.tools.ant.BuildException;\r
import org.apache.xmlbeans.XmlObject;\r
\r
import org.apache.tools.ant.BuildException;\r
import org.apache.xmlbeans.XmlObject;\r
+\r
+import org.tianocore.common.exception.EdkException;\r
+import org.tianocore.common.logger.EdkLog;\r
+import org.tianocore.pcd.entity.MemoryDatabaseManager;\r
import org.tianocore.DbPathAndFilename;\r
import org.tianocore.FrameworkDatabaseDocument;\r
import org.tianocore.ModuleSurfaceAreaDocument;\r
import org.tianocore.DbPathAndFilename;\r
import org.tianocore.FrameworkDatabaseDocument;\r
import org.tianocore.ModuleSurfaceAreaDocument;\r
import org.tianocore.build.id.ModuleIdentification;\r
import org.tianocore.build.id.PackageIdentification;\r
import org.tianocore.build.id.PlatformIdentification;\r
import org.tianocore.build.id.ModuleIdentification;\r
import org.tianocore.build.id.PackageIdentification;\r
import org.tianocore.build.id.PlatformIdentification;\r
-import org.tianocore.pcd.entity.MemoryDatabaseManager;\r
import org.tianocore.build.toolchain.ToolChainAttribute;\r
import org.tianocore.build.toolchain.ToolChainConfig;\r
import org.tianocore.build.toolchain.ToolChainElement;\r
import org.tianocore.build.toolchain.ToolChainInfo;\r
import org.tianocore.build.toolchain.ToolChainKey;\r
import org.tianocore.build.toolchain.ToolChainMap;\r
import org.tianocore.build.toolchain.ToolChainAttribute;\r
import org.tianocore.build.toolchain.ToolChainConfig;\r
import org.tianocore.build.toolchain.ToolChainElement;\r
import org.tianocore.build.toolchain.ToolChainInfo;\r
import org.tianocore.build.toolchain.ToolChainKey;\r
import org.tianocore.build.toolchain.ToolChainMap;\r
-import org.tianocore.exception.EdkException;\r
-import org.tianocore.logger.EdkLog;\r
\r
/**\r
GlobalData provide initializing, instoring, querying and update global data.\r
It is a bridge to intercommunicate between multiple component, such as AutoGen,\r
\r
/**\r
GlobalData provide initializing, instoring, querying and update global data.\r
It is a bridge to intercommunicate between multiple component, such as AutoGen,\r
- PCD and so on. \r
- \r
- <p>Note that all global information are initialized incrementally. All data will \r
+ PCD and so on.\r
+\r
+ <p>Note that all global information are initialized incrementally. All data will\r
parse and record only of necessary during build time. </p>\r
parse and record only of necessary during build time. </p>\r
@since GenBuild 1.0\r
**/\r
public class GlobalData {\r
\r
public static Logger log = Logger.getAnonymousLogger();\r
@since GenBuild 1.0\r
**/\r
public class GlobalData {\r
\r
public static Logger log = Logger.getAnonymousLogger();\r
///\r
/// Record current WORKSPACE Directory\r
///\r
private static String workspaceDir = "";\r
///\r
/// Record current WORKSPACE Directory\r
///\r
private static String workspaceDir = "";\r
///\r
/// Be used to ensure Global data will be initialized only once.\r
///\r
private static boolean globalFlag = false;\r
///\r
/// Be used to ensure Global data will be initialized only once.\r
///\r
private static boolean globalFlag = false;\r
///\r
/// Framework Database information: package list and platform list\r
///\r
///\r
/// Framework Database information: package list and platform list\r
///\r
- private static Set<PackageIdentification> packageList = new HashSet<PackageIdentification>(); \r
+ private static Set<PackageIdentification> packageList = new HashSet<PackageIdentification>();\r
\r
private static Set<PlatformIdentification> platformList = new HashSet<PlatformIdentification>();\r
\r
\r
private static Set<PlatformIdentification> platformList = new HashSet<PlatformIdentification>();\r
\r
private static XmlObject fpdBuildOptions;\r
\r
private static XmlObject fpdDynamicPcds;\r
private static XmlObject fpdBuildOptions;\r
\r
private static XmlObject fpdDynamicPcds;\r
///\r
/// Parsed modules list\r
///\r
private static Map<FpdModuleIdentification, Map<String, XmlObject>> parsedModules = new HashMap<FpdModuleIdentification, Map<String, XmlObject>>();\r
///\r
/// Parsed modules list\r
///\r
private static Map<FpdModuleIdentification, Map<String, XmlObject>> parsedModules = new HashMap<FpdModuleIdentification, Map<String, XmlObject>>();\r
///\r
/// built modules list with ARCH, TARGET, TOOLCHAIN\r
///\r
private static Set<FpdModuleIdentification> builtModules = new HashSet<FpdModuleIdentification>();\r
///\r
/// built modules list with ARCH, TARGET, TOOLCHAIN\r
///\r
private static Set<FpdModuleIdentification> builtModules = new HashSet<FpdModuleIdentification>();\r
///\r
/// PCD memory database stored all PCD information which collected from FPD,MSA and SPD.\r
///\r
///\r
/// PCD memory database stored all PCD information which collected from FPD,MSA and SPD.\r
///\r
/// toolsDef - build tool program information\r
/// fpdBuildOption - all modules's build options for tool tag or tool chain families\r
/// moduleSaBuildOption - build options for a specific module\r
/// toolsDef - build tool program information\r
/// fpdBuildOption - all modules's build options for tool tag or tool chain families\r
/// moduleSaBuildOption - build options for a specific module\r
private static ToolChainConfig toolsDef;\r
\r
private static ToolChainInfo toolChainInfo;\r
private static ToolChainConfig toolsDef;\r
\r
private static ToolChainInfo toolChainInfo;\r
/**\r
Parse framework database (DB) and all SPD files listed in DB to initialize\r
the environment for next build. This method will only be executed only once\r
/**\r
Parse framework database (DB) and all SPD files listed in DB to initialize\r
the environment for next build. This method will only be executed only once\r
- in the whole build process. \r
- \r
+ in the whole build process.\r
+\r
@param workspaceDatabaseFile the file name of framework database\r
@param workspaceDir current workspace directory path\r
@throws BuildException\r
@param workspaceDatabaseFile the file name of framework database\r
@param workspaceDir current workspace directory path\r
@throws BuildException\r
}\r
globalFlag = true;\r
\r
}\r
globalFlag = true;\r
\r
// Backup workspace directory. It will be used by other method\r
//\r
GlobalData.workspaceDir = workspaceDir.replaceAll("(\\\\)", "/");\r
// Backup workspace directory. It will be used by other method\r
//\r
GlobalData.workspaceDir = workspaceDir.replaceAll("(\\\\)", "/");\r
//\r
// Parse tools definition file\r
//\r
//\r
// Parse tools definition file\r
//\r
File toolsDefFile = new File(workspaceDir + File.separatorChar + toolsDefFilename);\r
System.out.println("Using tool definiton file [" + toolsDefFile.getPath() + "].");\r
toolsDef = new ToolChainConfig(toolsDefFile);\r
File toolsDefFile = new File(workspaceDir + File.separatorChar + toolsDefFilename);\r
System.out.println("Using tool definiton file [" + toolsDefFile.getPath() + "].");\r
toolsDef = new ToolChainConfig(toolsDefFile);\r
//\r
// Parse Framework Database\r
//\r
//\r
// Parse Framework Database\r
//\r
throw new BuildException("Parse WORKSPACE Database file [" + dbFile.getPath() + "] Error.\n" + e.getMessage());\r
}\r
}\r
throw new BuildException("Parse WORKSPACE Database file [" + dbFile.getPath() + "] Error.\n" + e.getMessage());\r
}\r
}\r
- Get the current WORKSPACE Directory. \r
- \r
+ Get the current WORKSPACE Directory.\r
+\r
@return current workspace directory\r
**/\r
public synchronized static String getWorkspacePath() {\r
@return current workspace directory\r
**/\r
public synchronized static String getWorkspacePath() {\r
public synchronized static File getMsaFile(ModuleIdentification moduleId) throws BuildException {\r
File msaFile = null;\r
//\r
public synchronized static File getMsaFile(ModuleIdentification moduleId) throws BuildException {\r
File msaFile = null;\r
//\r
- // TBD. Do only when package is null. \r
+ // TBD. Do only when package is null.\r
//\r
Iterator iter = packageList.iterator();\r
while (iter.hasNext()) {\r
//\r
Iterator iter = packageList.iterator();\r
while (iter.hasNext()) {\r
if (moduleId.getPackage() != null) {\r
return moduleId.getPackage();\r
}\r
if (moduleId.getPackage() != null) {\r
return moduleId.getPackage();\r
}\r
PackageIdentification packageId = null;\r
Iterator iter = packageList.iterator();\r
while (iter.hasNext()) {\r
PackageIdentification packageId = null;\r
Iterator iter = packageList.iterator();\r
while (iter.hasNext()) {\r
return packageId;\r
}\r
}\r
return packageId;\r
}\r
}\r
/**\r
Difference between build and parse: ToolChain and Target\r
**/\r
public synchronized static boolean isModuleBuilt(FpdModuleIdentification moduleId) {\r
return builtModules.contains(moduleId);\r
}\r
/**\r
Difference between build and parse: ToolChain and Target\r
**/\r
public synchronized static boolean isModuleBuilt(FpdModuleIdentification moduleId) {\r
return builtModules.contains(moduleId);\r
}\r
public synchronized static void registerBuiltModule(FpdModuleIdentification fpdModuleId) {\r
builtModules.add(fpdModuleId);\r
}\r
\r
public synchronized static void registerBuiltModule(FpdModuleIdentification fpdModuleId) {\r
builtModules.add(fpdModuleId);\r
}\r
\r
public synchronized static void registerFpdModuleSA(FpdModuleIdentification fpdModuleId, Map<String, XmlObject> doc) {\r
Map<String, XmlObject> result = new HashMap<String, XmlObject>();\r
Set keySet = doc.keySet();\r
public synchronized static void registerFpdModuleSA(FpdModuleIdentification fpdModuleId, Map<String, XmlObject> doc) {\r
Map<String, XmlObject> result = new HashMap<String, XmlObject>();\r
Set keySet = doc.keySet();\r
\r
/**\r
Query overrided module surface area information. If current is Package\r
\r
/**\r
Query overrided module surface area information. If current is Package\r
- or Platform build, also include the information from FPD file. \r
- \r
- <p>Note that surface area parsing is incremental. That means the method will \r
+ or Platform build, also include the information from FPD file.\r
+\r
+ <p>Note that surface area parsing is incremental. That means the method will\r
only parse the MSA and MBD files if necessary. </p>\r
only parse the MSA and MBD files if necessary. </p>\r
@param moduleName the base name of the module\r
@return the overrided module surface area information\r
@throws BuildException\r
@param moduleName the base name of the module\r
@return the overrided module surface area information\r
@throws BuildException\r
// First part: get the MSA files info\r
//\r
doc.putAll(getNativeMsa(moduleId));\r
// First part: get the MSA files info\r
//\r
doc.putAll(getNativeMsa(moduleId));\r
//\r
// Second part: put build options\r
//\r
doc.put("BuildOptions", fpdBuildOptions);\r
//\r
// Second part: put build options\r
//\r
doc.put("BuildOptions", fpdBuildOptions);\r
//\r
// Third part: get Module info from FPD, such as Library instances, PCDs\r
//\r
//\r
// Third part: get Module info from FPD, such as Library instances, PCDs\r
//\r
return getDoc(fpdModuleId);\r
}\r
/**\r
return getDoc(fpdModuleId);\r
}\r
/**\r
- Query the native MSA information with module base name. \r
- \r
- <p>Note that MSA parsing is incremental. That means the method will \r
+ Query the native MSA information with module base name.\r
+\r
+ <p>Note that MSA parsing is incremental. That means the method will\r
only to parse the MSA files when never parsed before. </p>\r
only to parse the MSA files when never parsed before. </p>\r
@param moduleName the base name of the module\r
@return the native MSA information\r
@throws BuildException\r
@param moduleName the base name of the module\r
@return the native MSA information\r
@throws BuildException\r
nativeMsa.put(moduleId, msaMap);\r
return msaMap;\r
}\r
nativeMsa.put(moduleId, msaMap);\r
return msaMap;\r
}\r
public synchronized static Map<String, XmlObject> getNativeMsa(File msaFile) throws BuildException {\r
if (! msaFile.exists()) {\r
throw new BuildException("Module Surface Area file [" + msaFile.getPath() + "] can't be found!");\r
public synchronized static Map<String, XmlObject> getNativeMsa(File msaFile) throws BuildException {\r
if (! msaFile.exists()) {\r
throw new BuildException("Module Surface Area file [" + msaFile.getPath() + "] can't be found!");\r
throw new BuildException(ex.getMessage());\r
}\r
}\r
throw new BuildException(ex.getMessage());\r
}\r
}\r
public static Map<String, XmlObject> getFpdBuildOptions() {\r
Map<String, XmlObject> map = new HashMap<String, XmlObject>();\r
map.put("BuildOptions", fpdBuildOptions);\r
return map;\r
}\r
public static Map<String, XmlObject> getFpdBuildOptions() {\r
Map<String, XmlObject> map = new HashMap<String, XmlObject>();\r
map.put("BuildOptions", fpdBuildOptions);\r
return map;\r
}\r
public static void setFpdBuildOptions(XmlObject fpdBuildOptions) {\r
GlobalData.fpdBuildOptions = cloneXmlObject(fpdBuildOptions, true);\r
}\r
public static void setFpdBuildOptions(XmlObject fpdBuildOptions) {\r
GlobalData.fpdBuildOptions = cloneXmlObject(fpdBuildOptions, true);\r
}\r
\r
//////////////////////////////////////////////\r
//////////////////////////////////////////////\r
\r
//////////////////////////////////////////////\r
//////////////////////////////////////////////\r
public static Set<ModuleIdentification> getModules(PackageIdentification packageId){\r
Spd spd = spdTable.get(packageId);\r
if (spd == null ) {\r
public static Set<ModuleIdentification> getModules(PackageIdentification packageId){\r
Spd spd = spdTable.get(packageId);\r
if (spd == null ) {\r
public synchronized static PlatformIdentification getPlatformByName(String name) throws BuildException {\r
Iterator iter = platformList.iterator();\r
while(iter.hasNext()){\r
public synchronized static PlatformIdentification getPlatformByName(String name) throws BuildException {\r
Iterator iter = platformList.iterator();\r
while(iter.hasNext()){\r
}\r
throw new BuildException("Can't find platform [" + name + "] in the current WORKSPACE database!");\r
}\r
}\r
throw new BuildException("Can't find platform [" + name + "] in the current WORKSPACE database!");\r
}\r
public synchronized static PlatformIdentification getPlatform(String filename) throws BuildException {\r
File file = new File(workspaceDir + File.separatorChar + filename);\r
Iterator iter = platformList.iterator();\r
public synchronized static PlatformIdentification getPlatform(String filename) throws BuildException {\r
File file = new File(workspaceDir + File.separatorChar + filename);\r
Iterator iter = platformList.iterator();\r
}\r
throw new BuildException("Can't find platform file [" + filename + "] in the current WORKSPACE database!");\r
}\r
}\r
throw new BuildException("Can't find platform file [" + filename + "] in the current WORKSPACE database!");\r
}\r
public synchronized static PackageIdentification refreshPackageIdentification(PackageIdentification packageId) throws BuildException {\r
Iterator iter = packageList.iterator();\r
while(iter.hasNext()){\r
public synchronized static PackageIdentification refreshPackageIdentification(PackageIdentification packageId) throws BuildException {\r
Iterator iter = packageList.iterator();\r
while(iter.hasNext()){\r
}\r
throw new BuildException("Can't find package GUID value " + packageId.getGuid() + " in the current workspace!");\r
}\r
}\r
throw new BuildException("Can't find package GUID value " + packageId.getGuid() + " in the current workspace!");\r
}\r
public synchronized static ModuleIdentification refreshModuleIdentification(ModuleIdentification moduleId) throws BuildException {\r
// System.out.println("1");\r
// System.out.println("##" + moduleId.getGuid());\r
public synchronized static ModuleIdentification refreshModuleIdentification(ModuleIdentification moduleId) throws BuildException {\r
// System.out.println("1");\r
// System.out.println("##" + moduleId.getGuid());\r
}\r
throw new BuildException("Can't find module GUID value " + moduleId.getGuid() + " in package, " + packageId + ", in the current workspace!");\r
}\r
}\r
throw new BuildException("Can't find module GUID value " + moduleId.getGuid() + " in package, " + packageId + ", in the current workspace!");\r
}\r
public synchronized static Set<PackageIdentification> getPackageList(){\r
return packageList;\r
}\r
public synchronized static Set<PackageIdentification> getPackageList(){\r
return packageList;\r
}\r
\r
public static String getCommandSetting(String[] commandDescription, FpdModuleIdentification fpdModuleId) throws EdkException {\r
ToolChainKey toolChainKey = new ToolChainKey(commandDescription);\r
\r
public static String getCommandSetting(String[] commandDescription, FpdModuleIdentification fpdModuleId) throws EdkException {\r
ToolChainKey toolChainKey = new ToolChainKey(commandDescription);\r
- ToolChainMap toolChainConfig = toolsDef.getConfig(); \r
+ ToolChainMap toolChainConfig = toolsDef.getConfig();\r
String setting = null;\r
\r
if (!commandDescription[ToolChainElement.ATTRIBUTE.value].equals(ToolChainAttribute.FLAGS.toString())) {\r
String setting = null;\r
\r
if (!commandDescription[ToolChainElement.ATTRIBUTE.value].equals(ToolChainAttribute.FLAGS.toString())) {\r
toolChainFamilyKey.setKey(ToolChainAttribute.FLAGS.toString(), ToolChainElement.ATTRIBUTE.value);\r
\r
option = moduleToolChainFamilyOption.get(fpdModuleId);\r
toolChainFamilyKey.setKey(ToolChainAttribute.FLAGS.toString(), ToolChainElement.ATTRIBUTE.value);\r
\r
option = moduleToolChainFamilyOption.get(fpdModuleId);\r
- if (option != null) { \r
+ if (option != null) {\r
setting = option.get(toolChainFamilyKey);\r
}\r
}\r
setting = option.get(toolChainFamilyKey);\r
}\r
}\r
public static void setToolChainEnvInfo(ToolChainInfo envInfo) {\r
toolChainEnvInfo = envInfo;\r
}\r
public static void setToolChainEnvInfo(ToolChainInfo envInfo) {\r
toolChainEnvInfo = envInfo;\r
}\r
- public synchronized static Map<FpdModuleIdentification, XmlObject> \r
+ public synchronized static Map<FpdModuleIdentification, XmlObject>\r
getFpdModuleSaXmlObject(String xmlObjectName) {\r
Set<FpdModuleIdentification> fpdModuleSASet = fpdModuleSA.keySet();\r
Iterator item = fpdModuleSASet.iterator();\r
getFpdModuleSaXmlObject(String xmlObjectName) {\r
Set<FpdModuleIdentification> fpdModuleSASet = fpdModuleSA.keySet();\r
Iterator item = fpdModuleSASet.iterator();\r
\r
Map<FpdModuleIdentification, XmlObject> SAPcdBuildDef = new HashMap<FpdModuleIdentification, XmlObject>();\r
Map<String, XmlObject> SANode = new HashMap<String, XmlObject>();\r
FpdModuleIdentification moduleId;\r
while (item.hasNext()) {\r
\r
Map<FpdModuleIdentification, XmlObject> SAPcdBuildDef = new HashMap<FpdModuleIdentification, XmlObject>();\r
Map<String, XmlObject> SANode = new HashMap<String, XmlObject>();\r
FpdModuleIdentification moduleId;\r
while (item.hasNext()) {\r
moduleId = (FpdModuleIdentification) item.next();\r
SANode = fpdModuleSA.get(moduleId);\r
try{\r
moduleId = (FpdModuleIdentification) item.next();\r
SANode = fpdModuleSA.get(moduleId);\r
try{\r
import java.util.regex.Matcher;\r
import java.util.regex.Pattern;\r
\r
import java.util.regex.Matcher;\r
import java.util.regex.Pattern;\r
\r
+import org.w3c.dom.Node;\r
+\r
import org.apache.xmlbeans.XmlObject;\r
import org.apache.xmlbeans.XmlString;\r
import org.apache.xmlbeans.XmlObject;\r
import org.apache.xmlbeans.XmlString;\r
import org.tianocore.BuildOptionsDocument;\r
import org.tianocore.CNameType;\r
import org.tianocore.ExternsDocument;\r
import org.tianocore.BuildOptionsDocument;\r
import org.tianocore.CNameType;\r
import org.tianocore.ExternsDocument;\r
import org.tianocore.MsaHeaderDocument.MsaHeader;\r
import org.tianocore.ProtocolsDocument.Protocols.Protocol;\r
import org.tianocore.ProtocolsDocument.Protocols.ProtocolNotify;\r
import org.tianocore.MsaHeaderDocument.MsaHeader;\r
import org.tianocore.ProtocolsDocument.Protocols.Protocol;\r
import org.tianocore.ProtocolsDocument.Protocols.ProtocolNotify;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
import org.tianocore.build.id.FpdModuleIdentification;\r
import org.tianocore.build.id.ModuleIdentification;\r
import org.tianocore.build.id.PackageIdentification;\r
import org.tianocore.build.id.PlatformIdentification;\r
import org.tianocore.build.toolchain.ToolChainInfo;\r
import org.tianocore.build.id.FpdModuleIdentification;\r
import org.tianocore.build.id.ModuleIdentification;\r
import org.tianocore.build.id.PackageIdentification;\r
import org.tianocore.build.id.PlatformIdentification;\r
import org.tianocore.build.toolchain.ToolChainInfo;\r
-import org.tianocore.logger.EdkLog;\r
-import org.w3c.dom.Node;\r
\r
/**\r
* SurfaceAreaQuery class is used to query Surface Area information from msa,\r
* mbd, spd and fpd files.\r
\r
/**\r
* SurfaceAreaQuery class is used to query Surface Area information from msa,\r
* mbd, spd and fpd files.\r
* This class should not instantiated. All the public interfaces is static.\r
* This class should not instantiated. All the public interfaces is static.\r
* @since GenBuild 1.0\r
*/\r
public class SurfaceAreaQuery {\r
* @since GenBuild 1.0\r
*/\r
public class SurfaceAreaQuery {\r
\r
/**\r
* Set a Surface Area document for query later\r
\r
/**\r
* Set a Surface Area document for query later\r
* @param map\r
* A Surface Area document in TopLevelElementName/XmlObject\r
* format.\r
* @param map\r
* A Surface Area document in TopLevelElementName/XmlObject\r
* format.\r
* Push current used Surface Area document into query stack. The given new\r
* document will be used for any immediately followed getXXX() callings,\r
* untill pop() is called.\r
* Push current used Surface Area document into query stack. The given new\r
* document will be used for any immediately followed getXXX() callings,\r
* untill pop() is called.\r
* @param newMap\r
* The TopLevelElementName/XmlObject format of a Surface Area\r
* document.\r
* @param newMap\r
* The TopLevelElementName/XmlObject format of a Surface Area\r
* document.\r
/**\r
* Search all XML documents stored in "map" for the specified xPath, using\r
* relative path (starting with '$this')\r
/**\r
* Search all XML documents stored in "map" for the specified xPath, using\r
* relative path (starting with '$this')\r
* @param xPath\r
* xpath query string array\r
* @returns An array of XmlObject if elements are found at the specified\r
* @param xPath\r
* xpath query string array\r
* @returns An array of XmlObject if elements are found at the specified\r
/**\r
* Search XML documents named by "rootName" for the given xPath, using\r
* relative path (starting with '$this')\r
/**\r
* Search XML documents named by "rootName" for the given xPath, using\r
* relative path (starting with '$this')\r
* @param rootName\r
* The top level element name\r
* @param xPath\r
* @param rootName\r
* The top level element name\r
* @param xPath\r
\r
/**\r
* Retrieve SourceFiles/Filename for specified ARCH type\r
\r
/**\r
* Retrieve SourceFiles/Filename for specified ARCH type\r
* @param arch\r
* architecture name\r
* @returns An 2 dimension string array if elements are found at the known\r
* @param arch\r
* architecture name\r
* @returns An 2 dimension string array if elements are found at the known\r
outputList.add(new String[] {sourceFileNames[i].getToolCode(),sourceFileNames[i].getStringValue()});\r
}\r
}\r
outputList.add(new String[] {sourceFileNames[i].getToolCode(),sourceFileNames[i].getStringValue()});\r
}\r
}\r
String[][] outputString = new String[outputList.size()][2];\r
for (int index = 0; index < outputList.size(); index++) {\r
outputString[index][0] = outputList.get(index)[0];\r
String[][] outputString = new String[outputList.size()][2];\r
for (int index = 0; index < outputList.size(); index++) {\r
outputString[index][0] = outputList.get(index)[0];\r
\r
/**\r
* Retrieve /PlatformDefinitions/OutputDirectory from FPD\r
\r
/**\r
* Retrieve /PlatformDefinitions/OutputDirectory from FPD\r
* @returns Directory names array if elements are found at the known xpath\r
* @returns Empty if nothing is found at the known xpath\r
*/\r
* @returns Directory names array if elements are found at the known xpath\r
* @returns Empty if nothing is found at the known xpath\r
*/\r
}\r
PlatformDefinitionsDocument.PlatformDefinitions item = (PlatformDefinitionsDocument.PlatformDefinitions)returns[0];\r
if(item.getIntermediateDirectories() == null) {\r
}\r
PlatformDefinitionsDocument.PlatformDefinitions item = (PlatformDefinitionsDocument.PlatformDefinitions)returns[0];\r
if(item.getIntermediateDirectories() == null) {\r
}\r
else {\r
return item.getIntermediateDirectories().toString();\r
}\r
else {\r
return item.getIntermediateDirectories().toString();\r
ModuleSaBuildOptionsDocument.ModuleSaBuildOptions item = (ModuleSaBuildOptionsDocument.ModuleSaBuildOptions)returns[0];\r
return item.getFfsFormatKey();\r
}\r
ModuleSaBuildOptionsDocument.ModuleSaBuildOptions item = (ModuleSaBuildOptionsDocument.ModuleSaBuildOptions)returns[0];\r
return item.getFfsFormatKey();\r
}\r
public static String getModuleFvBindingKeyword() {\r
String[] xPath = new String[] { "/" };\r
\r
public static String getModuleFvBindingKeyword() {\r
String[] xPath = new String[] { "/" };\r
\r
ModuleSaBuildOptionsDocument.ModuleSaBuildOptions item = (ModuleSaBuildOptionsDocument.ModuleSaBuildOptions)returns[0];\r
return item.getFvBinding();\r
}\r
ModuleSaBuildOptionsDocument.ModuleSaBuildOptions item = (ModuleSaBuildOptionsDocument.ModuleSaBuildOptions)returns[0];\r
return item.getFvBinding();\r
}\r
public static List getModuleSupportedArchs() {\r
String[] xPath = new String[] { "/" };\r
\r
public static List getModuleSupportedArchs() {\r
String[] xPath = new String[] { "/" };\r
\r
ModuleDefinitionsDocument.ModuleDefinitions item = (ModuleDefinitionsDocument.ModuleDefinitions)returns[0];\r
return item.getSupportedArchitectures();\r
}\r
ModuleDefinitionsDocument.ModuleDefinitions item = (ModuleDefinitionsDocument.ModuleDefinitions)returns[0];\r
return item.getSupportedArchitectures();\r
}\r
public static BuildOptionsDocument.BuildOptions.Ffs[] getFpdFfs() {\r
String[] xPath = new String[] {"/Ffs"};\r
public static BuildOptionsDocument.BuildOptions.Ffs[] getFpdFfs() {\r
String[] xPath = new String[] {"/Ffs"};\r
Object[] returns = get("BuildOptions", xPath);\r
if (returns == null || returns.length == 0) {\r
return new BuildOptionsDocument.BuildOptions.Ffs[0];\r
}\r
return (BuildOptionsDocument.BuildOptions.Ffs[])returns;\r
}\r
Object[] returns = get("BuildOptions", xPath);\r
if (returns == null || returns.length == 0) {\r
return new BuildOptionsDocument.BuildOptions.Ffs[0];\r
}\r
return (BuildOptionsDocument.BuildOptions.Ffs[])returns;\r
}\r
public static String getModuleOutputFileBasename() {\r
String[] xPath = new String[] { "/" };\r
\r
public static String getModuleOutputFileBasename() {\r
String[] xPath = new String[] { "/" };\r
\r
ModuleDefinitionsDocument.ModuleDefinitions item = (ModuleDefinitionsDocument.ModuleDefinitions)returns[0];\r
return item.getOutputFileBasename();\r
}\r
ModuleDefinitionsDocument.ModuleDefinitions item = (ModuleDefinitionsDocument.ModuleDefinitions)returns[0];\r
return item.getOutputFileBasename();\r
}\r
/**\r
* Retrieve BuildOptions/Option or Arch/Option\r
/**\r
* Retrieve BuildOptions/Option or Arch/Option\r
* @param toolChainFamilyFlag\r
* if true, retrieve options for toolchain family; otherwise for\r
* toolchain\r
* @param toolChainFamilyFlag\r
* if true, retrieve options for toolchain family; otherwise for\r
* toolchain\r
* @returns String[][5] name, target, toolchain, arch, coommand of options\r
* if elements are found at the known xpath. String[0][] if dont\r
* find element.\r
* @returns String[][5] name, target, toolchain, arch, coommand of options\r
* if elements are found at the known xpath. String[0][] if dont\r
* find element.\r
* @returns Empty array if nothing is there\r
*/\r
public static String[][] getOptions(String from, String[] xPath, boolean toolChainFamilyFlag) {\r
* @returns Empty array if nothing is there\r
*/\r
public static String[][] getOptions(String from, String[] xPath, boolean toolChainFamilyFlag) {\r
}\r
\r
archList = new ArrayList<String>();\r
}\r
\r
archList = new ArrayList<String>();\r
- List archEnumList = option.getSupArchList(); \r
+ List archEnumList = option.getSupArchList();\r
if (archEnumList == null) {\r
archList.add(null);\r
} else {\r
if (archEnumList == null) {\r
archList.add(null);\r
} else {\r
\r
public static String[][] getModuleBuildOptions(boolean toolChainFamilyFlag) {\r
String[] xPath;\r
\r
public static String[][] getModuleBuildOptions(boolean toolChainFamilyFlag) {\r
String[] xPath;\r
if (toolChainFamilyFlag == true) {\r
xPath = new String[] {\r
"/Options/Option[not(@ToolChainFamily) and not(@TagName)]",\r
if (toolChainFamilyFlag == true) {\r
xPath = new String[] {\r
"/Options/Option[not(@ToolChainFamily) and not(@TagName)]",\r
"/Options/Option[@TagName]", };\r
}\r
return getOptions("ModuleSaBuildOptions", xPath, toolChainFamilyFlag);\r
"/Options/Option[@TagName]", };\r
}\r
return getOptions("ModuleSaBuildOptions", xPath, toolChainFamilyFlag);\r
public static String[][] getPlatformBuildOptions(boolean toolChainFamilyFlag) {\r
String[] xPath;\r
\r
public static String[][] getPlatformBuildOptions(boolean toolChainFamilyFlag) {\r
String[] xPath;\r
\r
if (returns == null || returns.length == 0) {\r
return null;\r
}\r
if (returns == null || returns.length == 0) {\r
return null;\r
}\r
PlatformDefinitionsDocument.PlatformDefinitions item = (PlatformDefinitionsDocument.PlatformDefinitions)returns[0];\r
ToolChainInfo toolChainInfo = new ToolChainInfo();\r
toolChainInfo.addTargets(item.getBuildTargets().toString());\r
PlatformDefinitionsDocument.PlatformDefinitions item = (PlatformDefinitionsDocument.PlatformDefinitions)returns[0];\r
ToolChainInfo toolChainInfo = new ToolChainInfo();\r
toolChainInfo.addTargets(item.getBuildTargets().toString());\r
\r
/**\r
* Retrieve <xxxHeader>/ModuleType\r
\r
/**\r
* Retrieve <xxxHeader>/ModuleType\r
* @returns The module type name if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
* @returns The module type name if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
\r
/**\r
* Retrieve PackageDependencies/Package\r
\r
/**\r
* Retrieve PackageDependencies/Package\r
* @param arch\r
* Architecture name\r
* @param arch\r
* Architecture name\r
* @returns package name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
* @returns package name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
String packageGuid = null;\r
String packageVersion = null;\r
\r
String packageGuid = null;\r
String packageVersion = null;\r
\r
xPath = new String[] { "/Package" };\r
xPath = new String[] { "/Package" };\r
Object[] returns = get("PackageDependencies", xPath);\r
if (returns == null) {\r
return new PackageIdentification[0];\r
}\r
\r
//\r
Object[] returns = get("PackageDependencies", xPath);\r
if (returns == null) {\r
return new PackageIdentification[0];\r
}\r
\r
//\r
- // Get packageIdentification \r
- // \r
+ // Get packageIdentification\r
+ //\r
List<PackageIdentification> packageIdList = new ArrayList<PackageIdentification>();\r
for (int i = 0; i < returns.length; i++) {\r
PackageDependenciesDocument.PackageDependencies.Package item = (PackageDependenciesDocument.PackageDependencies.Package) returns[i];\r
List<PackageIdentification> packageIdList = new ArrayList<PackageIdentification>();\r
for (int i = 0; i < returns.length; i++) {\r
PackageDependenciesDocument.PackageDependencies.Package item = (PackageDependenciesDocument.PackageDependencies.Package) returns[i];\r
\r
//\r
// transfer packageIdentification list to array.\r
\r
//\r
// transfer packageIdentification list to array.\r
PackageIdentification[] packageIdArray = new PackageIdentification[packageIdList.size()];\r
for (int i = 0; i < packageIdList.size(); i++) {\r
packageIdArray[i] = new PackageIdentification(null, packageIdList.get(i).getGuid(),packageIdList.get(i).getVersion());\r
PackageIdentification[] packageIdArray = new PackageIdentification[packageIdList.size()];\r
for (int i = 0; i < packageIdList.size(); i++) {\r
packageIdArray[i] = new PackageIdentification(null, packageIdList.get(i).getGuid(),packageIdList.get(i).getVersion());\r
\r
/**\r
* Retrieve LibraryClassDefinitions/LibraryClass for specified usage\r
\r
/**\r
* Retrieve LibraryClassDefinitions/LibraryClass for specified usage\r
* @param usage\r
* Library class usage\r
* @param usage\r
* Library class usage\r
* @returns LibraryClass objects list if elements are found at the known\r
* xpath\r
* @returns null if nothing is there\r
* @returns LibraryClass objects list if elements are found at the known\r
* xpath\r
* @returns null if nothing is there\r
List<String> libraryClassName = new ArrayList<String>();\r
for (int i = 0; i < libraryClassList.length; i++) {\r
List archList = libraryClassList[i].getSupArchList();\r
List<String> libraryClassName = new ArrayList<String>();\r
for (int i = 0; i < libraryClassList.length; i++) {\r
List archList = libraryClassList[i].getSupArchList();\r
if (arch == null || contains(archList, arch)) {\r
libraryClassName.add(libraryClassList[i].getKeyword());\r
}\r
if (arch == null || contains(archList, arch)) {\r
libraryClassName.add(libraryClassList[i].getKeyword());\r
}\r
\r
/**\r
* Retrieve ModuleEntryPoint names\r
\r
/**\r
* Retrieve ModuleEntryPoint names\r
* @returns ModuleEntryPoint name list if elements are found at the known\r
* xpath\r
* @returns null if nothing is there\r
* @returns ModuleEntryPoint name list if elements are found at the known\r
* xpath\r
* @returns null if nothing is there\r
\r
/**\r
* retrieve Protocol for specified usage\r
\r
/**\r
* retrieve Protocol for specified usage\r
* @param usage\r
* Protocol usage arch Architecture\r
* @param usage\r
* Protocol usage arch Architecture\r
* @returns Protocol String list if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
* @returns Protocol String list if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
\r
/**\r
* retrieve Protocol for specified usage\r
\r
/**\r
* retrieve Protocol for specified usage\r
* @param arch\r
* Architecture\r
* @param arch\r
* Architecture\r
* @returns Protocol String list if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
* @returns Protocol String list if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
Protocol[] returnlList = (Protocol[]) returns;\r
\r
List<String> protocolList = new ArrayList<String>();\r
Protocol[] returnlList = (Protocol[]) returns;\r
\r
List<String> protocolList = new ArrayList<String>();\r
for (int i = 0; i < returns.length; i++) {\r
List archList = returnlList[i].getSupArchList();\r
if (archList == null || contains(archList, arch)){\r
for (int i = 0; i < returns.length; i++) {\r
List archList = returnlList[i].getSupArchList();\r
if (archList == null || contains(archList, arch)){\r
\r
/**\r
* Retrieve ProtocolNotify for specified usage\r
\r
/**\r
* Retrieve ProtocolNotify for specified usage\r
* @param usage\r
* ProtocolNotify usage\r
* @param usage\r
* ProtocolNotify usage\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
}\r
\r
List<String> protocolNotifyList = new ArrayList<String>();\r
}\r
\r
List<String> protocolNotifyList = new ArrayList<String>();\r
for (int i = 0; i < returns.length; i++) {\r
List archList = ((ProtocolNotify) returns[i]).getSupArchList();\r
if (archList == null || contains(archList, arch)){\r
protocolNotifyList.add(((ProtocolNotify) returns[i]).getProtocolNotifyCName());\r
}\r
for (int i = 0; i < returns.length; i++) {\r
List archList = ((ProtocolNotify) returns[i]).getSupArchList();\r
if (archList == null || contains(archList, arch)){\r
protocolNotifyList.add(((ProtocolNotify) returns[i]).getProtocolNotifyCName());\r
}\r
}\r
String[] protocolNotifyArray = new String[protocolNotifyList.size()];\r
for (int i = 0; i < protocolNotifyList.size(); i++) {\r
}\r
String[] protocolNotifyArray = new String[protocolNotifyList.size()];\r
for (int i = 0; i < protocolNotifyList.size(); i++) {\r
\r
/**\r
* Retrieve ProtocolNotify for specified usage\r
\r
/**\r
* Retrieve ProtocolNotify for specified usage\r
* @param usage\r
* ProtocolNotify usage\r
* @param usage\r
* ProtocolNotify usage\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
\r
/**\r
* Retrieve ModuleUnloadImage names\r
\r
/**\r
* Retrieve ModuleUnloadImage names\r
* @returns ModuleUnloadImage name list if elements are found at the known\r
* xpath\r
* @returns null if nothing is there\r
* @returns ModuleUnloadImage name list if elements are found at the known\r
* xpath\r
* @returns null if nothing is there\r
\r
/**\r
* Retrieve Extern\r
\r
/**\r
* Retrieve Extern\r
* @returns Extern objects list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
* @returns Extern objects list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
\r
/**\r
* Retrieve PpiNotify for specified arch\r
\r
/**\r
* Retrieve PpiNotify for specified arch\r
* @param arch\r
* PpiNotify arch\r
* @param arch\r
* PpiNotify arch\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
return new String[0];\r
}\r
\r
return new String[0];\r
}\r
\r
List<String> ppiNotifyList = new ArrayList<String>();\r
for (int i = 0; i < returns.length; i++) {\r
List archList = ((PPIsDocument.PPIs.PpiNotify) returns[i]).getSupArchList();\r
if (archList == null || contains(archList, arch)){\r
List<String> ppiNotifyList = new ArrayList<String>();\r
for (int i = 0; i < returns.length; i++) {\r
List archList = ((PPIsDocument.PPIs.PpiNotify) returns[i]).getSupArchList();\r
if (archList == null || contains(archList, arch)){\r
- ppiNotifyList.add(((PPIsDocument.PPIs.PpiNotify) returns[i]).getPpiNotifyCName()); \r
+ ppiNotifyList.add(((PPIsDocument.PPIs.PpiNotify) returns[i]).getPpiNotifyCName());\r
}\r
String[] ppiNotifyArray = new String[ppiNotifyList.size()];\r
for (int i = 0; i < ppiNotifyList.size(); i++) {\r
}\r
String[] ppiNotifyArray = new String[ppiNotifyList.size()];\r
for (int i = 0; i < ppiNotifyList.size(); i++) {\r
\r
/**\r
* Retrieve PpiNotify for specified usage and arch\r
\r
/**\r
* Retrieve PpiNotify for specified usage and arch\r
* @param arch\r
* PpiNotify arch usage PpiNotify usage\r
* @param arch\r
* PpiNotify arch usage PpiNotify usage\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
\r
/**\r
* Retrieve Ppi for specified arch\r
\r
/**\r
* Retrieve Ppi for specified arch\r
* @param arch\r
* Ppi arch\r
* @param arch\r
* Ppi arch\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
for (int i = 0; i < returns.length; i++) {\r
List archList = ((PPIsDocument.PPIs.Ppi) returns[i]).getSupArchList();\r
if (archList == null || contains(archList, arch)){\r
for (int i = 0; i < returns.length; i++) {\r
List archList = ((PPIsDocument.PPIs.Ppi) returns[i]).getSupArchList();\r
if (archList == null || contains(archList, arch)){\r
- ppiList.add(((PPIsDocument.PPIs.Ppi) returns[i]).getPpiCName()); \r
+ ppiList.add(((PPIsDocument.PPIs.Ppi) returns[i]).getPpiCName());\r
}\r
String[] ppiArray = new String[ppiList.size()];\r
for (int i = 0; i < ppiList.size(); i++) {\r
}\r
String[] ppiArray = new String[ppiList.size()];\r
for (int i = 0; i < ppiList.size(); i++) {\r
\r
/**\r
* Retrieve PpiNotify for specified usage and arch\r
\r
/**\r
* Retrieve PpiNotify for specified usage and arch\r
* @param arch\r
* PpiNotify arch usage PpiNotify usage\r
* @param arch\r
* PpiNotify arch usage PpiNotify usage\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
\r
/**\r
* Retrieve GuidEntry information for specified usage\r
\r
/**\r
* Retrieve GuidEntry information for specified usage\r
* @param arch\r
* GuidEntry arch\r
* @param arch\r
* GuidEntry arch\r
* @returns GuidEntry objects list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
* @returns GuidEntry objects list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
for (int i = 0; i < returns.length; i++) {\r
List archList = ((GuidsDocument.Guids.GuidCNames) returns[i]).getSupArchList();\r
if (archList == null || contains(archList, arch)){\r
for (int i = 0; i < returns.length; i++) {\r
List archList = ((GuidsDocument.Guids.GuidCNames) returns[i]).getSupArchList();\r
if (archList == null || contains(archList, arch)){\r
- guidList.add(((GuidsDocument.Guids.GuidCNames) returns[i]).getGuidCName()); \r
+ guidList.add(((GuidsDocument.Guids.GuidCNames) returns[i]).getGuidCName());\r
}\r
String[] guidArray = new String[guidList.size()];\r
for (int i = 0; i < guidList.size(); i++) {\r
}\r
String[] guidArray = new String[guidList.size()];\r
for (int i = 0; i < guidList.size(); i++) {\r
\r
/**\r
* Retrieve GuidEntry information for specified usage\r
\r
/**\r
* Retrieve GuidEntry information for specified usage\r
* @param arch\r
* GuidEntry arch usage GuidEntry usage\r
* @param arch\r
* GuidEntry arch usage GuidEntry usage\r
* @returns GuidEntry objects list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
* @returns GuidEntry objects list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
\r
/**\r
* Retrieve Library instance information\r
\r
/**\r
* Retrieve Library instance information\r
* @param arch\r
* Architecture name\r
* @param usage\r
* Library instance usage\r
* @param arch\r
* Architecture name\r
* @param usage\r
* Library instance usage\r
* @returns library instance name list if elements are found at the known\r
* xpath\r
* @returns null if nothing is there\r
* @returns library instance name list if elements are found at the known\r
* xpath\r
* @returns null if nothing is there\r
xPath = new String[] { "/Instance" };\r
} else {\r
//\r
xPath = new String[] { "/Instance" };\r
} else {\r
//\r
- // Since Schema don't have SupArchList now, so the follow Xpath is \r
+ // Since Schema don't have SupArchList now, so the follow Xpath is\r
// equal to "/Instance" and [not(@SupArchList) or @SupArchList= arch]\r
// don't have effect.\r
//\r
// equal to "/Instance" and [not(@SupArchList) or @SupArchList= arch]\r
// don't have effect.\r
//\r
\r
/**\r
* Retrive library's constructor name\r
\r
/**\r
* Retrive library's constructor name\r
* @returns constructor name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
* @returns constructor name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
\r
/**\r
* Retrive library's destructor name\r
\r
/**\r
* Retrive library's destructor name\r
* @returns destructor name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
* @returns destructor name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
\r
/**\r
* Retrive DriverBinding names\r
\r
/**\r
* Retrive DriverBinding names\r
* @returns DriverBinding name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
* @returns DriverBinding name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
\r
/**\r
* Retrive ComponentName names\r
\r
/**\r
* Retrive ComponentName names\r
* @returns ComponentName name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
* @returns ComponentName name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
\r
/**\r
* Retrive DriverConfig names\r
\r
/**\r
* Retrive DriverConfig names\r
* @returns DriverConfig name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
* @returns DriverConfig name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
\r
/**\r
* Retrive DriverDiag names\r
\r
/**\r
* Retrive DriverDiag names\r
* @returns DriverDiag name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
* @returns DriverDiag name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
\r
/**\r
* Retrive SetVirtualAddressMapCallBack names\r
\r
/**\r
* Retrive SetVirtualAddressMapCallBack names\r
* @returns SetVirtualAddressMapCallBack name list if elements are found at\r
* the known xpath\r
* @returns null if nothing is there\r
* @returns SetVirtualAddressMapCallBack name list if elements are found at\r
* the known xpath\r
* @returns null if nothing is there\r
\r
/**\r
* Retrive ExitBootServicesCallBack names\r
\r
/**\r
* Retrive ExitBootServicesCallBack names\r
* @returns ExitBootServicesCallBack name list if elements are found at the\r
* known xpath\r
* @returns null if nothing is there\r
* @returns ExitBootServicesCallBack name list if elements are found at the\r
* known xpath\r
* @returns null if nothing is there\r
\r
/**\r
* Retrieve module surface area file information\r
\r
/**\r
* Retrieve module surface area file information\r
* @returns ModuleSA objects list if elements are found at the known xpath\r
* @returns Empty ModuleSA list if nothing is there\r
*/\r
* @returns ModuleSA objects list if elements are found at the known xpath\r
* @returns Empty ModuleSA list if nothing is there\r
*/\r
}\r
for (int j = 0; j < archList.length; j++) {\r
FpdModuleIdentification fpdSaId = new FpdModuleIdentification(saId, archList[j]);\r
}\r
for (int j = 0; j < archList.length; j++) {\r
FpdModuleIdentification fpdSaId = new FpdModuleIdentification(saId, archList[j]);\r
if (fvBinding != null) {\r
fpdSaId.setFvBinding(fvBinding);\r
}\r
if (fvBinding != null) {\r
fpdSaId.setFvBinding(fvBinding);\r
}\r
//\r
// Put element to Map<FpdModuleIdentification, Map<String,\r
// Object>>.\r
//\r
// Put element to Map<FpdModuleIdentification, Map<String,\r
// Object>>.\r
\r
/**\r
* Retrieve valid image names\r
\r
/**\r
* Retrieve valid image names\r
* @returns valid iamges name list if elements are found at the known xpath\r
* @returns empty list if nothing is there\r
*/\r
* @returns valid iamges name list if elements are found at the known xpath\r
* @returns empty list if nothing is there\r
*/\r
public static Node getFpdUserExtensionPreBuild() {\r
public static Node getFpdUserExtensionPreBuild() {\r
- String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='0']" }; \r
+ String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='0']" };\r
\r
Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
if (queryResult == null || queryResult.length == 0) {\r
return null;\r
}\r
UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)queryResult[0];\r
\r
Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
if (queryResult == null || queryResult.length == 0) {\r
return null;\r
}\r
UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)queryResult[0];\r
return a.getDomNode();\r
}\r
return a.getDomNode();\r
}\r
public static Node getFpdUserExtensionPostBuild() {\r
public static Node getFpdUserExtensionPostBuild() {\r
- String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='1']" }; \r
+ String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='1']" };\r
\r
Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
if (queryResult == null || queryResult.length == 0) {\r
return null;\r
}\r
UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)queryResult[0];\r
\r
Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
if (queryResult == null || queryResult.length == 0) {\r
return null;\r
}\r
UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)queryResult[0];\r
return a.getDomNode();\r
}\r
\r
/**\r
* Retrieve FV image option information\r
return a.getDomNode();\r
}\r
\r
/**\r
* Retrieve FV image option information\r
* @param fvName\r
* FV image name\r
* @param fvName\r
* FV image name\r
* @returns option name/value list if elements are found at the known xpath\r
* @returns empty list if nothing is there\r
*/\r
* @returns option name/value list if elements are found at the known xpath\r
* @returns empty list if nothing is there\r
*/\r
\r
/**\r
* Retrieve FV image attributes information\r
\r
/**\r
* Retrieve FV image attributes information\r
* @param fvName\r
* FV image name\r
* @param fvName\r
* FV image name\r
* @returns attribute name/value list if elements are found at the known\r
* xpath\r
* @returns empty list if nothing is there\r
* @returns attribute name/value list if elements are found at the known\r
* xpath\r
* @returns empty list if nothing is there\r
}\r
ArrayList<String[]> list = new ArrayList<String[]>();\r
for (int i = 0; i < queryResult.length; i++) {\r
}\r
ArrayList<String[]> list = new ArrayList<String[]>();\r
for (int i = 0; i < queryResult.length; i++) {\r
FvImagesDocument.FvImages.FvImage.FvImageOptions item = (FvImagesDocument.FvImages.FvImage.FvImageOptions) queryResult[i];\r
List<FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue> namevalues = item.getNameValueList();\r
Iterator iter = namevalues.iterator();\r
FvImagesDocument.FvImages.FvImage.FvImageOptions item = (FvImagesDocument.FvImages.FvImage.FvImageOptions) queryResult[i];\r
List<FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue> namevalues = item.getNameValueList();\r
Iterator iter = namevalues.iterator();\r
\r
/**\r
* Retrieve flash definition file name\r
\r
/**\r
* Retrieve flash definition file name\r
* @returns file name if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
* @returns file name if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
}\r
\r
String[][] result = new String[queryResult.length][2];\r
}\r
\r
String[][] result = new String[queryResult.length][2];\r
for (int i = 0; i < queryResult.length; i++) {\r
FvImagesDocument.FvImages.NameValue item = (FvImagesDocument.FvImages.NameValue)queryResult[i];\r
result[i][0] = item.getName();\r
result[i][1] = item.getValue();\r
}\r
for (int i = 0; i < queryResult.length; i++) {\r
FvImagesDocument.FvImages.NameValue item = (FvImagesDocument.FvImages.NameValue)queryResult[i];\r
result[i][0] = item.getName();\r
result[i][1] = item.getValue();\r
}\r
/**\r
* Retrieve FV image component options\r
/**\r
* Retrieve FV image component options\r
* @param fvName\r
* FV image name\r
* @param fvName\r
* FV image name\r
* @returns name/value pairs list if elements are found at the known xpath\r
* @returns empty list if nothing is there\r
*/\r
* @returns name/value pairs list if elements are found at the known xpath\r
* @returns empty list if nothing is there\r
*/\r
result[i][0] = list.get(i)[0];\r
result[i][1] = list.get(i)[1];\r
}\r
result[i][0] = list.get(i)[0];\r
result[i][1] = list.get(i)[1];\r
}\r
}\r
\r
/**\r
* Retrieve PCD tokens\r
}\r
\r
/**\r
* Retrieve PCD tokens\r
* @returns CName/ItemType pairs list if elements are found at the known\r
* xpath\r
* @returns null if nothing is there\r
* @returns CName/ItemType pairs list if elements are found at the known\r
* xpath\r
* @returns null if nothing is there\r
\r
/**\r
* Retrieve MAS header\r
\r
/**\r
* Retrieve MAS header\r
* @return\r
* @return\r
*/\r
* @return\r
* @return\r
*/\r
\r
/**\r
* Retrieve Extern Specification\r
\r
/**\r
* Retrieve Extern Specification\r
* @return String[] If have specification element in the <extern> String[0]\r
* If no specification element in the <extern>\r
* @return String[] If have specification element in the <extern> String[0]\r
* If no specification element in the <extern>\r
*/\r
\r
public static String[] getExternSpecificaiton() {\r
*/\r
\r
public static String[] getExternSpecificaiton() {\r
\r
/**\r
* Retreive MsaFile which in SPD\r
\r
/**\r
* Retreive MsaFile which in SPD\r
* @param\r
* @return String[][3] The string sequence is ModuleName, ModuleGuid,\r
* ModuleVersion, MsaFile String[0][] If no msafile in SPD\r
* @param\r
* @return String[][3] The string sequence is ModuleName, ModuleGuid,\r
* ModuleVersion, MsaFile String[0][] If no msafile in SPD\r
\r
/**\r
* getSpdPpi() Retrieve the SPD PPI Entry\r
\r
/**\r
* getSpdPpi() Retrieve the SPD PPI Entry\r
* @param\r
* @return Map<String, String[2]> if get the PPI entry from SPD. Key - PPI\r
* Name String[0] - PPI CNAME String[1] - PPI Guid Null if no PPI\r
* @param\r
* @return Map<String, String[2]> if get the PPI entry from SPD. Key - PPI\r
* Name String[0] - PPI CNAME String[1] - PPI Guid Null if no PPI\r
\r
/**\r
* Retrieve module Guid string\r
\r
/**\r
* Retrieve module Guid string\r
* @returns GUILD string if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
* @returns GUILD string if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
/**\r
Get name array of PCD in a module. In one module, token space\r
is same, and token name should not be conflicted.\r
/**\r
Get name array of PCD in a module. In one module, token space\r
is same, and token name should not be conflicted.\r
@return String[]\r
**/\r
public static String[] getModulePcdEntryNameArray() {\r
@return String[]\r
**/\r
public static String[] getModulePcdEntryNameArray() {\r
}\r
\r
ExternsDocument.Externs ext = (ExternsDocument.Externs)returns[0];\r
}\r
\r
ExternsDocument.Externs ext = (ExternsDocument.Externs)returns[0];\r
if (ext.getTianoR8FlashMapH()){\r
return true;\r
}else {\r
if (ext.getTianoR8FlashMapH()){\r
return true;\r
}else {\r
/** @file\r
ConfigReader class.\r
/** @file\r
ConfigReader class.\r
- \r
- ConfigReader is used to read tool chain config file with flat format. \r
- \r
+\r
+ ConfigReader is used to read tool chain config file with flat format.\r
+\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
**/\r
package org.tianocore.build.toolchain;\r
\r
**/\r
package org.tianocore.build.toolchain;\r
\r
-import org.tianocore.exception.EdkException;\r
+import org.tianocore.common.exception.EdkException;\r
\r
import java.io.BufferedReader;\r
import java.io.File;\r
\r
import java.io.BufferedReader;\r
import java.io.File;\r
import java.util.List;\r
\r
/**\r
import java.util.List;\r
\r
/**\r
ConfigReader is used to read tool chain config file with flat format. Comments\r
is line starting with character '#'.\r
ConfigReader is used to read tool chain config file with flat format. Comments\r
is line starting with character '#'.\r
@since GenBuild 1.0\r
**/\r
public class ConfigReader {\r
@since GenBuild 1.0\r
**/\r
public class ConfigReader {\r
- Public construct method. \r
+ Public construct method.\r
**/\r
public ConfigReader () {\r
}\r
\r
/**\r
Default filepath is ".".\r
**/\r
public ConfigReader () {\r
}\r
\r
/**\r
Default filepath is ".".\r
@param filename the config file name like "target.txt"\r
@return the variables defined in file\r
**/\r
@param filename the config file name like "target.txt"\r
@return the variables defined in file\r
**/\r
\r
/**\r
Get all variables defined in config file. the config file format is flat\r
\r
/**\r
Get all variables defined in config file. the config file format is flat\r
- with "A=B". If line started with '#' looks as comments. \r
- \r
+ with "A=B". If line started with '#' looks as comments.\r
+\r
@param confPath the path of config file\r
@param filename the file name of the config file\r
@return the variables defined in the config file\r
@param confPath the path of config file\r
@param filename the file name of the config file\r
@return the variables defined in the config file\r
// without '=', or start with '='\r
//\r
int index;\r
// without '=', or start with '='\r
//\r
int index;\r
- if (str.length() == 0 || str.startsWith("#") || \r
+ if (str.length() == 0 || str.startsWith("#") ||\r
(index = str.indexOf('=')) <= 0) {\r
continue;\r
}\r
(index = str.indexOf('=')) <= 0) {\r
continue;\r
}\r
\r
public static synchronized ToolChainMap parseToolChainConfig(File ConfigFile) throws EdkException {\r
ToolChainMap map = new ToolChainMap();\r
\r
public static synchronized ToolChainMap parseToolChainConfig(File ConfigFile) throws EdkException {\r
ToolChainMap map = new ToolChainMap();\r
try {\r
FileReader reader = new FileReader(ConfigFile);\r
BufferedReader in = new BufferedReader(reader);\r
try {\r
FileReader reader = new FileReader(ConfigFile);\r
BufferedReader in = new BufferedReader(reader);\r
// without '=', or start with '='\r
//\r
int index;\r
// without '=', or start with '='\r
//\r
int index;\r
- if (str.length() == 0 || str.startsWith("#") || \r
+ if (str.length() == 0 || str.startsWith("#") ||\r
(index = str.indexOf('=')) <= 0) {\r
continue;\r
}\r
(index = str.indexOf('=')) <= 0) {\r
continue;\r
}\r
/** @file\r
ToolChainConfig class.\r
/** @file\r
ToolChainConfig class.\r
ToolChainFactory class parse all config files and get tool chain information.\r
ToolChainFactory class parse all config files and get tool chain information.\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
package org.tianocore.build.toolchain;\r
\r
import org.apache.tools.ant.BuildException;\r
package org.tianocore.build.toolchain;\r
\r
import org.apache.tools.ant.BuildException;\r
-import org.tianocore.exception.EdkException;\r
+\r
+import org.tianocore.common.exception.EdkException;\r
import org.tianocore.build.toolchain.ToolChainKey;\r
import org.tianocore.build.toolchain.ToolChainMap;\r
\r
import org.tianocore.build.toolchain.ToolChainKey;\r
import org.tianocore.build.toolchain.ToolChainMap;\r
\r
ToolChainFactory class parse all config files and get tool chain information.\r
ToolChainFactory class parse all config files and get tool chain information.\r
**/\r
public class ToolChainConfig {\r
///\r
**/\r
public class ToolChainConfig {\r
///\r
private ToolChainMap config = null;\r
///\r
/// tool chain information (how many targets, archs, etc.)\r
private ToolChainMap config = null;\r
///\r
/// tool chain information (how many targets, archs, etc.)\r
private ToolChainInfo info = new ToolChainInfo();\r
\r
/**\r
private ToolChainInfo info = new ToolChainInfo();\r
\r
/**\r
\r
/**\r
Public construct method.\r
\r
/**\r
Public construct method.\r
@param toolChainFile File object representing the tool chain configuration file\r
**/\r
public ToolChainConfig (File toolChainFile) {\r
@param toolChainFile File object representing the tool chain configuration file\r
**/\r
public ToolChainConfig (File toolChainFile) {\r
/**\r
Collect target, tool chain tag, arch and command information from key part\r
of configuration\r
/**\r
Collect target, tool chain tag, arch and command information from key part\r
of configuration\r
@param toolChainDefKey The set of keys in tool chain configuration\r
**/\r
private void parseToolChainDefKey (Set<ToolChainKey> toolChainDefKey) {\r
@param toolChainDefKey The set of keys in tool chain configuration\r
**/\r
private void parseToolChainDefKey (Set<ToolChainKey> toolChainDefKey) {\r
- Return the tool chain configuration information in a Map form \r
- \r
+ Return the tool chain configuration information in a Map form\r
+\r
@return ToolChainMap Tool chain configurations in a ToolChainMap\r
**/\r
public ToolChainMap getConfig() {\r
@return ToolChainMap Tool chain configurations in a ToolChainMap\r
**/\r
public ToolChainMap getConfig() {\r
\r
/**\r
Return the tool chain's target, arch, tag and commands information\r
\r
/**\r
Return the tool chain's target, arch, tag and commands information\r
@return ToolChainInfo\r
**/\r
public ToolChainInfo getConfigInfo() {\r
@return ToolChainInfo\r
**/\r
public ToolChainInfo getConfigInfo() {\r
\r
/**\r
override toString()\r
\r
/**\r
override toString()\r
@return String The converted configuration string in name=value form\r
**/\r
public String toString() {\r
@return String The converted configuration string in name=value form\r
**/\r
public String toString() {\r
\r
package org.tianocore.build.toolchain;\r
\r
\r
package org.tianocore.build.toolchain;\r
\r
-import org.tianocore.exception.EdkException;\r
+import org.tianocore.common.exception.EdkException;\r
\r
public class ToolChainKey implements java.io.Serializable, Comparable<ToolChainKey> {\r
static final long serialVersionUID = -8034897190740066933L;\r
\r
public class ToolChainKey implements java.io.Serializable, Comparable<ToolChainKey> {\r
static final long serialVersionUID = -8034897190740066933L;\r