mirror of https://github.com/acidanthera/audk.git
moved exception and logger classes to org.tianocore.common package
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1269 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
2f62848a85
commit
ff225cbbae
|
@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
**/
|
||||
|
||||
package org.tianocore.definitions;
|
||||
package org.tianocore.common.definitions;
|
||||
|
||||
/**
|
||||
This class includes the common EDK definitions.
|
||||
|
|
|
@ -14,7 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
**/
|
||||
|
||||
package org.tianocore.definitions;
|
||||
package org.tianocore.common.definitions;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
|
|
@ -15,7 +15,8 @@ Module Name:
|
|||
Abstract:
|
||||
|
||||
--*/
|
||||
package org.tianocore.exception;
|
||||
|
||||
package org.tianocore.common.exception;
|
||||
|
||||
public class EdkException extends Exception {
|
||||
static final long serialVersionUID = -8494188017252114029L;
|
||||
|
@ -28,13 +29,13 @@ public class EdkException extends Exception {
|
|||
|
||||
public EdkException(String message, boolean traceStack) {
|
||||
super(message);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public EdkException(){
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public EdkException(Exception e, String message){
|
||||
super("[EdkException]:" + message);
|
||||
if (isPrintStack){
|
||||
|
|
|
@ -16,7 +16,8 @@ Abstract:
|
|||
|
||||
--*/
|
||||
|
||||
package org.tianocore.logger;
|
||||
package org.tianocore.common.logger;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
|
|
@ -15,10 +15,10 @@ Module Name:
|
|||
Abstract:
|
||||
|
||||
--*/
|
||||
package org.tianocore.logger;
|
||||
|
||||
import org.tianocore.logger.LogMethod;
|
||||
package org.tianocore.common.logger;
|
||||
|
||||
import org.tianocore.common.logger.LogMethod;
|
||||
|
||||
public class EdkLog {
|
||||
private static final String error = "ERROR";
|
||||
|
@ -26,7 +26,7 @@ public class EdkLog {
|
|||
private static final String info = "INFO";
|
||||
private static final String verbose = "VERBOSE";
|
||||
private static final String debug = "DEBUG";
|
||||
|
||||
|
||||
public static final int EDK_ERROR = 0;
|
||||
public static final int EDK_WARNING = 1;
|
||||
public static final int EDK_INFO = 2;
|
||||
|
@ -38,9 +38,9 @@ public class EdkLog {
|
|||
|
||||
public static void log(int level, String message) {
|
||||
if (level <= logLevel){
|
||||
logger.putMessage(null, logLevel, message);
|
||||
logger.putMessage(null, logLevel, message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void log(int logLevel, String message, Exception cause) {
|
||||
|
@ -58,7 +58,7 @@ public class EdkLog {
|
|||
public static void setLogger(LogMethod l) {
|
||||
logger = l;
|
||||
}
|
||||
|
||||
|
||||
public static void setLogLevel (int level){
|
||||
logLevel = level;
|
||||
}
|
||||
|
@ -72,16 +72,16 @@ public class EdkLog {
|
|||
}
|
||||
if (levelStr.equalsIgnoreCase(debug)){
|
||||
logLevel = EDK_DEBUG;
|
||||
}
|
||||
}
|
||||
if (levelStr.equalsIgnoreCase(info)){
|
||||
logLevel = EDK_INFO;
|
||||
}
|
||||
}
|
||||
if (levelStr.equalsIgnoreCase(verbose)){
|
||||
logLevel = EDK_VERBOSE;
|
||||
}
|
||||
}
|
||||
if (levelStr.equalsIgnoreCase(warning)){
|
||||
logLevel = EDK_WARNING;
|
||||
}
|
||||
}
|
||||
}
|
||||
public static int getLogLevel (){
|
||||
return logLevel;
|
||||
|
|
|
@ -15,8 +15,8 @@ Module Name:
|
|||
Abstract:
|
||||
|
||||
--*/
|
||||
package org.tianocore.logger;
|
||||
|
||||
package org.tianocore.common.logger;
|
||||
|
||||
public interface LogMethod {
|
||||
public void putMessage(Object msgSource, int msgLevel, String msg);
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
CreateMtFileTask class.
|
||||
|
||||
CreateMtFileTask is used to call CreateMtFile.exe to create MT file.
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -24,7 +24,8 @@ import org.apache.tools.ant.BuildException;
|
|||
import org.apache.tools.ant.taskdefs.Execute;
|
||||
import org.apache.tools.ant.taskdefs.LogStreamHandler;
|
||||
import org.apache.tools.ant.types.Commandline;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
CreateMtFileTask class.
|
||||
|
@ -53,10 +54,10 @@ public class CreateMtFileTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* execute
|
||||
*
|
||||
*
|
||||
* StripTask execute function is to assemble tool command line & execute
|
||||
* tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuidException
|
||||
*/
|
||||
public void execute() throws BuildException {
|
||||
|
@ -85,7 +86,7 @@ public class CreateMtFileTask extends Task implements EfiDefine {
|
|||
File file = new File(outputFile);
|
||||
if (!file.isAbsolute() && (!this.outputDir.equalsIgnoreCase(""))) {
|
||||
argument = outputDir + File.separatorChar + outputFile + " " + this.fileSize;
|
||||
|
||||
|
||||
} else {
|
||||
argument = outputFile + " " + this.fileSize;
|
||||
}
|
||||
|
@ -111,7 +112,7 @@ public class CreateMtFileTask extends Task implements EfiDefine {
|
|||
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
|
||||
EdkLog.log(EdkLog.EDK_INFO, (new File(this.outputFile)).getName());
|
||||
revl = runner.execute();
|
||||
|
||||
|
||||
if (EFI_SUCCESS == revl) {
|
||||
//
|
||||
// command execution success
|
||||
|
@ -131,9 +132,9 @@ public class CreateMtFileTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getFileSize
|
||||
*
|
||||
*
|
||||
* This function is to get class member "fileSize".
|
||||
*
|
||||
*
|
||||
* @return fileSize string of file size.
|
||||
*/
|
||||
public String getFileSize() {
|
||||
|
@ -142,9 +143,9 @@ public class CreateMtFileTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setFileSize
|
||||
*
|
||||
*
|
||||
* This function is to set class member "fileSize".
|
||||
*
|
||||
*
|
||||
* @param fileSize
|
||||
* string of file size value.
|
||||
*/
|
||||
|
@ -154,9 +155,9 @@ public class CreateMtFileTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @return outputFile string of output file name.
|
||||
*/
|
||||
public String getOutputFile() {
|
||||
|
@ -165,9 +166,9 @@ public class CreateMtFileTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @param outputFile
|
||||
* string of output file name.
|
||||
*/
|
||||
|
@ -177,9 +178,9 @@ public class CreateMtFileTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @return outputDir string of output directory.
|
||||
*/
|
||||
public String getOutputDir() {
|
||||
|
@ -188,9 +189,9 @@ public class CreateMtFileTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @param outputDir
|
||||
* string of output directory.
|
||||
*/
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
EfiCompressTask class.
|
||||
|
||||
EfiCompressTask is used to call EfiCompress.exe to strip input file.
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -24,7 +24,8 @@ import org.apache.tools.ant.BuildException;
|
|||
import org.apache.tools.ant.taskdefs.Execute;
|
||||
import org.apache.tools.ant.taskdefs.LogStreamHandler;
|
||||
import org.apache.tools.ant.types.Commandline;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
EfiCompressTask class.
|
||||
|
@ -49,10 +50,10 @@ public class EfiCompressTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* execute
|
||||
*
|
||||
*
|
||||
* EfiCompressTask execute function is to assemble tool command line & execute
|
||||
* tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuidException
|
||||
*/
|
||||
public void execute() throws BuildException {
|
||||
|
@ -106,9 +107,9 @@ public class EfiCompressTask extends Task implements EfiDefine {
|
|||
//
|
||||
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
|
||||
EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName());
|
||||
|
||||
|
||||
revl = runner.execute();
|
||||
|
||||
|
||||
if (EFI_SUCCESS == revl) {
|
||||
//
|
||||
// command execution success
|
||||
|
@ -129,9 +130,9 @@ public class EfiCompressTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getInputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "inputFile".
|
||||
*
|
||||
*
|
||||
* @return string of input file name.
|
||||
*/
|
||||
public String getInputFile() {
|
||||
|
@ -140,9 +141,9 @@ public class EfiCompressTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setComponentType
|
||||
*
|
||||
*
|
||||
* This function is to set class member "inputFile".
|
||||
*
|
||||
*
|
||||
* @param inputFile
|
||||
* string of input file name.
|
||||
*/
|
||||
|
@ -152,9 +153,9 @@ public class EfiCompressTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @return outputFile string of output file name.
|
||||
*/
|
||||
public String getOutputFile() {
|
||||
|
@ -163,9 +164,9 @@ public class EfiCompressTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @param outputFile
|
||||
* string of output file name.
|
||||
*/
|
||||
|
@ -175,9 +176,9 @@ public class EfiCompressTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @return outputDir string of output directory.
|
||||
*/
|
||||
public String getOutputDir() {
|
||||
|
@ -186,9 +187,9 @@ public class EfiCompressTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @param outputDir
|
||||
* string of output directory.
|
||||
*/
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
EfiRomTask class.
|
||||
|
||||
EfiRomTask is used to call FlashMap.exe to lay out the flash.
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -26,11 +26,12 @@ import java.util.List;
|
|||
import org.apache.tools.ant.Task;
|
||||
import org.apache.tools.ant.Project;
|
||||
import org.apache.tools.ant.BuildException;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
* SecFixupTask class.
|
||||
*
|
||||
*
|
||||
* SecFixupTask is used to call SecFixup.exe to fix up sec image.
|
||||
*/
|
||||
public class EfiRomTask extends Task implements EfiDefine {
|
||||
|
@ -38,7 +39,7 @@ public class EfiRomTask extends Task implements EfiDefine {
|
|||
/// tool name
|
||||
///
|
||||
private final String toolName = "EfiRom";
|
||||
|
||||
|
||||
///
|
||||
/// Flash default file
|
||||
///
|
||||
|
@ -53,59 +54,59 @@ public class EfiRomTask extends Task implements EfiDefine {
|
|||
/// Flash device Image
|
||||
///
|
||||
private String deviceId = "";
|
||||
|
||||
|
||||
///
|
||||
/// MCI file
|
||||
///
|
||||
private String outputFile = "";
|
||||
|
||||
|
||||
///
|
||||
/// MCO file
|
||||
///
|
||||
private List<Input> binaryFileList = new ArrayList<Input>();
|
||||
|
||||
|
||||
///
|
||||
/// Efi PE32 image file
|
||||
///
|
||||
private List<Input> pe32FileList = new ArrayList<Input>();
|
||||
|
||||
|
||||
///
|
||||
/// Compress efi PE32 image file
|
||||
///
|
||||
private List<Input> pe32ComprFileList = new ArrayList<Input>();
|
||||
|
||||
|
||||
///
|
||||
/// Hex class code in the PCI data strutor header
|
||||
///
|
||||
private String classCode = "";
|
||||
|
||||
|
||||
///
|
||||
/// Hex revision in the PCI data header.
|
||||
///
|
||||
private String revision = "";
|
||||
|
||||
|
||||
///
|
||||
/// Dump the headers of an existing option rom image.
|
||||
///
|
||||
private String dump = "";
|
||||
|
||||
|
||||
|
||||
|
||||
///
|
||||
/// output directory
|
||||
///
|
||||
private String outputDir = ".";
|
||||
|
||||
|
||||
|
||||
|
||||
///
|
||||
/// command and argument list
|
||||
///
|
||||
LinkedList<String> argList = new LinkedList<String>();
|
||||
/**
|
||||
* execute
|
||||
*
|
||||
*
|
||||
* EfiRomTask execute function is to assemble tool command line & execute
|
||||
* tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuidException
|
||||
*/
|
||||
public void execute() throws BuildException {
|
||||
|
@ -128,7 +129,7 @@ public class EfiRomTask extends Task implements EfiDefine {
|
|||
command = path + File.separatorChar + toolName;
|
||||
}
|
||||
argList.addFirst(command);
|
||||
|
||||
|
||||
//
|
||||
// add microcode binary files
|
||||
//
|
||||
|
@ -139,7 +140,7 @@ public class EfiRomTask extends Task implements EfiDefine {
|
|||
argList.add(((Input)binList.next()).getFile());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// add pe32 file
|
||||
//
|
||||
|
@ -150,7 +151,7 @@ public class EfiRomTask extends Task implements EfiDefine {
|
|||
argList.add(((Input)pe32List.next()).getFile());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// add compressed pe32 file
|
||||
//
|
||||
|
@ -191,48 +192,48 @@ public class EfiRomTask extends Task implements EfiDefine {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getVerbose
|
||||
*
|
||||
*
|
||||
* This function is to get class member "verbose"
|
||||
*
|
||||
*
|
||||
* @return verbose for verbose output.
|
||||
*/
|
||||
public String getVerbose() {
|
||||
return verbose;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* setVerbose
|
||||
*
|
||||
*
|
||||
* This function is to set class member "verbose"
|
||||
*
|
||||
*
|
||||
* @param verbose for verbose output.
|
||||
*/
|
||||
public void setVerbose(boolean verbose) {
|
||||
if (verbose){
|
||||
this.verbose = "-p";
|
||||
argList.add(this.verbose);
|
||||
argList.add(this.verbose);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getVenderId
|
||||
*
|
||||
*
|
||||
* This function is to get class member "venderId"
|
||||
*
|
||||
*
|
||||
* @return venderId String of venderId.
|
||||
*/
|
||||
public String getVenderId() {
|
||||
return venderId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* setVenderId
|
||||
*
|
||||
*
|
||||
* This function is to set class member "venderId"
|
||||
*
|
||||
*
|
||||
* @param venderId String of venderId.
|
||||
*/
|
||||
public void setVenderId(String VenderId) {
|
||||
|
@ -240,23 +241,23 @@ public class EfiRomTask extends Task implements EfiDefine {
|
|||
argList.add("-v");
|
||||
argList.add(this.venderId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getDeviceId
|
||||
*
|
||||
*
|
||||
* This function is to get class member "deviceId"
|
||||
*
|
||||
*
|
||||
* @return deviceId String of device ID.
|
||||
*/
|
||||
public String getDeviceId() {
|
||||
return this.deviceId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* setDeviceId
|
||||
*
|
||||
*
|
||||
* This function is to set class member "deviceId"
|
||||
*
|
||||
*
|
||||
* @param deviceId String of device ID.
|
||||
*/
|
||||
public void setDeviceId(String deviceId) {
|
||||
|
@ -265,46 +266,46 @@ public class EfiRomTask extends Task implements EfiDefine {
|
|||
argList.add(this.deviceId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* getOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @return outputFile name of output directory.
|
||||
*/
|
||||
public String getOutputFile() {
|
||||
return outputFile;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* setOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "dscFile"
|
||||
*
|
||||
*
|
||||
* @param outputFile name of DSC file
|
||||
*/
|
||||
public void setOutputFile(String outputFile) {
|
||||
this.outputFile = outputFile;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getClassCode
|
||||
*
|
||||
*
|
||||
* This function is to get class member "classCode"
|
||||
*
|
||||
*
|
||||
* @return fdImage name of class code file.
|
||||
*/
|
||||
public String getClassCode() {
|
||||
return classCode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* setclassCode
|
||||
*
|
||||
*
|
||||
* This function is to set class member "classCode"
|
||||
*
|
||||
*
|
||||
* @param fdImage name of class code file.
|
||||
*/
|
||||
public void setclassCode(String classCode) {
|
||||
|
@ -312,23 +313,23 @@ public class EfiRomTask extends Task implements EfiDefine {
|
|||
argList.add("-cc");
|
||||
argList.add(this.classCode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getRevision
|
||||
*
|
||||
*
|
||||
* This function is to get class member "revision".
|
||||
*
|
||||
*
|
||||
* @return revision hex revision in the PDI data header.
|
||||
*/
|
||||
public String getRevision() {
|
||||
return revision;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* setRevision
|
||||
*
|
||||
*
|
||||
* This function is to set class member "revision"
|
||||
*
|
||||
*
|
||||
* @param revision hex revision in the PDI data header.
|
||||
*/
|
||||
public void setRevision(String revision) {
|
||||
|
@ -336,23 +337,23 @@ public class EfiRomTask extends Task implements EfiDefine {
|
|||
argList.add("-rev");
|
||||
argList.add(this.revision);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getFlashDeviceImage
|
||||
*
|
||||
*
|
||||
* This function is to get class member "dump"
|
||||
*
|
||||
*
|
||||
* @return flashDeviceImage name of flash device image
|
||||
*/
|
||||
public String getDump() {
|
||||
return dump;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* setFlashDeviceImage
|
||||
*
|
||||
*
|
||||
* This function is to set class member "dump"
|
||||
*
|
||||
*
|
||||
* @param flashDeviceImage name of flash device image
|
||||
*/
|
||||
public void setDump(boolean dump) {
|
||||
|
@ -364,20 +365,20 @@ public class EfiRomTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputDir"
|
||||
*
|
||||
* @return outputDir string of output directory
|
||||
*
|
||||
* @return outputDir string of output directory
|
||||
*/
|
||||
public String getOutputDir() {
|
||||
return outputDir;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* setOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @param outputDir string of output directory
|
||||
*/
|
||||
public void setOutputDir(String outputDir) {
|
||||
|
@ -385,31 +386,31 @@ public class EfiRomTask extends Task implements EfiDefine {
|
|||
}
|
||||
/**
|
||||
* addBinaryFile
|
||||
*
|
||||
*
|
||||
* This function is to add binary file to binaryFile list.
|
||||
*
|
||||
*
|
||||
* @param binaryFile name of binary file.
|
||||
*/
|
||||
public void addBinaryFile(Input binaryFile){
|
||||
this.binaryFileList.add(binaryFile);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* addPe32File
|
||||
*
|
||||
* This function is to add pe32 file to pe32File list.
|
||||
*
|
||||
*
|
||||
* This function is to add pe32 file to pe32File list.
|
||||
*
|
||||
* @param pe32File name of pe32 file.
|
||||
*/
|
||||
public void addPe32File(Input pe32File){
|
||||
this.pe32FileList.add(pe32File);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* addPe32ComprFile
|
||||
*
|
||||
*
|
||||
* This function os to add compressed pe32 file to pe32ComprFile list.
|
||||
*
|
||||
*
|
||||
* @param pe32ComprFile name of compressed pe32 file.
|
||||
*/
|
||||
public void addPe32ComprFile(Input pe32ComprFile){
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
FlashMapTask class.
|
||||
|
||||
FlashMapTask is used to call FlashMap.exe to lay out the flash.
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -26,11 +26,12 @@ import java.util.List;
|
|||
import org.apache.tools.ant.Task;
|
||||
import org.apache.tools.ant.Project;
|
||||
import org.apache.tools.ant.BuildException;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
* FlashMapTask class.
|
||||
*
|
||||
*
|
||||
* FlashMapTask is used to call FlashMap.exe to generate flash map defition files and fd files.
|
||||
*/
|
||||
public class FlashMapTask extends Task implements EfiDefine {
|
||||
|
@ -131,10 +132,10 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* execute
|
||||
*
|
||||
*
|
||||
* FlashMapTask execute function is to assemble tool command line & execute
|
||||
* tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuidException
|
||||
*/
|
||||
public void execute() throws BuildException {
|
||||
|
@ -168,8 +169,8 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
argList.add(this.inStrFile);
|
||||
argList.add(this.outStrFile);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// add microcode binary files
|
||||
//
|
||||
|
@ -216,9 +217,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getFlashDefFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "flashDefFile"
|
||||
*
|
||||
*
|
||||
* @return flashDeFile Name of flash definition file.
|
||||
*/
|
||||
public String getFlashDefFile() {
|
||||
|
@ -227,9 +228,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setFlashDefFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "flashDefFile"
|
||||
*
|
||||
*
|
||||
* @param flashDefFile
|
||||
* Name of flash definition file.
|
||||
*/
|
||||
|
@ -241,9 +242,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getAligment
|
||||
*
|
||||
*
|
||||
* This function is to get class member "aligment"
|
||||
*
|
||||
*
|
||||
* @return aligment String of aligment value.
|
||||
*/
|
||||
public String getAligment() {
|
||||
|
@ -252,9 +253,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setAligment
|
||||
*
|
||||
*
|
||||
* This function is to set class member "aligment"
|
||||
*
|
||||
*
|
||||
* @param aligment
|
||||
* String of aligment value.
|
||||
*/
|
||||
|
@ -266,9 +267,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getAsmIncFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "asmIncFile"
|
||||
*
|
||||
*
|
||||
* @return asmIncFile String of ASM include file.
|
||||
*/
|
||||
public String getAsmIncFile() {
|
||||
|
@ -277,9 +278,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setAsmIncFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "asmIncFile"
|
||||
*
|
||||
*
|
||||
* @param asmIncFile
|
||||
* String of ASM include file.
|
||||
*/
|
||||
|
@ -291,9 +292,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getBaseAddr
|
||||
*
|
||||
*
|
||||
* This function is to get class member "baseAddr"
|
||||
*
|
||||
*
|
||||
* @return baseAddr String of base address value.
|
||||
*/
|
||||
public String getBaseAddr() {
|
||||
|
@ -302,9 +303,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setBaseAddr
|
||||
*
|
||||
*
|
||||
* This function is to set class member "baseAddr"
|
||||
*
|
||||
*
|
||||
* @param baseAddr
|
||||
* String of base address value.
|
||||
*/
|
||||
|
@ -316,9 +317,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getDscFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "dscFile"
|
||||
*
|
||||
*
|
||||
* @return dscFile name of DSC file
|
||||
*/
|
||||
public String getDscFile() {
|
||||
|
@ -327,9 +328,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setDscFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "dscFile"
|
||||
*
|
||||
*
|
||||
* @param dscFile
|
||||
* name of DSC file
|
||||
*/
|
||||
|
@ -341,9 +342,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getFdImage
|
||||
*
|
||||
*
|
||||
* This function is to get class member "fdImage"
|
||||
*
|
||||
*
|
||||
* @return fdImage name of input FDI image file.
|
||||
*/
|
||||
public String getFdImage() {
|
||||
|
@ -352,9 +353,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setFdImage
|
||||
*
|
||||
*
|
||||
* This function is to set class member "fdImage"
|
||||
*
|
||||
*
|
||||
* @param fdImage
|
||||
* name of input FDI image file.
|
||||
*/
|
||||
|
@ -366,9 +367,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getFlashDevice
|
||||
*
|
||||
*
|
||||
* This function is to get class member "flashDevice".
|
||||
*
|
||||
*
|
||||
* @return flashDevice name of flash device.
|
||||
*/
|
||||
public String getFlashDevice() {
|
||||
|
@ -377,9 +378,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setFlashDevice
|
||||
*
|
||||
*
|
||||
* This function is to set class member "flashDevice"
|
||||
*
|
||||
*
|
||||
* @param flashDevice
|
||||
* name of flash device.
|
||||
*/
|
||||
|
@ -391,9 +392,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getFlashDeviceImage
|
||||
*
|
||||
*
|
||||
* This function is to get class member "flashDeviceImage"
|
||||
*
|
||||
*
|
||||
* @return flashDeviceImage name of flash device image
|
||||
*/
|
||||
public String getFlashDeviceImage() {
|
||||
|
@ -402,9 +403,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setFlashDeviceImage
|
||||
*
|
||||
*
|
||||
* This function is to set class member "flashDeviceImage"
|
||||
*
|
||||
*
|
||||
* @param flashDeviceImage
|
||||
* name of flash device image
|
||||
*/
|
||||
|
@ -417,9 +418,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getHeaderFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "headerFile"
|
||||
*
|
||||
*
|
||||
* @return headerFile name of include file
|
||||
*/
|
||||
public String getHeaderFile() {
|
||||
|
@ -428,9 +429,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setHeaderFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "headerFile"
|
||||
*
|
||||
*
|
||||
* @param headerFile
|
||||
* name of include file
|
||||
*/
|
||||
|
@ -442,9 +443,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getImageOutFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "imageOutFile"
|
||||
*
|
||||
*
|
||||
* @return imageOutFile name of output image file
|
||||
*/
|
||||
public String getImageOutFile() {
|
||||
|
@ -453,9 +454,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setImageOutFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "ImageOutFile"
|
||||
*
|
||||
*
|
||||
* @param imageOutFile
|
||||
* name of output image file
|
||||
*/
|
||||
|
@ -467,9 +468,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getInStrFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "inStrFile"
|
||||
*
|
||||
*
|
||||
* @return inStrFile name of input file which used to replace symbol names.
|
||||
*/
|
||||
public String getInStrFile() {
|
||||
|
@ -478,9 +479,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setInStrFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "inStrFile"
|
||||
*
|
||||
*
|
||||
* @param inStrFile
|
||||
* name of input file which used to replace symbol names.
|
||||
*/
|
||||
|
@ -490,9 +491,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getMciFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "mciFile"
|
||||
*
|
||||
*
|
||||
* @return mciFile name of input microcode file
|
||||
*/
|
||||
public String getMciFile() {
|
||||
|
@ -501,9 +502,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setMciFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "mciFile"
|
||||
*
|
||||
*
|
||||
* @param mciFile
|
||||
* name of input microcode file
|
||||
*/
|
||||
|
@ -515,9 +516,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getMcoFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "mcoFile"
|
||||
*
|
||||
*
|
||||
* @return mcoFile name of output binary microcode image
|
||||
*/
|
||||
public String getMcoFile() {
|
||||
|
@ -526,9 +527,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setMcoFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "mcoFile"
|
||||
*
|
||||
*
|
||||
* @param mcoFile
|
||||
* name of output binary microcode image
|
||||
*/
|
||||
|
@ -540,9 +541,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutStrFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outStrFile"
|
||||
*
|
||||
*
|
||||
* @return outStrFile name of output string substitution file
|
||||
*/
|
||||
public String getOutStrFile() {
|
||||
|
@ -551,9 +552,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutStrFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outStrFile"
|
||||
*
|
||||
*
|
||||
* @param outStrFile
|
||||
* name of output string substitution file
|
||||
*/
|
||||
|
@ -563,9 +564,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getPadValue
|
||||
*
|
||||
*
|
||||
* This function is to get class member "padValue"
|
||||
*
|
||||
*
|
||||
* @return padValue string of byte value to use as padding
|
||||
*/
|
||||
public String getPadValue() {
|
||||
|
@ -574,9 +575,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setPadValue
|
||||
*
|
||||
*
|
||||
* This function is to set class member "padValue"
|
||||
*
|
||||
*
|
||||
* @param padValue
|
||||
* string of byte value to use as padding
|
||||
*/
|
||||
|
@ -588,9 +589,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* addMciFile
|
||||
*
|
||||
*
|
||||
* This function is to add Microcode binary file
|
||||
*
|
||||
*
|
||||
* @param mciFile
|
||||
* instance of input class
|
||||
*/
|
||||
|
@ -600,9 +601,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @return outputDir string of output directory
|
||||
*/
|
||||
public String getOutputDir() {
|
||||
|
@ -611,9 +612,9 @@ public class FlashMapTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @param outputDir
|
||||
* string of output directory
|
||||
*/
|
||||
|
|
|
@ -17,18 +17,20 @@ Abstract:
|
|||
--*/
|
||||
|
||||
package org.tianocore.framework.tasks;
|
||||
|
||||
import org.apache.tools.ant.Project;
|
||||
import org.tianocore.logger.LogMethod;
|
||||
|
||||
import org.tianocore.common.logger.LogMethod;
|
||||
|
||||
class FrameworkLogger implements LogMethod {
|
||||
private Project project;
|
||||
private String titleName;
|
||||
public FrameworkLogger(Project project, String taskName) {
|
||||
this.project = project;
|
||||
this.titleName = taskName;
|
||||
this.titleName = taskName;
|
||||
}
|
||||
|
||||
public void putMessage(Object msgSource, int msgLevel, String msg) {
|
||||
public void putMessage(Object msgSource, int msgLevel, String msg) {
|
||||
String frameworkMsg = " [" + this.titleName + "] " + msg;
|
||||
this.project.log(frameworkMsg, Project.MSG_INFO);
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
FwImageTask class.
|
||||
|
||||
FwImageTask is used to call FwImage.ext to generate the FwImage.
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -24,7 +24,8 @@ import org.apache.tools.ant.Task;
|
|||
import org.apache.tools.ant.taskdefs.Execute;
|
||||
import org.apache.tools.ant.taskdefs.LogStreamHandler;
|
||||
import org.apache.tools.ant.types.Commandline;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -34,17 +35,17 @@ import org.tianocore.logger.EdkLog;
|
|||
**/
|
||||
public class FwImageTask extends Task implements EfiDefine{
|
||||
///
|
||||
/// time&data
|
||||
/// time&data
|
||||
///
|
||||
private String time = "";
|
||||
///
|
||||
/// input PE image
|
||||
///
|
||||
///
|
||||
private String peImage = "";
|
||||
private String peImageName = "";
|
||||
///
|
||||
/// output EFI image
|
||||
///
|
||||
///
|
||||
private String outImage = "";
|
||||
///
|
||||
/// component type
|
||||
|
@ -53,15 +54,15 @@ public class FwImageTask extends Task implements EfiDefine{
|
|||
|
||||
/**
|
||||
* assemble tool command line & execute tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuildException
|
||||
*/
|
||||
/**
|
||||
execute
|
||||
|
||||
execute
|
||||
|
||||
FwimageTask execute function is to assemble tool command line & execute
|
||||
tool command line
|
||||
|
||||
|
||||
@throws BuidException
|
||||
**/
|
||||
public void execute() throws BuildException {
|
||||
|
@ -117,9 +118,9 @@ public class FwImageTask extends Task implements EfiDefine{
|
|||
|
||||
/**
|
||||
setTime
|
||||
|
||||
|
||||
This function is to set operation of class member "time".
|
||||
|
||||
|
||||
@param time string of time
|
||||
**/
|
||||
public void setTime(String time) {
|
||||
|
@ -128,7 +129,7 @@ public class FwImageTask extends Task implements EfiDefine{
|
|||
|
||||
/**
|
||||
getTime
|
||||
|
||||
|
||||
This function is to get class member "time"
|
||||
@return time string of time
|
||||
**/
|
||||
|
@ -138,7 +139,7 @@ public class FwImageTask extends Task implements EfiDefine{
|
|||
|
||||
/**
|
||||
getPeImage
|
||||
|
||||
|
||||
This function is to get class member "peImage".
|
||||
@return name of PE image
|
||||
**/
|
||||
|
@ -148,7 +149,7 @@ public class FwImageTask extends Task implements EfiDefine{
|
|||
|
||||
/**
|
||||
setPeImage
|
||||
|
||||
|
||||
This function is to set class member "peImage"
|
||||
@param peImage name of PE image
|
||||
**/
|
||||
|
@ -159,7 +160,7 @@ public class FwImageTask extends Task implements EfiDefine{
|
|||
|
||||
/**
|
||||
getOutImage
|
||||
|
||||
|
||||
This function is to get class member "outImage".
|
||||
@return name of output EFI image
|
||||
**/
|
||||
|
@ -169,7 +170,7 @@ public class FwImageTask extends Task implements EfiDefine{
|
|||
|
||||
/**
|
||||
setOutImage
|
||||
|
||||
|
||||
This function is to set class member "outImage".
|
||||
@param outImage name of output EFI image
|
||||
**/
|
||||
|
@ -179,9 +180,9 @@ public class FwImageTask extends Task implements EfiDefine{
|
|||
|
||||
/**
|
||||
getComponentType
|
||||
|
||||
|
||||
This function is to get class member "componentType".
|
||||
|
||||
|
||||
@return string of componentType
|
||||
**/
|
||||
public String getComponentType() {
|
||||
|
@ -190,7 +191,7 @@ public class FwImageTask extends Task implements EfiDefine{
|
|||
|
||||
/**
|
||||
setComponentType
|
||||
|
||||
|
||||
This function is to set class member "componentType".
|
||||
@param componentType string of component type
|
||||
**/
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
GenAcpiTable class.
|
||||
|
||||
GenAcpiTable is used to call GenAcpiTable.exe to generate ACPI Table image .
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -24,7 +24,8 @@ import org.apache.tools.ant.BuildException;
|
|||
import org.apache.tools.ant.taskdefs.Execute;
|
||||
import org.apache.tools.ant.taskdefs.LogStreamHandler;
|
||||
import org.apache.tools.ant.types.Commandline;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
GenAcpiTable class.
|
||||
|
@ -49,10 +50,10 @@ public class GenAcpiTableTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* execute
|
||||
*
|
||||
*
|
||||
* StripTask execute function is to assemble tool command line & execute
|
||||
* tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuidException
|
||||
*/
|
||||
public void execute() throws BuildException {
|
||||
|
@ -107,7 +108,7 @@ public class GenAcpiTableTask extends Task implements EfiDefine {
|
|||
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
|
||||
EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName());
|
||||
revl = runner.execute();
|
||||
|
||||
|
||||
if (EFI_SUCCESS == revl) {
|
||||
//
|
||||
// command execution success
|
||||
|
@ -127,9 +128,9 @@ public class GenAcpiTableTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getInputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "inputFile".
|
||||
*
|
||||
*
|
||||
* @return string of input file name.
|
||||
*/
|
||||
public String getInputFile() {
|
||||
|
@ -138,9 +139,9 @@ public class GenAcpiTableTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setComponentType
|
||||
*
|
||||
*
|
||||
* This function is to set class member "inputFile".
|
||||
*
|
||||
*
|
||||
* @param inputFile
|
||||
* string of input file name.
|
||||
*/
|
||||
|
@ -150,9 +151,9 @@ public class GenAcpiTableTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @return outputFile string of output file name.
|
||||
*/
|
||||
public String getOutputFile() {
|
||||
|
@ -161,9 +162,9 @@ public class GenAcpiTableTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @param outputFile
|
||||
* string of output file name.
|
||||
*/
|
||||
|
@ -173,9 +174,9 @@ public class GenAcpiTableTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @return outputDir string of output directory.
|
||||
*/
|
||||
public String getOutputDir() {
|
||||
|
@ -184,9 +185,9 @@ public class GenAcpiTableTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @param outputDir
|
||||
* string of output directory.
|
||||
*/
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
GenCapsuleHdrTask class.
|
||||
|
||||
GenCapsuleHdrTask is used to call GenCapsuleHdr.exe to generate capsule.
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -24,7 +24,8 @@ import org.apache.tools.ant.BuildException;
|
|||
import org.apache.tools.ant.taskdefs.Execute;
|
||||
import org.apache.tools.ant.taskdefs.LogStreamHandler;
|
||||
import org.apache.tools.ant.types.Commandline;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
GenCapsuleHdrTask class.
|
||||
|
@ -36,7 +37,7 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
/// tool name
|
||||
///
|
||||
private String toolName = "GenCapsuleHdr";
|
||||
|
||||
|
||||
///
|
||||
/// script file
|
||||
///
|
||||
|
@ -61,17 +62,17 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
/// Dump flag
|
||||
///
|
||||
private String dump = "";
|
||||
|
||||
|
||||
///
|
||||
/// Split size
|
||||
///
|
||||
private String size = "";
|
||||
|
||||
|
||||
///
|
||||
/// capsule into one image flag
|
||||
///
|
||||
private String joinFlag = "";
|
||||
|
||||
|
||||
///
|
||||
/// capsule file
|
||||
///
|
||||
|
@ -80,10 +81,10 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* execute
|
||||
*
|
||||
*
|
||||
* GenCapsuleHdrTask execute function is to assemble tool command line & execute
|
||||
* tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuidException
|
||||
*/
|
||||
public void execute() throws BuildException {
|
||||
|
@ -160,9 +161,9 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getInputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "scriptFile".
|
||||
*
|
||||
*
|
||||
* @return string of input file name.
|
||||
*/
|
||||
public String getScriptFile() {
|
||||
|
@ -171,9 +172,9 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setComponentType
|
||||
*
|
||||
*
|
||||
* This function is to set class member "inputFile".
|
||||
*
|
||||
*
|
||||
* @param inputFile
|
||||
* string of input file name.
|
||||
*/
|
||||
|
@ -183,9 +184,9 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @return outputFile string of output file name.
|
||||
*/
|
||||
public String getOutputFile() {
|
||||
|
@ -194,9 +195,9 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @param outputFile
|
||||
* string of output file name.
|
||||
*/
|
||||
|
@ -206,9 +207,9 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @return outputDir string of output directory.
|
||||
*/
|
||||
public String getOutputDir() {
|
||||
|
@ -217,9 +218,9 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @param outputDir
|
||||
* string of output directory.
|
||||
*/
|
||||
|
@ -229,9 +230,9 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getVerbose
|
||||
*
|
||||
*
|
||||
* This function is to get class member "verbose"
|
||||
*
|
||||
*
|
||||
* @return verbose the flag of verbose.
|
||||
*/
|
||||
public String getVerbose() {
|
||||
|
@ -240,9 +241,9 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setVerbose
|
||||
*
|
||||
*
|
||||
* This function is to set class member "verbose"
|
||||
*
|
||||
*
|
||||
* @param verbose
|
||||
* True or False.
|
||||
*/
|
||||
|
@ -254,9 +255,9 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getDump
|
||||
*
|
||||
*
|
||||
* This function is to get class member "dump"
|
||||
*
|
||||
*
|
||||
* @return verbose the flag of dump.
|
||||
*/
|
||||
public String getDump() {
|
||||
|
@ -265,9 +266,9 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setDump
|
||||
*
|
||||
*
|
||||
* This function is to set class member "dump".
|
||||
*
|
||||
*
|
||||
* @param dump
|
||||
* True or False.
|
||||
*/
|
||||
|
@ -279,9 +280,9 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getSize
|
||||
*
|
||||
*
|
||||
* This function is to set class member "size".
|
||||
*
|
||||
*
|
||||
* @return size string of size value
|
||||
*/
|
||||
public String getSize() {
|
||||
|
@ -290,9 +291,9 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setSize
|
||||
*
|
||||
*
|
||||
* This function is to set class member "size".
|
||||
*
|
||||
*
|
||||
* @param size string of size value.
|
||||
*/
|
||||
public void setSize(String size) {
|
||||
|
@ -301,9 +302,9 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getCapsuleFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "capsuleFile"
|
||||
*
|
||||
*
|
||||
* @return capsuleFile capsule file name
|
||||
*/
|
||||
public String getCapsuleFile() {
|
||||
|
@ -312,9 +313,9 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setCapsuleFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "capsuleFile"
|
||||
*
|
||||
*
|
||||
* @param capsuleFile capsule file name
|
||||
*/
|
||||
public void setCapsuleFile(String capsuleFile) {
|
||||
|
@ -323,10 +324,10 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* isJoinFlag
|
||||
*
|
||||
*
|
||||
* This function is to get class member "joinFlag"
|
||||
*
|
||||
* @return joinFlag flag of if need to join split capsule images into
|
||||
*
|
||||
* @return joinFlag flag of if need to join split capsule images into
|
||||
* a single image.
|
||||
*/
|
||||
public String getJoinFlag() {
|
||||
|
@ -335,16 +336,16 @@ public class GenCapsuleHdrTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setJoinFlag
|
||||
*
|
||||
*
|
||||
* This function is to set class member "joinFlag"
|
||||
*
|
||||
* @param joinFlag flag of if need to join split capsule images into
|
||||
* a single image.
|
||||
*
|
||||
* @param joinFlag flag of if need to join split capsule images into
|
||||
* a single image.
|
||||
*/
|
||||
public void setJoinFlag(boolean joinFlag) {
|
||||
if (joinFlag){
|
||||
this.joinFlag = "-j ";
|
||||
this.joinFlag = "-j ";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
GenTeImageTask class.
|
||||
|
||||
GenTeImageTask is used to call GenTEImage.exe to generate TE image .
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -24,11 +24,12 @@ import org.apache.tools.ant.BuildException;
|
|||
import org.apache.tools.ant.taskdefs.Execute;
|
||||
import org.apache.tools.ant.taskdefs.LogStreamHandler;
|
||||
import org.apache.tools.ant.types.Commandline;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
* GenTeImageTask class.
|
||||
*
|
||||
*
|
||||
* GenTeImageTask is used to call GenAcpiTable.exe to generate ACPI Table image .
|
||||
*/
|
||||
public class GenTeImageTask extends Task implements EfiDefine {
|
||||
|
@ -63,15 +64,15 @@ public class GenTeImageTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* assemble tool command line & execute tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuildException
|
||||
*/
|
||||
/**
|
||||
* execute
|
||||
*
|
||||
*
|
||||
* GenTeImgaeTask execute function is to assemble tool command line & execute
|
||||
* tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuidException
|
||||
*/
|
||||
public void execute() throws BuildException {
|
||||
|
@ -149,9 +150,9 @@ public class GenTeImageTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getInputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "inputFile".
|
||||
*
|
||||
*
|
||||
* @return string of input file name.
|
||||
*/
|
||||
public String getInputFile() {
|
||||
|
@ -160,9 +161,9 @@ public class GenTeImageTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setComponentType
|
||||
*
|
||||
*
|
||||
* This function is to set class member "inputFile".
|
||||
*
|
||||
*
|
||||
* @param inputFile
|
||||
* string of input file name.
|
||||
*/
|
||||
|
@ -172,9 +173,9 @@ public class GenTeImageTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @return outputFile string of output file name.
|
||||
*/
|
||||
public String getOutputFile() {
|
||||
|
@ -183,9 +184,9 @@ public class GenTeImageTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @param outputFile
|
||||
* string of output file name.
|
||||
*/
|
||||
|
@ -195,9 +196,9 @@ public class GenTeImageTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @return outputDir string of output directory.
|
||||
*/
|
||||
public String getOutputDir() {
|
||||
|
@ -206,9 +207,9 @@ public class GenTeImageTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @param outputDir
|
||||
* string of output directory.
|
||||
*/
|
||||
|
@ -218,9 +219,9 @@ public class GenTeImageTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getVerbose
|
||||
*
|
||||
*
|
||||
* This function is to get class member "verbose"
|
||||
*
|
||||
*
|
||||
* @return verbose the flag of verbose.
|
||||
*/
|
||||
public String getVerbose() {
|
||||
|
@ -229,9 +230,9 @@ public class GenTeImageTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setVerbose
|
||||
*
|
||||
*
|
||||
* This function is to set class member "verbose"
|
||||
*
|
||||
*
|
||||
* @param verbose
|
||||
* True or False.
|
||||
*/
|
||||
|
@ -243,9 +244,9 @@ public class GenTeImageTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getDump
|
||||
*
|
||||
*
|
||||
* This function is to get class member "dump"
|
||||
*
|
||||
*
|
||||
* @return verbose the flag of dump.
|
||||
*/
|
||||
public String getDump() {
|
||||
|
@ -254,9 +255,9 @@ public class GenTeImageTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setDump
|
||||
*
|
||||
*
|
||||
* This function is to set class member "dump"
|
||||
*
|
||||
*
|
||||
* @param dump
|
||||
* True or False.
|
||||
*/
|
||||
|
|
|
@ -35,7 +35,8 @@ import org.apache.tools.ant.taskdefs.Execute;
|
|||
import org.apache.tools.ant.taskdefs.LogStreamHandler;
|
||||
import org.apache.tools.ant.types.Commandline;
|
||||
import org.apache.tools.ant.types.Path;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
Class MakeDeps is used to wrap MakeDeps.exe as an ANT task.
|
||||
|
@ -112,7 +113,7 @@ public class MakeDeps extends Task {
|
|||
|
||||
///
|
||||
/// if there's no source files, we can do nothing about dependency
|
||||
///
|
||||
///
|
||||
if (inputFileList.size() == 0) {
|
||||
throw new BuildException("No source files specified to scan");
|
||||
}
|
||||
|
@ -375,7 +376,7 @@ public class MakeDeps extends Task {
|
|||
|
||||
///
|
||||
/// compose the final file content
|
||||
///
|
||||
///
|
||||
StringBuffer cleanedLines = new StringBuffer(40960);
|
||||
Iterator<String> it = lineSet.iterator();
|
||||
while (it.hasNext()) {
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
ModifyInfTask class.
|
||||
|
||||
ModifyInfTask is used to call Modify.exe to generate inf file.
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -24,7 +24,8 @@ import org.apache.tools.ant.BuildException;
|
|||
import org.apache.tools.ant.taskdefs.Execute;
|
||||
import org.apache.tools.ant.taskdefs.LogStreamHandler;
|
||||
import org.apache.tools.ant.types.Commandline;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
ModifyInfTask class.
|
||||
|
@ -36,7 +37,7 @@ public class ModifyInfTask extends Task implements EfiDefine {
|
|||
/// tool name
|
||||
///
|
||||
private String toolName = "ModifyInf";
|
||||
|
||||
|
||||
///
|
||||
/// input FV inf file
|
||||
///
|
||||
|
@ -54,15 +55,15 @@ public class ModifyInfTask extends Task implements EfiDefine {
|
|||
|
||||
///
|
||||
/// Output dir
|
||||
///
|
||||
///
|
||||
private String outputDir = "";
|
||||
|
||||
|
||||
/**
|
||||
* execute
|
||||
*
|
||||
*
|
||||
* ModifyInfTask execute function is to assemble tool command line & execute
|
||||
* tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuidException
|
||||
*/
|
||||
public void execute() throws BuildException {
|
||||
|
@ -91,12 +92,12 @@ public class ModifyInfTask extends Task implements EfiDefine {
|
|||
File file = new File(outputFVInfFileName);
|
||||
if (!file.isAbsolute() && (!this.outputDir.equalsIgnoreCase(""))) {
|
||||
argument = this.inputFVInfFileName +
|
||||
this.outputDir +
|
||||
this.outputDir +
|
||||
File.separatorChar +
|
||||
this.outputFVInfFileName +
|
||||
this.patternStr;
|
||||
} else {
|
||||
argument = this.inputFVInfFileName +
|
||||
argument = this.inputFVInfFileName +
|
||||
this.outputFVInfFileName +
|
||||
this.patternStr;
|
||||
}
|
||||
|
@ -142,9 +143,9 @@ public class ModifyInfTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getinputFVInfFileName
|
||||
*
|
||||
*
|
||||
* This function is to get class member "inputFVInfFileName".
|
||||
*
|
||||
*
|
||||
* @return string of input inf file name.
|
||||
*/
|
||||
public String getinputFVInfFileName() {
|
||||
|
@ -153,9 +154,9 @@ public class ModifyInfTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setinputFVInfFileName
|
||||
*
|
||||
*
|
||||
* This function is to set class member "inputFVInfFileName".
|
||||
*
|
||||
*
|
||||
* @param inputFile
|
||||
* string of input inf file name.
|
||||
*/
|
||||
|
@ -165,9 +166,9 @@ public class ModifyInfTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getoutputFVInfFileName
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputFVInfFileName"
|
||||
*
|
||||
*
|
||||
* @return outputFVInfFileName string of output inf file name.
|
||||
*/
|
||||
public String getoutputFVInfFileName() {
|
||||
|
@ -176,9 +177,9 @@ public class ModifyInfTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setoutputFVInfFileName
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputFVInfFileName"
|
||||
*
|
||||
*
|
||||
* @param outputFVInfFileName
|
||||
* string of output inf file name.
|
||||
*/
|
||||
|
@ -188,9 +189,9 @@ public class ModifyInfTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getpatternStr
|
||||
*
|
||||
*
|
||||
* This function is to get class member "patternStr"
|
||||
*
|
||||
*
|
||||
* @return patternStr string of pattern.
|
||||
*/
|
||||
public String getpatternStr() {
|
||||
|
@ -199,9 +200,9 @@ public class ModifyInfTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setpatternStr
|
||||
*
|
||||
*
|
||||
* This function is to set class member "patternStr"
|
||||
*
|
||||
*
|
||||
* @param patternStr
|
||||
* string of patternStr.
|
||||
*/
|
||||
|
@ -211,9 +212,9 @@ public class ModifyInfTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getoutputDir
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @return outputDir string of output directory.
|
||||
*/
|
||||
public String getoutputDir() {
|
||||
|
@ -222,9 +223,9 @@ public class ModifyInfTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setoutputDir
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @param patternStr
|
||||
* string of output directory.
|
||||
*/
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
PeiReBaseTask class.
|
||||
|
||||
PeiReBaseTask is used to call PeiReBase.exe to rebase efi fv file.
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -24,7 +24,8 @@ import org.apache.tools.ant.BuildException;
|
|||
import org.apache.tools.ant.taskdefs.Execute;
|
||||
import org.apache.tools.ant.taskdefs.LogStreamHandler;
|
||||
import org.apache.tools.ant.types.Commandline;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
PeiReBaseTask class.
|
||||
|
@ -50,23 +51,23 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
// / Output directory, this variable is added by jave wrap
|
||||
// /
|
||||
private String outputDir = "";
|
||||
|
||||
|
||||
///
|
||||
/// Base address
|
||||
///
|
||||
private String baseAddr = "";
|
||||
|
||||
|
||||
///
|
||||
/// Architecture
|
||||
/// Architecture
|
||||
///
|
||||
private String arch = "";
|
||||
|
||||
|
||||
/**
|
||||
* execute
|
||||
*
|
||||
*
|
||||
* PeiReBaseTask execute function is to assemble tool command line & execute
|
||||
* tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuidException
|
||||
*/
|
||||
public void execute() throws BuildException {
|
||||
|
@ -78,7 +79,7 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
FrameworkLogger logger = new FrameworkLogger(project, toolName.toLowerCase());
|
||||
EdkLog.setLogLevel(project.getProperty("env.LOGLEVEL"));
|
||||
EdkLog.setLogger(logger);
|
||||
|
||||
|
||||
//
|
||||
// absolute path of efi tools
|
||||
//
|
||||
|
@ -97,7 +98,7 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
if (path != null) {
|
||||
command = path + File.separatorChar + command;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// argument of tools
|
||||
//
|
||||
|
@ -109,7 +110,7 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
} else {
|
||||
argument = inputFile + " " + "-O " + outputFile + " " + this.baseAddr+ " " + "-M " + outputFile + ".map";
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// return value of fwimage execution
|
||||
//
|
||||
|
@ -131,9 +132,9 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
//
|
||||
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
|
||||
EdkLog.log(EdkLog.EDK_INFO, this.inputFileName);
|
||||
|
||||
|
||||
revl = runner.execute();
|
||||
|
||||
|
||||
if (EFI_SUCCESS == revl) {
|
||||
//
|
||||
// command execution success
|
||||
|
@ -153,9 +154,9 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getInputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "inputFile".
|
||||
*
|
||||
*
|
||||
* @return string of input file name.
|
||||
*/
|
||||
public String getInputFile() {
|
||||
|
@ -164,9 +165,9 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setComponentType
|
||||
*
|
||||
*
|
||||
* This function is to set class member "inputFile".
|
||||
*
|
||||
*
|
||||
* @param inputFile
|
||||
* string of input file name.
|
||||
*/
|
||||
|
@ -177,9 +178,9 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @return outputFile string of output file name.
|
||||
*/
|
||||
public String getOutputFile() {
|
||||
|
@ -188,9 +189,9 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @param outputFile
|
||||
* string of output file name.
|
||||
*/
|
||||
|
@ -200,9 +201,9 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @return outputDir string of output directory.
|
||||
*/
|
||||
public String getOutputDir() {
|
||||
|
@ -211,9 +212,9 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @param outputDir
|
||||
* string of output directory.
|
||||
*/
|
||||
|
@ -223,9 +224,9 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getBaseAddr
|
||||
*
|
||||
*
|
||||
* This function is to get class member "baseAddr"
|
||||
*
|
||||
*
|
||||
* @return baseAddr string of base address.
|
||||
*/
|
||||
public String getBaseAddr() {
|
||||
|
@ -234,9 +235,9 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setBaseAddr
|
||||
*
|
||||
*
|
||||
* This function is to set class member "baseAddr"
|
||||
*
|
||||
*
|
||||
* @param baseAddr string of base address
|
||||
*/
|
||||
public void setBaseAddr(String baseAddr) {
|
||||
|
@ -245,9 +246,9 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getArch
|
||||
*
|
||||
*
|
||||
* This function is to get class member "arch".
|
||||
*
|
||||
*
|
||||
* @return arch Architecture
|
||||
*/
|
||||
public String getArch() {
|
||||
|
@ -256,9 +257,9 @@ public class PeiReBaseTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setArch
|
||||
*
|
||||
* This function is to set class member "arch"
|
||||
*
|
||||
*
|
||||
* This function is to set class member "arch"
|
||||
*
|
||||
* @param arch Architecture
|
||||
*/
|
||||
public void setArch(String arch) {
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
|
||||
SecApResetVectorFixupTask is used to call SecApResetVectorFixup.exe to place
|
||||
Ap reset vector.
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -25,7 +25,8 @@ import org.apache.tools.ant.BuildException;
|
|||
import org.apache.tools.ant.taskdefs.Execute;
|
||||
import org.apache.tools.ant.taskdefs.LogStreamHandler;
|
||||
import org.apache.tools.ant.types.Commandline;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
SecApResetVectorFixupTask class.
|
||||
|
@ -56,10 +57,10 @@ public class SecApResetVectorFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* execute
|
||||
*
|
||||
*
|
||||
* SecApResetVectorFixupTask execute function is to assemble tool command line & execute
|
||||
* tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuidException
|
||||
*/
|
||||
public void execute() throws BuildException {
|
||||
|
@ -113,9 +114,9 @@ public class SecApResetVectorFixupTask extends Task implements EfiDefine {
|
|||
//
|
||||
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
|
||||
EdkLog.log(EdkLog.EDK_INFO, (new File(this.fvInputFile)).getName());
|
||||
|
||||
|
||||
revl = runner.execute();
|
||||
|
||||
|
||||
if (EFI_SUCCESS == revl) {
|
||||
//
|
||||
// command execution success
|
||||
|
@ -135,9 +136,9 @@ public class SecApResetVectorFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getInputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "fvInputFile".
|
||||
*
|
||||
*
|
||||
* @return string of input file name.
|
||||
*/
|
||||
public String getfvInputFile() {
|
||||
|
@ -146,9 +147,9 @@ public class SecApResetVectorFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setComponentType
|
||||
*
|
||||
*
|
||||
* This function is to set class member "fvInputFile".
|
||||
*
|
||||
*
|
||||
* @param inputFile
|
||||
* string of input file name.
|
||||
*/
|
||||
|
@ -158,9 +159,9 @@ public class SecApResetVectorFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "fvOutputFile"
|
||||
*
|
||||
*
|
||||
* @return outputFile string of output file name.
|
||||
*/
|
||||
public String getOutputFile() {
|
||||
|
@ -169,9 +170,9 @@ public class SecApResetVectorFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "fvOutputFile"
|
||||
*
|
||||
*
|
||||
* @param outputFile
|
||||
* string of output file name.
|
||||
*/
|
||||
|
@ -181,9 +182,9 @@ public class SecApResetVectorFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @return outputDir string of output directory.
|
||||
*/
|
||||
public String getOutputDir() {
|
||||
|
@ -192,9 +193,9 @@ public class SecApResetVectorFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @param outputDir
|
||||
* string of output directory.
|
||||
*/
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
SecFixupTask class.
|
||||
|
||||
SecFixupTask is used to call SecFixup.exe to fix up sec image.
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -24,11 +24,12 @@ import org.apache.tools.ant.BuildException;
|
|||
import org.apache.tools.ant.taskdefs.Execute;
|
||||
import org.apache.tools.ant.taskdefs.LogStreamHandler;
|
||||
import org.apache.tools.ant.types.Commandline;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
* SecFixupTask class.
|
||||
*
|
||||
*
|
||||
* SecFixupTask is used to call SecFixup.exe to fix up sec image.
|
||||
*/
|
||||
public class SecFixupTask extends Task implements EfiDefine {
|
||||
|
@ -59,10 +60,10 @@ public class SecFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* execute
|
||||
*
|
||||
*
|
||||
* SecFixupTask execute function is to assemble tool command line & execute
|
||||
* tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuidException
|
||||
*/
|
||||
public void execute() throws BuildException {
|
||||
|
@ -139,9 +140,9 @@ public class SecFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getSecExeFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "secExeFile".
|
||||
*
|
||||
*
|
||||
* @return string of sectExe file name.
|
||||
*/
|
||||
public String getSecExeFile() {
|
||||
|
@ -150,9 +151,9 @@ public class SecFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setSecExeFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "secExeFile".
|
||||
*
|
||||
*
|
||||
* @param secExeFile
|
||||
* string of secExe file name.
|
||||
*/
|
||||
|
@ -162,9 +163,9 @@ public class SecFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getResetVectorDataFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "resetVectorDataFile"
|
||||
*
|
||||
*
|
||||
* @return resetVectorDataFile string of resetVectorData file name.
|
||||
*/
|
||||
public String getResetVectorDataFile() {
|
||||
|
@ -173,9 +174,9 @@ public class SecFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setResetVectorDataFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "resetVectorDataFile"
|
||||
*
|
||||
*
|
||||
* @param resetVectorDataFile
|
||||
* string of resetVectorData file name.
|
||||
*/
|
||||
|
@ -185,9 +186,9 @@ public class SecFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @return outputFile string of output file name.
|
||||
*/
|
||||
public String getOutputFile() {
|
||||
|
@ -196,9 +197,9 @@ public class SecFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @param outputFile
|
||||
* string of output file name.
|
||||
*/
|
||||
|
@ -208,9 +209,9 @@ public class SecFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @return outputDir name of output directory
|
||||
*/
|
||||
public String getOutputDir() {
|
||||
|
@ -219,9 +220,9 @@ public class SecFixupTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @param outputDir
|
||||
* name of output directory
|
||||
*/
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
/** @file
|
||||
SplitfileTask class.
|
||||
|
||||
SplitfileTask is used to call splitfile.exe to split input file to 2 output
|
||||
SplitfileTask is used to call splitfile.exe to split input file to 2 output
|
||||
file.
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -25,12 +25,13 @@ import org.apache.tools.ant.BuildException;
|
|||
import org.apache.tools.ant.taskdefs.Execute;
|
||||
import org.apache.tools.ant.taskdefs.LogStreamHandler;
|
||||
import org.apache.tools.ant.types.Commandline;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
SplitfileTask class.
|
||||
|
||||
SplitfileTask is used to call splitfile.exe to split input file to 2 output
|
||||
SplitfileTask is used to call splitfile.exe to split input file to 2 output
|
||||
file.
|
||||
**/
|
||||
public class SplitfileTask extends Task implements EfiDefine {
|
||||
|
@ -44,26 +45,26 @@ public class SplitfileTask extends Task implements EfiDefine {
|
|||
///
|
||||
private String offset = "";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* execute
|
||||
*
|
||||
*
|
||||
* SplitfleTask execute function is to assemble tool command line & execute
|
||||
* tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuidException
|
||||
*/
|
||||
public void execute() throws BuildException {
|
||||
|
||||
Project project = this.getOwningTarget().getProject();
|
||||
|
||||
|
||||
//
|
||||
// set Logger
|
||||
//
|
||||
FrameworkLogger logger = new FrameworkLogger(project, "splitfile");
|
||||
EdkLog.setLogLevel(project.getProperty("env.LOGLEVEL"));
|
||||
EdkLog.setLogger(logger);
|
||||
|
||||
|
||||
//
|
||||
// absolute path of efi tools
|
||||
//
|
||||
|
@ -75,12 +76,12 @@ public class SplitfileTask extends Task implements EfiDefine {
|
|||
} else {
|
||||
command = path + File.separatorChar + "SplitFile";
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// argument of tools
|
||||
//
|
||||
argument = inputFile + " " + offset;
|
||||
|
||||
|
||||
//
|
||||
// return value of fwimage execution
|
||||
//
|
||||
|
@ -97,7 +98,7 @@ public class SplitfileTask extends Task implements EfiDefine {
|
|||
|
||||
runner.setAntRun(project);
|
||||
runner.setCommandline(cmdline.getCommandline());
|
||||
|
||||
|
||||
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
|
||||
EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName());
|
||||
revl = runner.execute();
|
||||
|
@ -120,9 +121,9 @@ public class SplitfileTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getInputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "inputFile".
|
||||
*
|
||||
*
|
||||
* @return string of input file name.
|
||||
*/
|
||||
public String getInputFile() {
|
||||
|
@ -131,9 +132,9 @@ public class SplitfileTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setComponentType
|
||||
*
|
||||
*
|
||||
* This function is to set class member "inputFile".
|
||||
*
|
||||
*
|
||||
* @param inputFile
|
||||
* string of input file name.
|
||||
*/
|
||||
|
@ -143,9 +144,9 @@ public class SplitfileTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
getOffset
|
||||
|
||||
|
||||
This function is to get class member "offset"
|
||||
|
||||
|
||||
@return offset value of string.
|
||||
**/
|
||||
public String getOffset() {
|
||||
|
@ -154,14 +155,14 @@ public class SplitfileTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
setOffset
|
||||
|
||||
|
||||
This function is to set class member "offset"
|
||||
|
||||
|
||||
@param offset
|
||||
string of offset value.
|
||||
**/
|
||||
public void setOffset(String offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
StripTask class.
|
||||
|
||||
StripTask is used to call Strip.exe to strip input file.
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -24,7 +24,8 @@ import org.apache.tools.ant.BuildException;
|
|||
import org.apache.tools.ant.taskdefs.Execute;
|
||||
import org.apache.tools.ant.taskdefs.LogStreamHandler;
|
||||
import org.apache.tools.ant.types.Commandline;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
StripTask class.
|
||||
|
@ -47,13 +48,13 @@ public class StripTask extends Task implements EfiDefine {
|
|||
// /
|
||||
private String outputDir = "";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* execute
|
||||
*
|
||||
*
|
||||
* StripTask execute function is to assemble tool command line & execute
|
||||
* tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuidException
|
||||
*/
|
||||
public void execute() throws BuildException {
|
||||
|
@ -107,9 +108,9 @@ public class StripTask extends Task implements EfiDefine {
|
|||
//
|
||||
EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
|
||||
EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFile)).getName());
|
||||
|
||||
|
||||
revl = runner.execute();
|
||||
|
||||
|
||||
if (EFI_SUCCESS == revl) {
|
||||
//
|
||||
// command execution success
|
||||
|
@ -129,9 +130,9 @@ public class StripTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getInputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "inputFile".
|
||||
*
|
||||
*
|
||||
* @return string of input file name.
|
||||
*/
|
||||
public String getInputFile() {
|
||||
|
@ -140,9 +141,9 @@ public class StripTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setComponentType
|
||||
*
|
||||
*
|
||||
* This function is to set class member "inputFile".
|
||||
*
|
||||
*
|
||||
* @param inputFile
|
||||
* string of input file name.
|
||||
*/
|
||||
|
@ -152,9 +153,9 @@ public class StripTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @return outputFile string of output file name.
|
||||
*/
|
||||
public String getOutputFile() {
|
||||
|
@ -163,9 +164,9 @@ public class StripTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @param outputFile
|
||||
* string of output file name.
|
||||
*/
|
||||
|
@ -175,9 +176,9 @@ public class StripTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @return outputDir string of output directory.
|
||||
*/
|
||||
public String getOutputDir() {
|
||||
|
@ -186,9 +187,9 @@ public class StripTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @param outputDir
|
||||
* string of output directory.
|
||||
*/
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
ZeroDebugDataTask class.
|
||||
|
||||
ZeroDebugDataTask is used to call ZeroDebugData.exe to remove debug data.
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -24,7 +24,8 @@ import org.apache.tools.ant.BuildException;
|
|||
import org.apache.tools.ant.taskdefs.Execute;
|
||||
import org.apache.tools.ant.taskdefs.LogStreamHandler;
|
||||
import org.apache.tools.ant.types.Commandline;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
ZeroDebugDataTask class.
|
||||
|
@ -50,10 +51,10 @@ public class ZeroDebugDataTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* execute
|
||||
*
|
||||
*
|
||||
* ZeroDebugDataTask execute function is to assemble tool command line & execute
|
||||
* tool command line
|
||||
*
|
||||
*
|
||||
* @throws BuidException
|
||||
*/
|
||||
public void execute() throws BuildException {
|
||||
|
@ -109,7 +110,7 @@ public class ZeroDebugDataTask extends Task implements EfiDefine {
|
|||
EdkLog.log(EdkLog.EDK_INFO, (new File(this.peFile)).getName());
|
||||
|
||||
revl = runner.execute();
|
||||
|
||||
|
||||
if (EFI_SUCCESS == revl) {
|
||||
//
|
||||
// command execution success
|
||||
|
@ -130,9 +131,9 @@ public class ZeroDebugDataTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getPeFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "inputFile".
|
||||
*
|
||||
*
|
||||
* @return string of input file name.
|
||||
*/
|
||||
public String getPeFile() {
|
||||
|
@ -141,9 +142,9 @@ public class ZeroDebugDataTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setPeFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "peFile".
|
||||
*
|
||||
*
|
||||
* @param peFile
|
||||
* string of input file name.
|
||||
*/
|
||||
|
@ -153,9 +154,9 @@ public class ZeroDebugDataTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @return outputFile string of output file name.
|
||||
*/
|
||||
public String getOutputFile() {
|
||||
|
@ -164,9 +165,9 @@ public class ZeroDebugDataTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputFile
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputFile"
|
||||
*
|
||||
*
|
||||
* @param outputFile
|
||||
* string of output file name.
|
||||
*/
|
||||
|
@ -176,9 +177,9 @@ public class ZeroDebugDataTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* getOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to get class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @return outputDir string of output directory.
|
||||
*/
|
||||
public String getOutputDir() {
|
||||
|
@ -187,9 +188,9 @@ public class ZeroDebugDataTask extends Task implements EfiDefine {
|
|||
|
||||
/**
|
||||
* setOutputDir
|
||||
*
|
||||
*
|
||||
* This function is to set class member "outputDir"
|
||||
*
|
||||
*
|
||||
* @param outputDir
|
||||
* string of output directory.
|
||||
*/
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/** @file
|
||||
This file is ANT task GenBuild.
|
||||
|
||||
The file is used to parse a specified Module, and generate its build time
|
||||
This file is ANT task GenBuild.
|
||||
|
||||
The file is used to parse a specified Module, and generate its build time
|
||||
ANT script build.xml, then call the the ANT script to build the module.
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
|
@ -32,6 +32,8 @@ import org.apache.tools.ant.taskdefs.Ant;
|
|||
import org.apache.tools.ant.taskdefs.Property;
|
||||
import org.apache.xmlbeans.XmlObject;
|
||||
|
||||
import org.tianocore.common.exception.EdkException;
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
import org.tianocore.build.autogen.AutoGen;
|
||||
import org.tianocore.build.fpd.FpdParserTask;
|
||||
import org.tianocore.build.global.GenBuildLogger;
|
||||
|
@ -43,8 +45,6 @@ import org.tianocore.build.id.ModuleIdentification;
|
|||
import org.tianocore.build.id.PackageIdentification;
|
||||
import org.tianocore.build.id.PlatformIdentification;
|
||||
import org.tianocore.build.tools.ModuleItem;
|
||||
import org.tianocore.exception.EdkException;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
/**
|
||||
<p>
|
||||
|
@ -52,48 +52,48 @@ import org.tianocore.logger.EdkLog;
|
|||
system. The main function of this task is to parse module's surface area,
|
||||
then generate the corresponding <em>BaseName_build.xml</em> (the real ANT
|
||||
build script) and call this to build the module. The whole process including:
|
||||
1. generate AutoGen.c and AutoGen.h; 2. build all dependent library instances;
|
||||
1. generate AutoGen.c and AutoGen.h; 2. build all dependent library instances;
|
||||
3. build all source files inlcude AutoGen.c; 4. generate sections;
|
||||
5. generate FFS file if it is driver module while LIB file if it is Library module.
|
||||
5. generate FFS file if it is driver module while LIB file if it is Library module.
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
The usage is (take module <em>HelloWorld</em> for example):
|
||||
</p>
|
||||
|
||||
|
||||
<pre>
|
||||
<GenBuild
|
||||
msaFilename="HelloWorld.msa"/>
|
||||
<GenBuild
|
||||
msaFilename="HelloWorld.msa"/>
|
||||
processTo="ALL"/>
|
||||
</pre>
|
||||
|
||||
<p><code>processTo</code> provides a way to customize the whole build process.
|
||||
processTo can be one value of ALL, AUTOGEN, FILES, LIBRARYINSTANCES, SECTIONS, NONE.
|
||||
Default is ALL, means whole
|
||||
|
||||
<p><code>processTo</code> provides a way to customize the whole build process.
|
||||
processTo can be one value of ALL, AUTOGEN, FILES, LIBRARYINSTANCES, SECTIONS, NONE.
|
||||
Default is ALL, means whole
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
This task calls <code>AutoGen</code> to generate <em>AutoGen.c</em> and
|
||||
<em>AutoGen.h</em>. The task also parses the development environment
|
||||
configuration files, such as collecting package information, setting compiler
|
||||
flags and so on.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
@since GenBuild 1.0
|
||||
**/
|
||||
public class GenBuildTask extends Ant {
|
||||
|
||||
|
||||
///
|
||||
/// Module surface area file.
|
||||
///
|
||||
File msaFile;
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
///
|
||||
private String type = "all"; // = "build";
|
||||
|
||||
|
||||
///
|
||||
/// Module's Identification.
|
||||
///
|
||||
|
@ -102,9 +102,9 @@ public class GenBuildTask extends Ant {
|
|||
private Vector<Property> properties = new Vector<Property>();
|
||||
|
||||
private static Stack<Hashtable> backupPropertiesStack = new Stack<Hashtable>();
|
||||
|
||||
|
||||
private boolean isSingleModuleBuild = false;
|
||||
|
||||
|
||||
/**
|
||||
Public construct method. It is necessary for ANT task.
|
||||
**/
|
||||
|
@ -112,7 +112,7 @@ public class GenBuildTask extends Ant {
|
|||
}
|
||||
|
||||
/**
|
||||
|
||||
|
||||
@throws BuildException
|
||||
From module build, exception from module surface area invalid.
|
||||
**/
|
||||
|
@ -134,7 +134,7 @@ public class GenBuildTask extends Ant {
|
|||
Property item = iter.next();
|
||||
getProject().setProperty(item.getName(), item.getValue());
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// GenBuild should specify either msaFile or moduleGuid & packageGuid
|
||||
//
|
||||
|
@ -165,7 +165,7 @@ public class GenBuildTask extends Ant {
|
|||
else {
|
||||
moduleId.setLibrary(true);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Judge whether it is single module build or not
|
||||
//
|
||||
|
@ -183,29 +183,29 @@ public class GenBuildTask extends Ant {
|
|||
PlatformIdentification platformId = GlobalData.getPlatform(filename);
|
||||
getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));
|
||||
getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));
|
||||
|
||||
|
||||
String packageGuid = getProject().getProperty("PACKAGE_GUID");
|
||||
String packageVersion = getProject().getProperty("PACKAGE_VERSION");
|
||||
PackageIdentification packageId = new PackageIdentification(packageGuid, packageVersion);
|
||||
moduleId.setPackage(packageId);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// If single module : intersection MSA supported ARCHs and tools def!!
|
||||
// else, get arch from pass down
|
||||
//
|
||||
Set<String> archListSupByToolChain = new LinkedHashSet<String>();
|
||||
String[] archs = GlobalData.getToolChainInfo().getArchs();
|
||||
|
||||
Set<String> archListSupByToolChain = new LinkedHashSet<String>();
|
||||
String[] archs = GlobalData.getToolChainInfo().getArchs();
|
||||
|
||||
for (int i = 0; i < archs.length; i ++) {
|
||||
archListSupByToolChain.add(archs[i]);
|
||||
}
|
||||
|
||||
|
||||
Set<String> archSet = new LinkedHashSet<String>();
|
||||
|
||||
|
||||
if ( getProject().getProperty("ARCH") != null) {
|
||||
String[] fpdArchList = getProject().getProperty("ARCH").split(" ");
|
||||
|
||||
|
||||
for (int i = 0; i < fpdArchList.length; i++) {
|
||||
if (archListSupByToolChain.contains(fpdArchList[i])) {
|
||||
archSet.add(fpdArchList[i]);
|
||||
|
@ -213,11 +213,11 @@ public class GenBuildTask extends Ant {
|
|||
}
|
||||
}
|
||||
else {
|
||||
archSet = archListSupByToolChain;
|
||||
archSet = archListSupByToolChain;
|
||||
}
|
||||
|
||||
|
||||
String[] archList = archSet.toArray(new String[archSet.size()]);
|
||||
|
||||
|
||||
//
|
||||
// Judge if arch is all supported by current module. If not, throw Exception.
|
||||
//
|
||||
|
@ -229,13 +229,13 @@ public class GenBuildTask extends Ant {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (int k = 0; k < archList.length; k++) {
|
||||
|
||||
|
||||
getProject().setProperty("ARCH", archList[k]);
|
||||
|
||||
|
||||
FpdModuleIdentification fpdModuleId = new FpdModuleIdentification(moduleId, archList[k]);
|
||||
|
||||
|
||||
//
|
||||
// Whether the module is built before
|
||||
//
|
||||
|
@ -247,7 +247,7 @@ public class GenBuildTask extends Ant {
|
|||
} else {
|
||||
GlobalData.registerBuiltModule(fpdModuleId);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// For Every TOOLCHAIN, TARGET
|
||||
//
|
||||
|
@ -263,7 +263,7 @@ public class GenBuildTask extends Ant {
|
|||
//
|
||||
// check if any tool is defined for current target + toolchain + arch
|
||||
// don't do anything if no tools found
|
||||
//
|
||||
//
|
||||
if (GlobalData.isCommandSet(targetList[i], toolchainList[j], archList[k]) == false) {
|
||||
System.out.println("Warning: No build issued. No tools were found for [target=" + targetList[i] + " toolchain=" + toolchainList[j] + " arch=" + archList[k] + "]\n");
|
||||
continue;
|
||||
|
@ -278,7 +278,7 @@ public class GenBuildTask extends Ant {
|
|||
System.out.println("Build " + moduleId + " start >>>");
|
||||
System.out.println("Target: " + targetList[i] + " Tagname: " + toolchainList[j] + " Arch: " + archList[k]);
|
||||
SurfaceAreaQuery.setDoc(GlobalData.getDoc(fpdModuleId));
|
||||
|
||||
|
||||
//
|
||||
// Prepare for all other common properties
|
||||
// PACKAGE, PACKAGE_GUID, PACKAGE_VERSION, PACKAGE_DIR, PACKAGE_RELATIVE_DIR
|
||||
|
@ -287,13 +287,13 @@ public class GenBuildTask extends Ant {
|
|||
// SUBSYSTEM, ENTRYPOINT, EBC_TOOL_LIB_PATH
|
||||
//
|
||||
setModuleCommonProperties(archList[k]);
|
||||
|
||||
|
||||
//
|
||||
// OutputManage prepare for
|
||||
// OutputManage prepare for
|
||||
// BIN_DIR, DEST_DIR_DEBUG, DEST_DIR_OUTPUT, BUILD_DIR, FV_DIR
|
||||
//
|
||||
OutputManager.getInstance().update(getProject());
|
||||
|
||||
|
||||
if (type.equalsIgnoreCase("all") || type.equalsIgnoreCase("build")) {
|
||||
applyBuild(targetList[i], toolchainList[j], fpdModuleId);
|
||||
}
|
||||
|
@ -313,13 +313,13 @@ public class GenBuildTask extends Ant {
|
|||
}
|
||||
|
||||
/**
|
||||
This method is used to prepare Platform-related information.
|
||||
|
||||
This method is used to prepare Platform-related information.
|
||||
|
||||
<p>In Single Module Build mode, platform-related information is not ready.
|
||||
The method read the system environment variable <code>ACTIVE_PLATFORM</code>
|
||||
The method read the system environment variable <code>ACTIVE_PLATFORM</code>
|
||||
and search in the Framework Database. Note that platform name in the Framework
|
||||
Database must be unique. </p>
|
||||
|
||||
|
||||
**/
|
||||
private void prepareSingleModuleBuild(){
|
||||
//
|
||||
|
@ -327,27 +327,27 @@ public class GenBuildTask extends Ant {
|
|||
// TBD: Enhance it!!!!
|
||||
//
|
||||
PackageIdentification packageId = GlobalData.getPackageForModule(moduleId);
|
||||
|
||||
|
||||
moduleId.setPackage(packageId);
|
||||
|
||||
|
||||
//
|
||||
// Read ACTIVE_PLATFORM's FPD file (Call FpdParserTask's method)
|
||||
//
|
||||
String filename = getProject().getProperty("PLATFORM_FILE");
|
||||
|
||||
|
||||
if (filename == null){
|
||||
throw new BuildException("Please set ACTIVE_PLATFORM in the file: Tools/Conf/target.txt if you want to build a single module!");
|
||||
}
|
||||
|
||||
|
||||
PlatformIdentification platformId = GlobalData.getPlatform(filename);
|
||||
|
||||
|
||||
//
|
||||
// Read FPD file
|
||||
//
|
||||
FpdParserTask fpdParser = new FpdParserTask();
|
||||
fpdParser.setProject(getProject());
|
||||
fpdParser.parseFpdFile(platformId.getFpdFile());
|
||||
|
||||
|
||||
//
|
||||
// Prepare for Platform related common properties
|
||||
// PLATFORM, PLATFORM_DIR, PLATFORM_RELATIVE_DIR
|
||||
|
@ -372,7 +372,7 @@ public class GenBuildTask extends Ant {
|
|||
getProject().setProperty("PACKAGE_VERSION", packageId.getVersion());
|
||||
getProject().setProperty("PACKAGE_DIR", packageId.getPackageDir().replaceAll("(\\\\)", "/"));
|
||||
getProject().setProperty("PACKAGE_RELATIVE_DIR", packageId.getPackageRelativeDir().replaceAll("(\\\\)", "/"));
|
||||
|
||||
|
||||
//
|
||||
// MODULE or BASE_NAME, GUID or FILE_GUID, VERSION, MODULE_TYPE
|
||||
// MODULE_DIR, MODULE_RELATIVE_DIR
|
||||
|
@ -391,24 +391,24 @@ public class GenBuildTask extends Ant {
|
|||
getProject().setProperty("MODULE_TYPE", moduleId.getModuleType());
|
||||
getProject().setProperty("MODULE_DIR", moduleId.getMsaFile().getParent().replaceAll("(\\\\)", "/"));
|
||||
getProject().setProperty("MODULE_RELATIVE_DIR", moduleId.getModuleRelativePath().replaceAll("(\\\\)", "/"));
|
||||
|
||||
|
||||
//
|
||||
// SUBSYSTEM
|
||||
//
|
||||
String[][] subsystemMap = { { "BASE", "EFI_BOOT_SERVICE_DRIVER"},
|
||||
{ "SEC", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "PEI_CORE", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "PEIM", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "SEC", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "PEI_CORE", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "PEIM", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "DXE_CORE", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "DXE_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "DXE_RUNTIME_DRIVER", "EFI_RUNTIME_DRIVER" },
|
||||
{ "DXE_SAL_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "DXE_SMM_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "TOOL", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "DXE_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "DXE_RUNTIME_DRIVER", "EFI_RUNTIME_DRIVER" },
|
||||
{ "DXE_SAL_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "DXE_SMM_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "TOOL", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "UEFI_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },
|
||||
{ "UEFI_APPLICATION", "EFI_APPLICATION" },
|
||||
{ "USER_DEFINED", "EFI_BOOT_SERVICE_DRIVER"} };
|
||||
|
||||
{ "UEFI_APPLICATION", "EFI_APPLICATION" },
|
||||
{ "USER_DEFINED", "EFI_BOOT_SERVICE_DRIVER"} };
|
||||
|
||||
String subsystem = "EFI_BOOT_SERVICE_DRIVER";
|
||||
for (int i = 0; i < subsystemMap.length; i++) {
|
||||
if (moduleId.getModuleType().equalsIgnoreCase(subsystemMap[i][0])) {
|
||||
|
@ -417,7 +417,7 @@ public class GenBuildTask extends Ant {
|
|||
}
|
||||
}
|
||||
getProject().setProperty("SUBSYSTEM", subsystem);
|
||||
|
||||
|
||||
//
|
||||
// ENTRYPOINT
|
||||
//
|
||||
|
@ -427,7 +427,7 @@ public class GenBuildTask extends Ant {
|
|||
else {
|
||||
getProject().setProperty("ENTRYPOINT", "_ModuleEntryPoint");
|
||||
}
|
||||
|
||||
|
||||
getProject().setProperty("OBJECTS", "");
|
||||
}
|
||||
|
||||
|
@ -444,7 +444,7 @@ public class GenBuildTask extends Ant {
|
|||
String cmdName = GlobalData.getCommandSetting(key, fpdModuleId);
|
||||
File cmdFile = new File(cmdPath + File.separatorChar + cmdName);
|
||||
getProject().setProperty(cmd[m], cmdFile.getPath().replaceAll("(\\\\)", "/"));
|
||||
|
||||
|
||||
//
|
||||
// set CC_FLAGS
|
||||
//
|
||||
|
@ -454,7 +454,7 @@ public class GenBuildTask extends Ant {
|
|||
Set<String> subset = new LinkedHashSet<String>();
|
||||
putFlagsToSet(addset, cmdFlags);
|
||||
getProject().setProperty(cmd[m] + "_FLAGS", getProject().replaceProperties(getFlags(addset, subset)));
|
||||
|
||||
|
||||
//
|
||||
// Set CC_EXT
|
||||
//
|
||||
|
@ -466,7 +466,7 @@ public class GenBuildTask extends Ant {
|
|||
else {
|
||||
getProject().setProperty(cmd[m] + "_EXT", "");
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// set CC_FAMILY
|
||||
//
|
||||
|
@ -475,7 +475,7 @@ public class GenBuildTask extends Ant {
|
|||
if (toolChainFamily != null) {
|
||||
getProject().setProperty(cmd[m] + "_FAMILY", toolChainFamily);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// set CC_SPATH
|
||||
//
|
||||
|
@ -487,7 +487,7 @@ public class GenBuildTask extends Ant {
|
|||
else {
|
||||
getProject().setProperty(cmd[m] + "_SPATH", "");
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// set CC_DPATH
|
||||
//
|
||||
|
@ -501,19 +501,19 @@ public class GenBuildTask extends Ant {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setMsaFile(File msaFile) {
|
||||
this.msaFile = msaFile;
|
||||
}
|
||||
|
||||
/**
|
||||
Method is for ANT to initialize MSA file.
|
||||
|
||||
Method is for ANT to initialize MSA file.
|
||||
|
||||
@param msaFilename MSA file name
|
||||
**/
|
||||
public void setMsaFile(String msaFilename) {
|
||||
String moduleDir = getProject().getProperty("MODULE_DIR");
|
||||
|
||||
|
||||
//
|
||||
// If is Single Module Build, then use the Base Dir defined in build.xml
|
||||
//
|
||||
|
@ -522,17 +522,17 @@ public class GenBuildTask extends Ant {
|
|||
}
|
||||
msaFile = new File(moduleDir + File.separatorChar + msaFilename);
|
||||
}
|
||||
|
||||
|
||||
public void addConfiguredModuleItem(ModuleItem moduleItem) {
|
||||
PackageIdentification packageId = new PackageIdentification(moduleItem.getPackageGuid(), moduleItem.getPackageVersion());
|
||||
ModuleIdentification moduleId = new ModuleIdentification(moduleItem.getModuleGuid(), moduleItem.getModuleVersion());
|
||||
moduleId.setPackage(packageId);
|
||||
this.moduleId = moduleId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Add a property.
|
||||
|
||||
Add a property.
|
||||
|
||||
@param p property
|
||||
**/
|
||||
public void addProperty(Property p) {
|
||||
|
@ -542,21 +542,21 @@ public class GenBuildTask extends Ant {
|
|||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
private void applyBuild(String buildTarget, String buildTagname, FpdModuleIdentification fpdModuleId) throws EdkException{
|
||||
//
|
||||
// AutoGen
|
||||
//
|
||||
|
||||
|
||||
AutoGen autogen = new AutoGen(getProject().getProperty("FV_DIR"), getProject().getProperty("DEST_DIR_DEBUG"), fpdModuleId.getModule(),fpdModuleId.getArch());
|
||||
autogen.genAutogen();
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Get compiler flags
|
||||
//
|
||||
getCompilerFlags(buildTarget, buildTagname, fpdModuleId);
|
||||
|
||||
|
||||
//
|
||||
// Prepare LIBS
|
||||
//
|
||||
|
@ -566,7 +566,7 @@ public class GenBuildTask extends Ant {
|
|||
propertyLibs += " " + getProject().getProperty("BIN_DIR") + File.separatorChar + libinstances[i].getName() + ".lib";
|
||||
}
|
||||
getProject().setProperty("LIBS", propertyLibs.replaceAll("(\\\\)", "/"));
|
||||
|
||||
|
||||
//
|
||||
// if it is CUSTOM_BUILD
|
||||
// then call the exist BaseName_build.xml directly.
|
||||
|
@ -581,7 +581,7 @@ public class GenBuildTask extends Ant {
|
|||
ant.execute();
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Generate ${BASE_NAME}_build.xml
|
||||
// TBD
|
||||
|
@ -590,7 +590,7 @@ public class GenBuildTask extends Ant {
|
|||
ModuleBuildFileGenerator fileGenerator = new ModuleBuildFileGenerator(getProject(), ffsKeyword, fpdModuleId);
|
||||
String buildFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml";
|
||||
fileGenerator.genBuildFile(buildFilename);
|
||||
|
||||
|
||||
//
|
||||
// Ant call ${BASE_NAME}_build.xml
|
||||
//
|
||||
|
@ -601,7 +601,7 @@ public class GenBuildTask extends Ant {
|
|||
ant.init();
|
||||
ant.execute();
|
||||
}
|
||||
|
||||
|
||||
private void applyClean(FpdModuleIdentification fpdModuleId){
|
||||
//
|
||||
// if it is CUSTOM_BUILD
|
||||
|
@ -618,7 +618,7 @@ public class GenBuildTask extends Ant {
|
|||
ant.execute();
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
Ant ant = new Ant();
|
||||
ant.setProject(getProject());
|
||||
ant.setAntfile(getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml");
|
||||
|
@ -626,12 +626,12 @@ public class GenBuildTask extends Ant {
|
|||
ant.setInheritAll(true);
|
||||
ant.init();
|
||||
ant.execute();
|
||||
|
||||
|
||||
//
|
||||
// Delete current module's DEST_DIR_OUTPUT
|
||||
// TBD
|
||||
}
|
||||
|
||||
|
||||
private void applyCleanall(FpdModuleIdentification fpdModuleId){
|
||||
//
|
||||
// if it is CUSTOM_BUILD
|
||||
|
@ -648,7 +648,7 @@ public class GenBuildTask extends Ant {
|
|||
ant.execute();
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
Ant ant = new Ant();
|
||||
ant.setProject(getProject());
|
||||
ant.setAntfile(getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml");
|
||||
|
@ -656,7 +656,7 @@ public class GenBuildTask extends Ant {
|
|||
ant.setInheritAll(true);
|
||||
ant.init();
|
||||
ant.execute();
|
||||
|
||||
|
||||
//
|
||||
// Delete current module's DEST_DIR_OUTPUT
|
||||
// TBD
|
||||
|
@ -667,17 +667,17 @@ public class GenBuildTask extends Ant {
|
|||
|
||||
/**
|
||||
Separate the string and instore in set.
|
||||
|
||||
<p> String is separated by Java Regulation Expression
|
||||
|
||||
<p> String is separated by Java Regulation Expression
|
||||
"[^\\\\]?(\".*?[^\\\\]\")[ \t,]+". </p>
|
||||
|
||||
|
||||
<p>For example: </p>
|
||||
|
||||
|
||||
<pre>
|
||||
"/nologo", "/W3", "/WX"
|
||||
"/C", "/DSTRING_DEFINES_FILE=\"BdsStrDefs.h\""
|
||||
</pre>
|
||||
|
||||
|
||||
@param set store the separated string
|
||||
@param str string to separate
|
||||
**/
|
||||
|
@ -693,10 +693,10 @@ public class GenBuildTask extends Ant {
|
|||
set.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Generate the final flags string will be used by compile command.
|
||||
|
||||
Generate the final flags string will be used by compile command.
|
||||
|
||||
@param add the add flags set
|
||||
@param sub the sub flags set
|
||||
@return final flags after add set substract sub set
|
||||
|
@ -715,7 +715,7 @@ public class GenBuildTask extends Ant {
|
|||
private void pushProperties() {
|
||||
backupPropertiesStack.push(getProject().getProperties());
|
||||
}
|
||||
|
||||
|
||||
private void popProperties() {
|
||||
Hashtable backupProperties = backupPropertiesStack.pop();
|
||||
Set keys = backupProperties.keySet();
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
|
||||
This class is to generate Autogen.h and Autogen.c according to module surface area
|
||||
or library surface area.
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
@ -44,7 +44,8 @@ import org.tianocore.build.global.SurfaceAreaQuery;
|
|||
import org.tianocore.build.id.ModuleIdentification;
|
||||
import org.tianocore.build.id.PackageIdentification;
|
||||
import org.tianocore.build.pcd.action.PCDAutoGenAction;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
|
||||
/**
|
||||
* This class is to generate Autogen.h and Autogen.c according to module surface
|
||||
|
@ -55,9 +56,9 @@ public class AutoGen {
|
|||
// / The output path of Autogen.h and Autogen.c
|
||||
// /
|
||||
private String outputPath;
|
||||
///
|
||||
/// The name of FV directory
|
||||
///
|
||||
///
|
||||
/// The name of FV directory
|
||||
///
|
||||
private String fvDir;
|
||||
// /
|
||||
// / The base name of module or library.
|
||||
|
@ -92,7 +93,7 @@ public class AutoGen {
|
|||
// / dependence on library instance surface area.
|
||||
// /
|
||||
private Set<String> mGuidList = new HashSet<String>();
|
||||
|
||||
|
||||
//
|
||||
// The dependence package list which recoreded in module or library surface
|
||||
// area and it's dependence on library instance surface are.
|
||||
|
@ -100,24 +101,24 @@ public class AutoGen {
|
|||
private List<PackageIdentification> mDepPkgList = new LinkedList<PackageIdentification>();
|
||||
|
||||
//
|
||||
// For non library module, add its library instance's construct and destructor to
|
||||
// For non library module, add its library instance's construct and destructor to
|
||||
// list.
|
||||
//
|
||||
//
|
||||
private List<String> libConstructList = new ArrayList<String>();
|
||||
private List<String> libDestructList = new ArrayList<String>();
|
||||
|
||||
//
|
||||
// List to store SetVirtalAddressMapCallBack, ExitBootServiceCallBack
|
||||
//
|
||||
// List to store SetVirtalAddressMapCallBack, ExitBootServiceCallBack
|
||||
//
|
||||
private List<String> setVirtalAddList = new ArrayList<String>();
|
||||
private List<String> exitBootServiceList = new ArrayList<String>();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Construct function
|
||||
*
|
||||
*
|
||||
* This function mainly initialize some member variable.
|
||||
*
|
||||
*
|
||||
* @param outputPath
|
||||
* Output path of AutoGen file.
|
||||
* @param baseName
|
||||
|
@ -135,9 +136,9 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* saveFile function
|
||||
*
|
||||
*
|
||||
* This function save the content in stringBuffer to file.
|
||||
*
|
||||
*
|
||||
* @param fileName
|
||||
* The name of file.
|
||||
* @param fileBuffer
|
||||
|
@ -176,10 +177,10 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* genAutogen function
|
||||
*
|
||||
*
|
||||
* This function call libGenAutoGen or moduleGenAutogen function, which
|
||||
* dependence on generate library autogen or module autogen.
|
||||
*
|
||||
*
|
||||
* @throws BuildException
|
||||
* Failed to creat AutoGen.c & AutoGen.h.
|
||||
*/
|
||||
|
@ -210,9 +211,9 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* moduleGenAutogen function
|
||||
*
|
||||
*
|
||||
* This function generates AutoGen.c & AutoGen.h for module.
|
||||
*
|
||||
*
|
||||
* @throws BuildException
|
||||
* Faile to create module AutoGen.c & AutoGen.h.
|
||||
*/
|
||||
|
@ -231,9 +232,9 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* libGenAutogen function
|
||||
*
|
||||
*
|
||||
* This function generates AutoGen.c & AutoGen.h for library.
|
||||
*
|
||||
*
|
||||
* @throws BuildException
|
||||
* Faile to create library AutoGen.c & AutoGen.h
|
||||
*/
|
||||
|
@ -250,9 +251,9 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* moduleGenAutogenH
|
||||
*
|
||||
*
|
||||
* This function generates AutoGen.h for module.
|
||||
*
|
||||
*
|
||||
* @throws BuildException
|
||||
* Failed to generate AutoGen.h.
|
||||
*/
|
||||
|
@ -340,9 +341,9 @@ public class AutoGen {
|
|||
fileBuffer.append("\r\n");
|
||||
|
||||
//
|
||||
// If is TianoR8FlashMap, copy {Fv_DIR}/FlashMap.h to
|
||||
// If is TianoR8FlashMap, copy {Fv_DIR}/FlashMap.h to
|
||||
// {DEST_DIR_DRBUG}/FlashMap.h
|
||||
//
|
||||
//
|
||||
if (SurfaceAreaQuery.isHaveTianoR8FlashMap()) {
|
||||
fileBuffer.append(CommonDefinition.include);
|
||||
fileBuffer.append(" <");
|
||||
|
@ -372,9 +373,9 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* moduleGenAutogenC
|
||||
*
|
||||
*
|
||||
* This function generates AutoGen.c for module.
|
||||
*
|
||||
*
|
||||
* @throws BuildException
|
||||
* Failed to generate AutoGen.c.
|
||||
*/
|
||||
|
@ -452,7 +453,7 @@ public class AutoGen {
|
|||
// autogen.c
|
||||
//
|
||||
LibInstanceToAutogenC(fileBuffer);
|
||||
|
||||
|
||||
//
|
||||
// Get module dependent Package identification.
|
||||
//
|
||||
|
@ -461,9 +462,9 @@ public class AutoGen {
|
|||
if (!this.mDepPkgList.contains(packages[i])){
|
||||
this.mDepPkgList.add(packages[i]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Write consumed ppi, guid, protocol to autogen.c
|
||||
//
|
||||
|
@ -472,7 +473,7 @@ public class AutoGen {
|
|||
GuidGuidToAutogenC(fileBuffer);
|
||||
|
||||
//
|
||||
// Call pcd autogen.
|
||||
// Call pcd autogen.
|
||||
//
|
||||
this.myPcdAutogen = new PCDAutoGenAction(moduleId, this.arch, false, null);
|
||||
try {
|
||||
|
@ -480,7 +481,7 @@ public class AutoGen {
|
|||
} catch (Exception exp) {
|
||||
throw new PcdAutogenException (exp.getMessage());
|
||||
}
|
||||
|
||||
|
||||
if (this.myPcdAutogen != null) {
|
||||
fileBuffer.append("\r\n");
|
||||
fileBuffer.append(this.myPcdAutogen.OutputC());
|
||||
|
@ -494,9 +495,9 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* libGenAutogenH
|
||||
*
|
||||
*
|
||||
* This function generates AutoGen.h for library.
|
||||
*
|
||||
*
|
||||
* @throws BuildException
|
||||
* Failed to generate AutoGen.c.
|
||||
*/
|
||||
|
@ -537,7 +538,7 @@ public class AutoGen {
|
|||
|
||||
//
|
||||
// Write consumed package's mdouleInfo related *.h file to autogen.h.
|
||||
//
|
||||
//
|
||||
moduleType = SurfaceAreaQuery.getModuleType();
|
||||
PackageIdentification[] cosumedPkglist = SurfaceAreaQuery
|
||||
.getDependencePkg(this.arch);
|
||||
|
@ -571,9 +572,9 @@ public class AutoGen {
|
|||
fileBuffer.append("\r\n");
|
||||
|
||||
//
|
||||
// If is TianoR8FlashMap, copy {Fv_DIR}/FlashMap.h to
|
||||
// If is TianoR8FlashMap, copy {Fv_DIR}/FlashMap.h to
|
||||
// {DEST_DIR_DRBUG}/FlashMap.h
|
||||
//
|
||||
//
|
||||
if (SurfaceAreaQuery.isHaveTianoR8FlashMap()) {
|
||||
fileBuffer.append(CommonDefinition.include);
|
||||
fileBuffer.append(" <");
|
||||
|
@ -604,9 +605,9 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* libGenAutogenC
|
||||
*
|
||||
*
|
||||
* This function generates AutoGen.h for library.
|
||||
*
|
||||
*
|
||||
* @throws BuildException
|
||||
* Failed to generate AutoGen.c.
|
||||
*/
|
||||
|
@ -622,11 +623,11 @@ public class AutoGen {
|
|||
fileBuffer.append("\r\n");
|
||||
|
||||
//
|
||||
// Call pcd autogen.
|
||||
// Call pcd autogen.
|
||||
//
|
||||
this.myPcdAutogen = new PCDAutoGenAction(this.moduleId,
|
||||
this.arch,
|
||||
true,
|
||||
true,
|
||||
SurfaceAreaQuery.getModulePcdEntryNameArray());
|
||||
try {
|
||||
this.myPcdAutogen.execute();
|
||||
|
@ -646,10 +647,10 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* LibraryClassToAutogenH
|
||||
*
|
||||
*
|
||||
* This function returns *.h files declared by library classes which are
|
||||
* consumed or produced by current build module or library.
|
||||
*
|
||||
*
|
||||
* @param libClassList
|
||||
* List of library class which consumed or produce by current
|
||||
* build module or library.
|
||||
|
@ -689,9 +690,9 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* IncludesToAutogenH
|
||||
*
|
||||
*
|
||||
* This function add include file in AutoGen.h file.
|
||||
*
|
||||
*
|
||||
* @param packageNameList
|
||||
* List of module depended package.
|
||||
* @param moduleType
|
||||
|
@ -727,10 +728,10 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* EntryPointToAutoGen
|
||||
*
|
||||
*
|
||||
* This function convert <ModuleEntryPoint> & <ModuleUnloadImage>
|
||||
* information in mas to AutoGen.c
|
||||
*
|
||||
*
|
||||
* @param entryPointList
|
||||
* List of entry point.
|
||||
* @param fileBuffer
|
||||
|
@ -833,7 +834,7 @@ public class AutoGen {
|
|||
.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
|
||||
fileBuffer.append(" );\r\n");
|
||||
entryPointCount++;
|
||||
|
||||
|
||||
}
|
||||
|
||||
fileBuffer.append("EFI_STATUS\r\n");
|
||||
|
@ -918,7 +919,7 @@ public class AutoGen {
|
|||
fileBuffer.append(" )\r\n\r\n");
|
||||
fileBuffer.append("{\r\n");
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < entryPointList.length; i++) {
|
||||
fileBuffer
|
||||
.append(" if (SetJump (&mJumpContext) == 0) {\r\n");
|
||||
|
@ -927,7 +928,7 @@ public class AutoGen {
|
|||
fileBuffer.append(" (ImageHandle, SystemTable));\r\n");
|
||||
fileBuffer.append(" ASSERT (FALSE);\r\n");
|
||||
fileBuffer.append(" }\r\n");
|
||||
|
||||
|
||||
}
|
||||
fileBuffer.append(" return mDriverEntryPointStatus;\r\n");
|
||||
fileBuffer.append("}\r\n\r\n");
|
||||
|
@ -945,10 +946,10 @@ public class AutoGen {
|
|||
fileBuffer.append(" LongJump (&mJumpContext, (UINTN)-1);\r\n");
|
||||
fileBuffer.append(" ASSERT (FALSE);\r\n");
|
||||
fileBuffer.append("}\r\n\r\n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Add "ModuleUnloadImage" for DxeSmmDriver module type;
|
||||
//
|
||||
|
@ -1034,10 +1035,10 @@ public class AutoGen {
|
|||
fileBuffer.append("{\r\n");
|
||||
fileBuffer.append(" return EFI_SUCCESS;\r\n");
|
||||
fileBuffer.append("}\r\n");
|
||||
|
||||
|
||||
}else {
|
||||
for (int i = 0; i < entryPointList.length; i++) {
|
||||
|
||||
|
||||
fileBuffer.append("EFI_STATUS\r\n");
|
||||
fileBuffer.append("EFIAPI\r\n");
|
||||
fileBuffer.append(entryPointList[i]);
|
||||
|
@ -1114,7 +1115,7 @@ public class AutoGen {
|
|||
fileBuffer.append("}\r\n\r\n");
|
||||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Add ModuleUnloadImage for DxeDriver and UefiDriver module type.
|
||||
//
|
||||
|
@ -1184,10 +1185,10 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* PpiGuidToAutogenc
|
||||
*
|
||||
*
|
||||
* This function gets GUIDs from SPD file accrodeing to <PPIs> information
|
||||
* and write those GUIDs to AutoGen.c.
|
||||
*
|
||||
*
|
||||
* @param fileBuffer
|
||||
* String Buffer for Autogen.c file.
|
||||
* @throws BuildException
|
||||
|
@ -1200,7 +1201,7 @@ public class AutoGen {
|
|||
// Get the all PPI adn PPI Notify from MSA file,
|
||||
// then add those PPI ,and PPI Notify name to list.
|
||||
//
|
||||
|
||||
|
||||
String[] ppiList = SurfaceAreaQuery.getPpiArray(this.arch);
|
||||
for (int i = 0; i < ppiList.length; i++) {
|
||||
this.mPpiList.add(ppiList[i]);
|
||||
|
@ -1238,10 +1239,10 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* ProtocolGuidToAutogenc
|
||||
*
|
||||
*
|
||||
* This function gets GUIDs from SPD file accrodeing to <Protocol>
|
||||
* information and write those GUIDs to AutoGen.c.
|
||||
*
|
||||
*
|
||||
* @param fileBuffer
|
||||
* String Buffer for Autogen.c file.
|
||||
* @throws BuildException
|
||||
|
@ -1271,8 +1272,8 @@ public class AutoGen {
|
|||
//
|
||||
Iterator protocolIterator = this.mProtocolList.iterator();
|
||||
String protocolKeyWord = null;
|
||||
|
||||
|
||||
|
||||
|
||||
while (protocolIterator.hasNext()) {
|
||||
protocolKeyWord = protocolIterator.next().toString();
|
||||
cNameGuid = GlobalData.getProtocolGuid(this.mDepPkgList, protocolKeyWord);
|
||||
|
@ -1295,13 +1296,13 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* GuidGuidToAutogenc
|
||||
*
|
||||
*
|
||||
* This function gets GUIDs from SPD file accrodeing to <Guids> information
|
||||
* and write those GUIDs to AutoGen.c.
|
||||
*
|
||||
*
|
||||
* @param fileBuffer
|
||||
* String Buffer for Autogen.c file.
|
||||
*
|
||||
*
|
||||
*/
|
||||
void GuidGuidToAutogenC(StringBuffer fileBuffer) throws AutoGenException {
|
||||
String[] cNameGuid = null;
|
||||
|
@ -1339,11 +1340,11 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* LibInstanceToAutogenC
|
||||
*
|
||||
*
|
||||
* This function adds dependent library instance to autogen.c,which
|
||||
* includeing library's constructor, destructor, and library dependent ppi,
|
||||
* protocol, guid, pcd information.
|
||||
*
|
||||
*
|
||||
* @param fileBuffer
|
||||
* String buffer for AutoGen.c
|
||||
* @throws BuildException
|
||||
|
@ -1367,10 +1368,10 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* LibConstructorToAutogenc
|
||||
*
|
||||
*
|
||||
* This function writes library constructor list to AutoGen.c. The library
|
||||
* constructor's parameter and return value depend on module type.
|
||||
*
|
||||
*
|
||||
* @param libInstanceList
|
||||
* List of library construct name.
|
||||
* @param moduleType
|
||||
|
@ -1508,10 +1509,10 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* LibDestructorToAutogenc
|
||||
*
|
||||
*
|
||||
* This function writes library destructor list to AutoGen.c. The library
|
||||
* destructor's parameter and return value depend on module type.
|
||||
*
|
||||
*
|
||||
* @param libInstanceList
|
||||
* List of library destructor name.
|
||||
* @param moduleType
|
||||
|
@ -1588,7 +1589,7 @@ public class AutoGen {
|
|||
//
|
||||
// If no library destructor function, return EFI_SUCCESS.
|
||||
//
|
||||
|
||||
|
||||
for (int i = 0; i < libInstanceList.size(); i++) {
|
||||
if (isFirst) {
|
||||
fileBuffer.append(" EFI_STATUS Status;\r\n");
|
||||
|
@ -1608,10 +1609,10 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* ExternsDriverBindingToAutoGenC
|
||||
*
|
||||
*
|
||||
* This function is to write DRIVER_BINDING, COMPONENT_NAME,
|
||||
* DRIVER_CONFIGURATION, DRIVER_DIAGNOSTIC in AutoGen.c.
|
||||
*
|
||||
*
|
||||
* @param fileBuffer
|
||||
* String buffer for AutoGen.c
|
||||
*/
|
||||
|
@ -1762,10 +1763,10 @@ public class AutoGen {
|
|||
|
||||
/**
|
||||
* ExternCallBackToAutoGenC
|
||||
*
|
||||
*
|
||||
* This function adds <SetVirtualAddressMapCallBack> and
|
||||
* <ExitBootServicesCallBack> infomation to AutoGen.c
|
||||
*
|
||||
*
|
||||
* @param fileBuffer
|
||||
* String buffer for AutoGen.c
|
||||
* @throws BuildException
|
||||
|
@ -1773,10 +1774,10 @@ public class AutoGen {
|
|||
void ExternCallBackToAutoGenC(StringBuffer fileBuffer)
|
||||
throws BuildException {
|
||||
//
|
||||
// Collect module's <SetVirtualAddressMapCallBack> and
|
||||
// <ExitBootServiceCallBack> and add to setVirtualAddList
|
||||
// Collect module's <SetVirtualAddressMapCallBack> and
|
||||
// <ExitBootServiceCallBack> and add to setVirtualAddList
|
||||
// exitBootServiceList.
|
||||
//
|
||||
//
|
||||
String[] setVirtuals = SurfaceAreaQuery.getSetVirtualAddressMapCallBackArray();
|
||||
String[] exitBoots = SurfaceAreaQuery.getExitBootServicesCallBackArray();
|
||||
if (setVirtuals != null) {
|
||||
|
@ -1791,8 +1792,8 @@ public class AutoGen {
|
|||
}
|
||||
//
|
||||
// Add c code in autogen.c which relate to <SetVirtualAddressMapCallBack>
|
||||
// and <ExitBootServicesCallBack>
|
||||
//
|
||||
// and <ExitBootServicesCallBack>
|
||||
//
|
||||
String moduleType = this.moduleId.getModuleType();
|
||||
boolean UefiOrDxeModule = false;
|
||||
int Count = 0;
|
||||
|
@ -1879,8 +1880,8 @@ public class AutoGen {
|
|||
}
|
||||
//
|
||||
// If module is not DXE_DRIVER, DXE_RUNTIME_DIRVER, UEFI_DRIVER
|
||||
// UEFI_APPLICATION and DXE_SAL_DRIVER add the NULL at the end of
|
||||
// _gDriverSetVirtualAddressMapEvent list.
|
||||
// UEFI_APPLICATION and DXE_SAL_DRIVER add the NULL at the end of
|
||||
// _gDriverSetVirtualAddressMapEvent list.
|
||||
//
|
||||
if (!UefiOrDxeModule) {
|
||||
fileBuffer.append(",\r\n NULL");
|
||||
|
@ -1966,15 +1967,15 @@ public class AutoGen {
|
|||
}
|
||||
|
||||
private void copyFlashMapHToDebugDir() throws AutoGenException{
|
||||
|
||||
|
||||
File inFile = new File(fvDir + File.separatorChar + CommonDefinition.flashMapH);
|
||||
int size = (int)inFile.length();
|
||||
byte[] buffer = new byte[size];
|
||||
File outFile = new File (this.outputPath + File.separatorChar + CommonDefinition.tianoR8FlashMapH);
|
||||
//
|
||||
// If TianoR8FlashMap.h existed and the flashMap.h don't change,
|
||||
// If TianoR8FlashMap.h existed and the flashMap.h don't change,
|
||||
// do nothing.
|
||||
//
|
||||
//
|
||||
if ((!outFile.exists()) ||(inFile.lastModified() - outFile.lastModified()) >= 0) {
|
||||
try{
|
||||
if (inFile.exists()) {
|
||||
|
@ -1992,7 +1993,7 @@ public class AutoGen {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*This function first order the library instances, then collect
|
||||
*library instance 's PPI, Protocol, GUID,
|
||||
|
@ -2094,9 +2095,9 @@ public class AutoGen {
|
|||
.getLibDestructorName();
|
||||
|
||||
//
|
||||
// Collect SetVirtualAddressMapCallBack and
|
||||
// Collect SetVirtualAddressMapCallBack and
|
||||
// ExitBootServiceCallBack.
|
||||
//
|
||||
//
|
||||
setVirtuals = SurfaceAreaQuery.getSetVirtualAddressMapCallBackArray();
|
||||
exitBoots = SurfaceAreaQuery.getExitBootServicesCallBackArray();
|
||||
if (setVirtuals != null) {
|
||||
|
|
|
@ -2,20 +2,20 @@
|
|||
GenBuildException class.
|
||||
|
||||
The class handle the exception throwed by entity class.
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
**/
|
||||
package org.tianocore.build.exception;
|
||||
|
||||
import org.tianocore.exception.EdkException;
|
||||
import org.tianocore.common.exception.EdkException;
|
||||
|
||||
/**
|
||||
The class handle the exception throwed by entity class.
|
||||
|
@ -24,13 +24,13 @@ public class GenBuildException extends EdkException {
|
|||
static final long serialVersionUID = -8034897190740066937L;
|
||||
/**
|
||||
Constructure function
|
||||
|
||||
|
||||
@param expStr exception message string.
|
||||
**/
|
||||
public GenBuildException(String expStr) {
|
||||
super("[GenBuildException]:" + expStr);
|
||||
}
|
||||
|
||||
|
||||
public GenBuildException() {
|
||||
super();
|
||||
}
|
||||
|
|
|
@ -2,20 +2,20 @@
|
|||
TianoToolsException class.
|
||||
|
||||
The class handle the exception throwed by entity class.
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
**/
|
||||
package org.tianocore.build.exception;
|
||||
|
||||
import org.tianocore.exception.EdkException;
|
||||
import org.tianocore.common.exception.EdkException;
|
||||
|
||||
/**
|
||||
The class handle the exception throwed by entity class.
|
||||
|
@ -24,17 +24,17 @@ public class TianoToolsException extends EdkException {
|
|||
static final long serialVersionUID = -8034897190740066935L;
|
||||
/**
|
||||
Constructure function
|
||||
|
||||
|
||||
@param expStr exception message string.
|
||||
**/
|
||||
public TianoToolsException(String expStr) {
|
||||
super("[TianoToolsException]:" + expStr);
|
||||
}
|
||||
|
||||
|
||||
public TianoToolsException() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public TianoToolsException (Exception e, String message){
|
||||
super(e, message);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/** @file
|
||||
This file is ANT task FpdParserTask.
|
||||
|
||||
This file is ANT task FpdParserTask.
|
||||
|
||||
FpdParserTask is used to parse FPD (Framework Platform Description) and generate
|
||||
build.out.xml. It is for Package or Platform build use.
|
||||
|
||||
build.out.xml. It is for Package or Platform build use.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
|
@ -32,61 +32,61 @@ import org.apache.tools.ant.taskdefs.Ant;
|
|||
import org.apache.tools.ant.taskdefs.Property;
|
||||
import org.apache.xmlbeans.XmlObject;
|
||||
|
||||
import org.tianocore.common.exception.EdkException;
|
||||
import org.tianocore.pcd.action.ActionMessage;
|
||||
import org.tianocore.build.global.GlobalData;
|
||||
import org.tianocore.build.global.OutputManager;
|
||||
import org.tianocore.build.global.SurfaceAreaQuery;
|
||||
import org.tianocore.build.id.FpdModuleIdentification;
|
||||
import org.tianocore.build.id.ModuleIdentification;
|
||||
import org.tianocore.build.id.PlatformIdentification;
|
||||
import org.tianocore.pcd.action.ActionMessage;
|
||||
import org.tianocore.build.pcd.action.PlatformPcdPreprocessActionForBuilding;
|
||||
import org.tianocore.build.toolchain.ToolChainAttribute;
|
||||
import org.tianocore.build.toolchain.ToolChainElement;
|
||||
import org.tianocore.build.toolchain.ToolChainMap;
|
||||
import org.tianocore.exception.EdkException;
|
||||
|
||||
/**
|
||||
<code>FpdParserTask</code> is an ANT task. The main function is parsing Framework
|
||||
Platform Descritpion (FPD) XML file and generating its ANT build script for
|
||||
corresponding platform.
|
||||
Platform Descritpion (FPD) XML file and generating its ANT build script for
|
||||
corresponding platform.
|
||||
|
||||
<p>The task sets global properties PLATFORM, PLATFORM_DIR, PLATFORM_RELATIVE_DIR
|
||||
and BUILD_DIR. </p>
|
||||
|
||||
|
||||
<p>The task generates ${PLATFORM}_build.xml file which will be called by top level
|
||||
build.xml. The task also generate Fv.inf files (File is for Tool GenFvImage)
|
||||
build.xml. The task also generate Fv.inf files (File is for Tool GenFvImage)
|
||||
and flash definition file (File is for Tool FlashMap) if necessary. </p>
|
||||
|
||||
|
||||
<p>FpdParserTask task stores all FPD information to GlobalData. And parse
|
||||
tools definition file to set up compiler options for different Target and
|
||||
different ToolChainTag. </p>
|
||||
|
||||
|
||||
<p>The method parseFpdFile is also prepared for single module build. </p>
|
||||
|
||||
|
||||
<p>The usage is (take NT32 Platform for example):</p>
|
||||
|
||||
<pre>
|
||||
<FPDParser platformName="Nt32" />
|
||||
</pre>
|
||||
|
||||
<p>The task will initialize all information through parsing Framework Database,
|
||||
<p>The task will initialize all information through parsing Framework Database,
|
||||
SPD, Tool chain configuration files. </p>
|
||||
|
||||
@since GenBuild 1.0
|
||||
**/
|
||||
public class FpdParserTask extends Task {
|
||||
|
||||
|
||||
private String platformName;
|
||||
|
||||
private File fpdFile = null;
|
||||
|
||||
|
||||
private PlatformIdentification platformId;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
///
|
||||
private String type;
|
||||
|
||||
|
||||
///
|
||||
/// Mapping from modules identification to out put file name
|
||||
///
|
||||
|
@ -98,10 +98,10 @@ public class FpdParserTask extends Task {
|
|||
private Map<String, Set<FpdModuleIdentification>> fvs = new HashMap<String, Set<FpdModuleIdentification>>();
|
||||
|
||||
///
|
||||
/// FpdParserTask can specify some ANT properties.
|
||||
/// FpdParserTask can specify some ANT properties.
|
||||
///
|
||||
private Vector<Property> properties = new Vector<Property>();
|
||||
|
||||
|
||||
private boolean isUnified = true;
|
||||
|
||||
|
||||
|
@ -112,19 +112,19 @@ public class FpdParserTask extends Task {
|
|||
}
|
||||
|
||||
/**
|
||||
ANT task's entry method. The main steps is described as following:
|
||||
|
||||
ANT task's entry method. The main steps is described as following:
|
||||
|
||||
<ul>
|
||||
<li>Initialize global information (Framework DB, SPD files and all MSA files
|
||||
<li>Initialize global information (Framework DB, SPD files and all MSA files
|
||||
listed in SPD). This step will execute only once in whole build process;</li>
|
||||
<li>Parse specified FPD file; </li>
|
||||
<li>Generate FV.inf files; </li>
|
||||
<li>Generate PlatformName_build.xml file for Flatform build; </li>
|
||||
<li>Collect PCD information. </li>
|
||||
</ul>
|
||||
|
||||
|
||||
@throws BuildException
|
||||
Surface area is not valid.
|
||||
Surface area is not valid.
|
||||
**/
|
||||
public void execute() throws BuildException {
|
||||
// Remove !!
|
||||
|
@ -135,17 +135,17 @@ public class FpdParserTask extends Task {
|
|||
platformId = GlobalData.getPlatformByName(platformName);
|
||||
fpdFile = platformId.getFpdFile();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Parse FPD file
|
||||
//
|
||||
parseFpdFile();
|
||||
|
||||
|
||||
//
|
||||
// Prepare BUILD_DIR
|
||||
//
|
||||
isUnified = OutputManager.getInstance().prepareBuildDir(getProject());
|
||||
|
||||
|
||||
//
|
||||
// For every Target and ToolChain
|
||||
//
|
||||
|
@ -156,13 +156,13 @@ public class FpdParserTask extends Task {
|
|||
//
|
||||
// Prepare FV_DIR
|
||||
//
|
||||
String ffsCommonDir = getProject().getProperty("BUILD_DIR") + File.separatorChar
|
||||
+ targetList[i] + File.separatorChar
|
||||
String ffsCommonDir = getProject().getProperty("BUILD_DIR") + File.separatorChar
|
||||
+ targetList[i] + File.separatorChar
|
||||
+ toolchainList[j];
|
||||
File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");
|
||||
fvDir.mkdirs();
|
||||
getProject().setProperty("FV_DIR", fvDir.getPath().replaceAll("(\\\\)", "/"));
|
||||
|
||||
|
||||
//
|
||||
// Gen Fv.inf files
|
||||
//
|
||||
|
@ -175,11 +175,11 @@ public class FpdParserTask extends Task {
|
|||
//
|
||||
PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, isUnified);
|
||||
fileGenerator.genBuildFile();
|
||||
|
||||
|
||||
//
|
||||
// Ant call ${PLATFORM}_build.xml
|
||||
//
|
||||
|
||||
|
||||
Ant ant = new Ant();
|
||||
ant.setProject(getProject());
|
||||
ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");
|
||||
|
@ -187,17 +187,17 @@ public class FpdParserTask extends Task {
|
|||
ant.setInheritAll(true);
|
||||
ant.init();
|
||||
ant.execute();
|
||||
|
||||
|
||||
// GlobalData.log.info("Fpd build end. ");
|
||||
}
|
||||
|
||||
/**
|
||||
Generate Fv.inf files. The Fv.inf file is composed with four
|
||||
parts: Options, Attributes, Components and Files. The Fv.inf files
|
||||
Generate Fv.inf files. The Fv.inf file is composed with four
|
||||
parts: Options, Attributes, Components and Files. The Fv.inf files
|
||||
will be under FV_DIR.
|
||||
|
||||
|
||||
@throws BuildException
|
||||
File write FV.inf files error.
|
||||
File write FV.inf files error.
|
||||
**/
|
||||
private void genFvInfFiles(String ffsCommonDir) throws BuildException {
|
||||
String[] validFv = SurfaceAreaQuery.getFpdValidImageNames();
|
||||
|
@ -211,14 +211,14 @@ public class FpdParserTask extends Task {
|
|||
}
|
||||
|
||||
getProject().setProperty("FV_FILENAME", validFv[i]);
|
||||
|
||||
|
||||
File fvFile = new File(getProject().replaceProperties( getProject().getProperty("FV_DIR") + File.separatorChar + validFv[i] + ".inf"));
|
||||
fvFile.getParentFile().mkdirs();
|
||||
|
||||
try {
|
||||
FileWriter fw = new FileWriter(fvFile);
|
||||
BufferedWriter bw = new BufferedWriter(fw);
|
||||
|
||||
|
||||
//
|
||||
// Options
|
||||
//
|
||||
|
@ -239,7 +239,7 @@ public class FpdParserTask extends Task {
|
|||
}
|
||||
bw.newLine();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Attributes;
|
||||
//
|
||||
|
@ -260,7 +260,7 @@ public class FpdParserTask extends Task {
|
|||
}
|
||||
bw.newLine();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Components
|
||||
//
|
||||
|
@ -281,7 +281,7 @@ public class FpdParserTask extends Task {
|
|||
}
|
||||
bw.newLine();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Files
|
||||
//
|
||||
|
@ -306,10 +306,10 @@ public class FpdParserTask extends Task {
|
|||
}
|
||||
/**
|
||||
This method is used for Single Module Build.
|
||||
|
||||
|
||||
|
||||
|
||||
@throws BuildException
|
||||
FPD file is not valid.
|
||||
FPD file is not valid.
|
||||
**/
|
||||
public void parseFpdFile(File fpdFile) throws BuildException {
|
||||
this.fpdFile = fpdFile;
|
||||
|
@ -317,19 +317,19 @@ public class FpdParserTask extends Task {
|
|||
}
|
||||
|
||||
/**
|
||||
Parse FPD file.
|
||||
|
||||
Parse FPD file.
|
||||
|
||||
@throws BuildException
|
||||
FPD file is not valid.
|
||||
FPD file is not valid.
|
||||
**/
|
||||
private void parseFpdFile() throws BuildException {
|
||||
try {
|
||||
XmlObject doc = XmlObject.Factory.parse(fpdFile);
|
||||
|
||||
|
||||
if (!doc.validate()) {
|
||||
throw new BuildException("Platform Surface Area file [" + fpdFile.getPath() + "] format is invalid!");
|
||||
}
|
||||
|
||||
|
||||
Map<String, XmlObject> map = new HashMap<String, XmlObject>();
|
||||
map.put("PlatformSurfaceArea", doc);
|
||||
SurfaceAreaQuery.setDoc(map);
|
||||
|
@ -345,7 +345,7 @@ public class FpdParserTask extends Task {
|
|||
getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));
|
||||
|
||||
//
|
||||
// Build mode. User-defined output dir.
|
||||
// Build mode. User-defined output dir.
|
||||
//
|
||||
String buildMode = SurfaceAreaQuery.getFpdIntermediateDirectories();
|
||||
String userDefinedOutputDir = SurfaceAreaQuery.getFpdOutputDirectory();
|
||||
|
@ -356,9 +356,9 @@ public class FpdParserTask extends Task {
|
|||
// TBD. Deal PCD and BuildOption related Info
|
||||
//
|
||||
GlobalData.setFpdBuildOptions(SurfaceAreaQuery.getFpdBuildOptions());
|
||||
|
||||
|
||||
GlobalData.setToolChainPlatformInfo(SurfaceAreaQuery.getFpdToolChainInfo());
|
||||
|
||||
|
||||
//
|
||||
// Parse all list modules SA
|
||||
//
|
||||
|
@ -371,7 +371,7 @@ public class FpdParserTask extends Task {
|
|||
parseToolChainOptions();
|
||||
|
||||
SurfaceAreaQuery.setDoc(map);
|
||||
|
||||
|
||||
//
|
||||
// Pcd Collection. Call CollectPCDAction to collect pcd info.
|
||||
//
|
||||
|
@ -383,9 +383,9 @@ public class FpdParserTask extends Task {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Parse all modules listed in FPD file.
|
||||
Parse all modules listed in FPD file.
|
||||
**/
|
||||
private void parseModuleSAFiles() throws EdkException{
|
||||
Map<FpdModuleIdentification, Map<String, XmlObject>> moduleSAs = SurfaceAreaQuery.getFpdModules();
|
||||
|
@ -397,11 +397,11 @@ public class FpdParserTask extends Task {
|
|||
Iterator iter = keys.iterator();
|
||||
while (iter.hasNext()) {
|
||||
FpdModuleIdentification fpdModuleId = (FpdModuleIdentification) iter.next();
|
||||
|
||||
|
||||
//
|
||||
// Judge if Module is existed?
|
||||
// Judge if Module is existed?
|
||||
// TBD
|
||||
|
||||
|
||||
GlobalData.registerFpdModuleSA(fpdModuleId, moduleSAs.get(fpdModuleId));
|
||||
|
||||
//
|
||||
|
@ -413,7 +413,7 @@ public class FpdParserTask extends Task {
|
|||
|
||||
fpdModuleId.setFvBinding(fvBinding);
|
||||
updateFvs(fvBinding, fpdModuleId);
|
||||
|
||||
|
||||
//
|
||||
// Prepare for out put file name
|
||||
//
|
||||
|
@ -424,13 +424,13 @@ public class FpdParserTask extends Task {
|
|||
if (baseName == null) {
|
||||
baseName = moduleId.getName();
|
||||
}
|
||||
outfiles.put(fpdModuleId, fpdModuleId.getArch() + File.separatorChar
|
||||
+ moduleId.getGuid() + "-" + baseName
|
||||
outfiles.put(fpdModuleId, fpdModuleId.getArch() + File.separatorChar
|
||||
+ moduleId.getGuid() + "-" + baseName
|
||||
+ getSuffix(moduleId.getModuleType()));
|
||||
|
||||
//
|
||||
// parse module build options, if any
|
||||
//
|
||||
//
|
||||
SurfaceAreaQuery.push(GlobalData.getDoc(fpdModuleId));
|
||||
GlobalData.addModuleToolChainOption(fpdModuleId, parseModuleBuildOptions(false));
|
||||
GlobalData.addModuleToolChainFamilyOption(fpdModuleId, parseModuleBuildOptions(true));
|
||||
|
@ -445,7 +445,7 @@ public class FpdParserTask extends Task {
|
|||
}
|
||||
return parseOptions(options);
|
||||
}
|
||||
|
||||
|
||||
private ToolChainMap parsePlatformBuildOptions(boolean toolChainFamilyFlag) throws EdkException {
|
||||
String[][] options = SurfaceAreaQuery.getPlatformBuildOptions(toolChainFamilyFlag);
|
||||
if (options == null || options.length == 0) {
|
||||
|
@ -469,7 +469,7 @@ public class FpdParserTask extends Task {
|
|||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
private void parseToolChainFamilyOptions() throws EdkException {
|
||||
GlobalData.setPlatformToolChainFamilyOption(parsePlatformBuildOptions(true));
|
||||
}
|
||||
|
@ -479,8 +479,8 @@ public class FpdParserTask extends Task {
|
|||
}
|
||||
|
||||
/**
|
||||
Add the current module to corresponding FV.
|
||||
|
||||
Add the current module to corresponding FV.
|
||||
|
||||
@param fvName current FV name
|
||||
@param moduleName current module identification
|
||||
**/
|
||||
|
@ -506,8 +506,8 @@ public class FpdParserTask extends Task {
|
|||
}
|
||||
|
||||
/**
|
||||
Get the suffix based on module type. Current relationship are listed:
|
||||
|
||||
Get the suffix based on module type. Current relationship are listed:
|
||||
|
||||
<pre>
|
||||
<b>ModuleType</b> <b>Suffix</b>
|
||||
BASE .FFS
|
||||
|
@ -524,7 +524,7 @@ public class FpdParserTask extends Task {
|
|||
UEFI_APPLICATION .APP
|
||||
USER_DEFINED .FFS
|
||||
</pre>
|
||||
|
||||
|
||||
@param moduleType module type
|
||||
@return
|
||||
@throws BuildException
|
||||
|
@ -536,13 +536,13 @@ public class FpdParserTask extends Task {
|
|||
}
|
||||
|
||||
String[][] suffix = { { "BASE", ".FFS"},
|
||||
{ "SEC", ".SEC" }, { "PEI_CORE", ".PEI" },
|
||||
{ "SEC", ".SEC" }, { "PEI_CORE", ".PEI" },
|
||||
{ "PEIM", ".PEI" }, { "DXE_CORE", ".DXE" },
|
||||
{ "DXE_DRIVER", ".DXE" }, { "DXE_RUNTIME_DRIVER", ".DXE" },
|
||||
{ "DXE_SAL_DRIVER", ".DXE" }, { "DXE_SMM_DRIVER", ".DXE" },
|
||||
{ "DXE_DRIVER", ".DXE" }, { "DXE_RUNTIME_DRIVER", ".DXE" },
|
||||
{ "DXE_SAL_DRIVER", ".DXE" }, { "DXE_SMM_DRIVER", ".DXE" },
|
||||
{ "TOOL", ".FFS" }, { "UEFI_DRIVER", ".DXE" },
|
||||
{ "UEFI_APPLICATION", ".APP" }, { "USER_DEFINED", ".FFS" } };
|
||||
|
||||
|
||||
for (int i = 0; i < suffix.length; i++) {
|
||||
if (suffix[i][0].equalsIgnoreCase(moduleType)) {
|
||||
return suffix[i][1];
|
||||
|
@ -554,8 +554,8 @@ public class FpdParserTask extends Task {
|
|||
return ".FFS";
|
||||
}
|
||||
/**
|
||||
Add a property.
|
||||
|
||||
Add a property.
|
||||
|
||||
@param p property
|
||||
**/
|
||||
public void addProperty(Property p) {
|
||||
|
@ -573,6 +573,6 @@ public class FpdParserTask extends Task {
|
|||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -17,20 +17,22 @@ Abstract:
|
|||
--*/
|
||||
|
||||
package org.tianocore.build.global;
|
||||
|
||||
import org.apache.tools.ant.Project;
|
||||
import org.tianocore.logger.LogMethod;
|
||||
|
||||
import org.tianocore.common.logger.LogMethod;
|
||||
|
||||
public class GenBuildLogger implements LogMethod {
|
||||
private Project project;
|
||||
public GenBuildLogger(Project project) {
|
||||
this.project = project;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void putMessage(Object msgSource, int msgLevel, String msg) {
|
||||
if (this.project != null){
|
||||
this.project.log(msg, Project.MSG_INFO);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
/** @file
|
||||
GlobalData class.
|
||||
|
||||
GlobalData class.
|
||||
|
||||
GlobalData provide initializing, instoring, querying and update global data.
|
||||
It is a bridge to intercommunicate between multiple component, such as AutoGen,
|
||||
PCD and so on.
|
||||
|
||||
PCD and so on.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
|
@ -27,6 +27,10 @@ import java.util.logging.Logger;
|
|||
|
||||
import org.apache.tools.ant.BuildException;
|
||||
import org.apache.xmlbeans.XmlObject;
|
||||
|
||||
import org.tianocore.common.exception.EdkException;
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
import org.tianocore.pcd.entity.MemoryDatabaseManager;
|
||||
import org.tianocore.DbPathAndFilename;
|
||||
import org.tianocore.FrameworkDatabaseDocument;
|
||||
import org.tianocore.ModuleSurfaceAreaDocument;
|
||||
|
@ -35,44 +39,41 @@ import org.tianocore.build.id.FpdModuleIdentification;
|
|||
import org.tianocore.build.id.ModuleIdentification;
|
||||
import org.tianocore.build.id.PackageIdentification;
|
||||
import org.tianocore.build.id.PlatformIdentification;
|
||||
import org.tianocore.pcd.entity.MemoryDatabaseManager;
|
||||
import org.tianocore.build.toolchain.ToolChainAttribute;
|
||||
import org.tianocore.build.toolchain.ToolChainConfig;
|
||||
import org.tianocore.build.toolchain.ToolChainElement;
|
||||
import org.tianocore.build.toolchain.ToolChainInfo;
|
||||
import org.tianocore.build.toolchain.ToolChainKey;
|
||||
import org.tianocore.build.toolchain.ToolChainMap;
|
||||
import org.tianocore.exception.EdkException;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
|
||||
/**
|
||||
GlobalData provide initializing, instoring, querying and update global data.
|
||||
It is a bridge to intercommunicate between multiple component, such as AutoGen,
|
||||
PCD and so on.
|
||||
|
||||
<p>Note that all global information are initialized incrementally. All data will
|
||||
PCD and so on.
|
||||
|
||||
<p>Note that all global information are initialized incrementally. All data will
|
||||
parse and record only of necessary during build time. </p>
|
||||
|
||||
|
||||
@since GenBuild 1.0
|
||||
**/
|
||||
public class GlobalData {
|
||||
|
||||
public static Logger log = Logger.getAnonymousLogger();
|
||||
|
||||
|
||||
///
|
||||
/// Record current WORKSPACE Directory
|
||||
///
|
||||
private static String workspaceDir = "";
|
||||
|
||||
|
||||
///
|
||||
/// Be used to ensure Global data will be initialized only once.
|
||||
///
|
||||
private static boolean globalFlag = false;
|
||||
|
||||
|
||||
///
|
||||
/// Framework Database information: package list and platform list
|
||||
///
|
||||
private static Set<PackageIdentification> packageList = new HashSet<PackageIdentification>();
|
||||
private static Set<PackageIdentification> packageList = new HashSet<PackageIdentification>();
|
||||
|
||||
private static Set<PlatformIdentification> platformList = new HashSet<PlatformIdentification>();
|
||||
|
||||
|
@ -93,17 +94,17 @@ public class GlobalData {
|
|||
private static XmlObject fpdBuildOptions;
|
||||
|
||||
private static XmlObject fpdDynamicPcds;
|
||||
|
||||
|
||||
///
|
||||
/// Parsed modules list
|
||||
///
|
||||
private static Map<FpdModuleIdentification, Map<String, XmlObject>> parsedModules = new HashMap<FpdModuleIdentification, Map<String, XmlObject>>();
|
||||
|
||||
|
||||
///
|
||||
/// built modules list with ARCH, TARGET, TOOLCHAIN
|
||||
///
|
||||
private static Set<FpdModuleIdentification> builtModules = new HashSet<FpdModuleIdentification>();
|
||||
|
||||
|
||||
///
|
||||
/// PCD memory database stored all PCD information which collected from FPD,MSA and SPD.
|
||||
///
|
||||
|
@ -117,7 +118,7 @@ public class GlobalData {
|
|||
/// toolsDef - build tool program information
|
||||
/// fpdBuildOption - all modules's build options for tool tag or tool chain families
|
||||
/// moduleSaBuildOption - build options for a specific module
|
||||
///
|
||||
///
|
||||
private static ToolChainConfig toolsDef;
|
||||
|
||||
private static ToolChainInfo toolChainInfo;
|
||||
|
@ -133,8 +134,8 @@ public class GlobalData {
|
|||
/**
|
||||
Parse framework database (DB) and all SPD files listed in DB to initialize
|
||||
the environment for next build. This method will only be executed only once
|
||||
in the whole build process.
|
||||
|
||||
in the whole build process.
|
||||
|
||||
@param workspaceDatabaseFile the file name of framework database
|
||||
@param workspaceDir current workspace directory path
|
||||
@throws BuildException
|
||||
|
@ -149,11 +150,11 @@ public class GlobalData {
|
|||
}
|
||||
globalFlag = true;
|
||||
|
||||
//
|
||||
//
|
||||
// Backup workspace directory. It will be used by other method
|
||||
//
|
||||
GlobalData.workspaceDir = workspaceDir.replaceAll("(\\\\)", "/");
|
||||
|
||||
|
||||
//
|
||||
// Parse tools definition file
|
||||
//
|
||||
|
@ -164,7 +165,7 @@ public class GlobalData {
|
|||
File toolsDefFile = new File(workspaceDir + File.separatorChar + toolsDefFilename);
|
||||
System.out.println("Using tool definiton file [" + toolsDefFile.getPath() + "].");
|
||||
toolsDef = new ToolChainConfig(toolsDefFile);
|
||||
|
||||
|
||||
//
|
||||
// Parse Framework Database
|
||||
//
|
||||
|
@ -228,10 +229,10 @@ public class GlobalData {
|
|||
throw new BuildException("Parse WORKSPACE Database file [" + dbFile.getPath() + "] Error.\n" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Get the current WORKSPACE Directory.
|
||||
|
||||
Get the current WORKSPACE Directory.
|
||||
|
||||
@return current workspace directory
|
||||
**/
|
||||
public synchronized static String getWorkspacePath() {
|
||||
|
@ -245,7 +246,7 @@ public class GlobalData {
|
|||
public synchronized static File getMsaFile(ModuleIdentification moduleId) throws BuildException {
|
||||
File msaFile = null;
|
||||
//
|
||||
// TBD. Do only when package is null.
|
||||
// TBD. Do only when package is null.
|
||||
//
|
||||
Iterator iter = packageList.iterator();
|
||||
while (iter.hasNext()) {
|
||||
|
@ -271,7 +272,7 @@ public class GlobalData {
|
|||
if (moduleId.getPackage() != null) {
|
||||
return moduleId.getPackage();
|
||||
}
|
||||
|
||||
|
||||
PackageIdentification packageId = null;
|
||||
Iterator iter = packageList.iterator();
|
||||
while (iter.hasNext()) {
|
||||
|
@ -289,19 +290,19 @@ public class GlobalData {
|
|||
return packageId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Difference between build and parse: ToolChain and Target
|
||||
**/
|
||||
public synchronized static boolean isModuleBuilt(FpdModuleIdentification moduleId) {
|
||||
return builtModules.contains(moduleId);
|
||||
}
|
||||
|
||||
|
||||
public synchronized static void registerBuiltModule(FpdModuleIdentification fpdModuleId) {
|
||||
builtModules.add(fpdModuleId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public synchronized static void registerFpdModuleSA(FpdModuleIdentification fpdModuleId, Map<String, XmlObject> doc) {
|
||||
Map<String, XmlObject> result = new HashMap<String, XmlObject>();
|
||||
Set keySet = doc.keySet();
|
||||
|
@ -320,11 +321,11 @@ public class GlobalData {
|
|||
|
||||
/**
|
||||
Query overrided module surface area information. If current is Package
|
||||
or Platform build, also include the information from FPD file.
|
||||
|
||||
<p>Note that surface area parsing is incremental. That means the method will
|
||||
or Platform build, also include the information from FPD file.
|
||||
|
||||
<p>Note that surface area parsing is incremental. That means the method will
|
||||
only parse the MSA and MBD files if necessary. </p>
|
||||
|
||||
|
||||
@param moduleName the base name of the module
|
||||
@return the overrided module surface area information
|
||||
@throws BuildException
|
||||
|
@ -340,12 +341,12 @@ public class GlobalData {
|
|||
// First part: get the MSA files info
|
||||
//
|
||||
doc.putAll(getNativeMsa(moduleId));
|
||||
|
||||
|
||||
//
|
||||
// Second part: put build options
|
||||
//
|
||||
doc.put("BuildOptions", fpdBuildOptions);
|
||||
|
||||
|
||||
//
|
||||
// Third part: get Module info from FPD, such as Library instances, PCDs
|
||||
//
|
||||
|
@ -365,11 +366,11 @@ public class GlobalData {
|
|||
return getDoc(fpdModuleId);
|
||||
}
|
||||
/**
|
||||
Query the native MSA information with module base name.
|
||||
|
||||
<p>Note that MSA parsing is incremental. That means the method will
|
||||
Query the native MSA information with module base name.
|
||||
|
||||
<p>Note that MSA parsing is incremental. That means the method will
|
||||
only to parse the MSA files when never parsed before. </p>
|
||||
|
||||
|
||||
@param moduleName the base name of the module
|
||||
@return the native MSA information
|
||||
@throws BuildException
|
||||
|
@ -384,7 +385,7 @@ public class GlobalData {
|
|||
nativeMsa.put(moduleId, msaMap);
|
||||
return msaMap;
|
||||
}
|
||||
|
||||
|
||||
public synchronized static Map<String, XmlObject> getNativeMsa(File msaFile) throws BuildException {
|
||||
if (! msaFile.exists()) {
|
||||
throw new BuildException("Module Surface Area file [" + msaFile.getPath() + "] can't be found!");
|
||||
|
@ -418,13 +419,13 @@ public class GlobalData {
|
|||
throw new BuildException(ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static Map<String, XmlObject> getFpdBuildOptions() {
|
||||
Map<String, XmlObject> map = new HashMap<String, XmlObject>();
|
||||
map.put("BuildOptions", fpdBuildOptions);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
public static void setFpdBuildOptions(XmlObject fpdBuildOptions) {
|
||||
GlobalData.fpdBuildOptions = cloneXmlObject(fpdBuildOptions, true);
|
||||
}
|
||||
|
@ -439,7 +440,7 @@ public class GlobalData {
|
|||
|
||||
//////////////////////////////////////////////
|
||||
//////////////////////////////////////////////
|
||||
|
||||
|
||||
public static Set<ModuleIdentification> getModules(PackageIdentification packageId){
|
||||
Spd spd = spdTable.get(packageId);
|
||||
if (spd == null ) {
|
||||
|
@ -572,7 +573,7 @@ public class GlobalData {
|
|||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public synchronized static PlatformIdentification getPlatformByName(String name) throws BuildException {
|
||||
Iterator iter = platformList.iterator();
|
||||
while(iter.hasNext()){
|
||||
|
@ -583,7 +584,7 @@ public class GlobalData {
|
|||
}
|
||||
throw new BuildException("Can't find platform [" + name + "] in the current WORKSPACE database!");
|
||||
}
|
||||
|
||||
|
||||
public synchronized static PlatformIdentification getPlatform(String filename) throws BuildException {
|
||||
File file = new File(workspaceDir + File.separatorChar + filename);
|
||||
Iterator iter = platformList.iterator();
|
||||
|
@ -595,7 +596,7 @@ public class GlobalData {
|
|||
}
|
||||
throw new BuildException("Can't find platform file [" + filename + "] in the current WORKSPACE database!");
|
||||
}
|
||||
|
||||
|
||||
public synchronized static PackageIdentification refreshPackageIdentification(PackageIdentification packageId) throws BuildException {
|
||||
Iterator iter = packageList.iterator();
|
||||
while(iter.hasNext()){
|
||||
|
@ -608,7 +609,7 @@ public class GlobalData {
|
|||
}
|
||||
throw new BuildException("Can't find package GUID value " + packageId.getGuid() + " in the current workspace!");
|
||||
}
|
||||
|
||||
|
||||
public synchronized static ModuleIdentification refreshModuleIdentification(ModuleIdentification moduleId) throws BuildException {
|
||||
// System.out.println("1");
|
||||
// System.out.println("##" + moduleId.getGuid());
|
||||
|
@ -632,7 +633,7 @@ public class GlobalData {
|
|||
}
|
||||
throw new BuildException("Can't find module GUID value " + moduleId.getGuid() + " in package, " + packageId + ", in the current workspace!");
|
||||
}
|
||||
|
||||
|
||||
public synchronized static Set<PackageIdentification> getPackageList(){
|
||||
return packageList;
|
||||
}
|
||||
|
@ -702,7 +703,7 @@ public class GlobalData {
|
|||
|
||||
public static String getCommandSetting(String[] commandDescription, FpdModuleIdentification fpdModuleId) throws EdkException {
|
||||
ToolChainKey toolChainKey = new ToolChainKey(commandDescription);
|
||||
ToolChainMap toolChainConfig = toolsDef.getConfig();
|
||||
ToolChainMap toolChainConfig = toolsDef.getConfig();
|
||||
String setting = null;
|
||||
|
||||
if (!commandDescription[ToolChainElement.ATTRIBUTE.value].equals(ToolChainAttribute.FLAGS.toString())) {
|
||||
|
@ -731,7 +732,7 @@ public class GlobalData {
|
|||
toolChainFamilyKey.setKey(ToolChainAttribute.FLAGS.toString(), ToolChainElement.ATTRIBUTE.value);
|
||||
|
||||
option = moduleToolChainFamilyOption.get(fpdModuleId);
|
||||
if (option != null) {
|
||||
if (option != null) {
|
||||
setting = option.get(toolChainFamilyKey);
|
||||
}
|
||||
}
|
||||
|
@ -761,7 +762,7 @@ public class GlobalData {
|
|||
|
||||
return setting;
|
||||
}
|
||||
|
||||
|
||||
public static void setToolChainEnvInfo(ToolChainInfo envInfo) {
|
||||
toolChainEnvInfo = envInfo;
|
||||
}
|
||||
|
@ -803,17 +804,17 @@ public class GlobalData {
|
|||
//
|
||||
// For PCD
|
||||
//
|
||||
public synchronized static Map<FpdModuleIdentification, XmlObject>
|
||||
public synchronized static Map<FpdModuleIdentification, XmlObject>
|
||||
getFpdModuleSaXmlObject(String xmlObjectName) {
|
||||
Set<FpdModuleIdentification> fpdModuleSASet = fpdModuleSA.keySet();
|
||||
Iterator item = fpdModuleSASet.iterator();
|
||||
|
||||
|
||||
|
||||
Map<FpdModuleIdentification, XmlObject> SAPcdBuildDef = new HashMap<FpdModuleIdentification, XmlObject>();
|
||||
Map<String, XmlObject> SANode = new HashMap<String, XmlObject>();
|
||||
FpdModuleIdentification moduleId;
|
||||
while (item.hasNext()) {
|
||||
|
||||
|
||||
moduleId = (FpdModuleIdentification) item.next();
|
||||
SANode = fpdModuleSA.get(moduleId);
|
||||
try{
|
||||
|
|
|
@ -23,8 +23,11 @@ import java.util.Stack;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import org.apache.xmlbeans.XmlObject;
|
||||
import org.apache.xmlbeans.XmlString;
|
||||
|
||||
import org.tianocore.BuildOptionsDocument;
|
||||
import org.tianocore.CNameType;
|
||||
import org.tianocore.ExternsDocument;
|
||||
|
@ -57,20 +60,20 @@ import org.tianocore.FilenameDocument.Filename;
|
|||
import org.tianocore.MsaHeaderDocument.MsaHeader;
|
||||
import org.tianocore.ProtocolsDocument.Protocols.Protocol;
|
||||
import org.tianocore.ProtocolsDocument.Protocols.ProtocolNotify;
|
||||
|
||||
import org.tianocore.common.logger.EdkLog;
|
||||
import org.tianocore.build.id.FpdModuleIdentification;
|
||||
import org.tianocore.build.id.ModuleIdentification;
|
||||
import org.tianocore.build.id.PackageIdentification;
|
||||
import org.tianocore.build.id.PlatformIdentification;
|
||||
import org.tianocore.build.toolchain.ToolChainInfo;
|
||||
import org.tianocore.logger.EdkLog;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
/**
|
||||
* SurfaceAreaQuery class is used to query Surface Area information from msa,
|
||||
* mbd, spd and fpd files.
|
||||
*
|
||||
*
|
||||
* This class should not instantiated. All the public interfaces is static.
|
||||
*
|
||||
*
|
||||
* @since GenBuild 1.0
|
||||
*/
|
||||
public class SurfaceAreaQuery {
|
||||
|
@ -105,7 +108,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Set a Surface Area document for query later
|
||||
*
|
||||
*
|
||||
* @param map
|
||||
* A Surface Area document in TopLevelElementName/XmlObject
|
||||
* format.
|
||||
|
@ -120,7 +123,7 @@ public class SurfaceAreaQuery {
|
|||
* Push current used Surface Area document into query stack. The given new
|
||||
* document will be used for any immediately followed getXXX() callings,
|
||||
* untill pop() is called.
|
||||
*
|
||||
*
|
||||
* @param newMap
|
||||
* The TopLevelElementName/XmlObject format of a Surface Area
|
||||
* document.
|
||||
|
@ -180,7 +183,7 @@ public class SurfaceAreaQuery {
|
|||
/**
|
||||
* Search all XML documents stored in "map" for the specified xPath, using
|
||||
* relative path (starting with '$this')
|
||||
*
|
||||
*
|
||||
* @param xPath
|
||||
* xpath query string array
|
||||
* @returns An array of XmlObject if elements are found at the specified
|
||||
|
@ -219,7 +222,7 @@ public class SurfaceAreaQuery {
|
|||
/**
|
||||
* Search XML documents named by "rootName" for the given xPath, using
|
||||
* relative path (starting with '$this')
|
||||
*
|
||||
*
|
||||
* @param rootName
|
||||
* The top level element name
|
||||
* @param xPath
|
||||
|
@ -255,7 +258,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve SourceFiles/Filename for specified ARCH type
|
||||
*
|
||||
*
|
||||
* @param arch
|
||||
* architecture name
|
||||
* @returns An 2 dimension string array if elements are found at the known
|
||||
|
@ -282,7 +285,7 @@ public class SurfaceAreaQuery {
|
|||
outputList.add(new String[] {sourceFileNames[i].getToolCode(),sourceFileNames[i].getStringValue()});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String[][] outputString = new String[outputList.size()][2];
|
||||
for (int index = 0; index < outputList.size(); index++) {
|
||||
outputString[index][0] = outputList.get(index)[0];
|
||||
|
@ -293,7 +296,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve /PlatformDefinitions/OutputDirectory from FPD
|
||||
*
|
||||
*
|
||||
* @returns Directory names array if elements are found at the known xpath
|
||||
* @returns Empty if nothing is found at the known xpath
|
||||
*/
|
||||
|
@ -317,7 +320,7 @@ public class SurfaceAreaQuery {
|
|||
}
|
||||
PlatformDefinitionsDocument.PlatformDefinitions item = (PlatformDefinitionsDocument.PlatformDefinitions)returns[0];
|
||||
if(item.getIntermediateDirectories() == null) {
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
return item.getIntermediateDirectories().toString();
|
||||
|
@ -334,7 +337,7 @@ public class SurfaceAreaQuery {
|
|||
ModuleSaBuildOptionsDocument.ModuleSaBuildOptions item = (ModuleSaBuildOptionsDocument.ModuleSaBuildOptions)returns[0];
|
||||
return item.getFfsFormatKey();
|
||||
}
|
||||
|
||||
|
||||
public static String getModuleFvBindingKeyword() {
|
||||
String[] xPath = new String[] { "/" };
|
||||
|
||||
|
@ -345,7 +348,7 @@ public class SurfaceAreaQuery {
|
|||
ModuleSaBuildOptionsDocument.ModuleSaBuildOptions item = (ModuleSaBuildOptionsDocument.ModuleSaBuildOptions)returns[0];
|
||||
return item.getFvBinding();
|
||||
}
|
||||
|
||||
|
||||
public static List getModuleSupportedArchs() {
|
||||
String[] xPath = new String[] { "/" };
|
||||
|
||||
|
@ -356,17 +359,17 @@ public class SurfaceAreaQuery {
|
|||
ModuleDefinitionsDocument.ModuleDefinitions item = (ModuleDefinitionsDocument.ModuleDefinitions)returns[0];
|
||||
return item.getSupportedArchitectures();
|
||||
}
|
||||
|
||||
|
||||
public static BuildOptionsDocument.BuildOptions.Ffs[] getFpdFfs() {
|
||||
String[] xPath = new String[] {"/Ffs"};
|
||||
|
||||
|
||||
Object[] returns = get("BuildOptions", xPath);
|
||||
if (returns == null || returns.length == 0) {
|
||||
return new BuildOptionsDocument.BuildOptions.Ffs[0];
|
||||
}
|
||||
return (BuildOptionsDocument.BuildOptions.Ffs[])returns;
|
||||
}
|
||||
|
||||
|
||||
public static String getModuleOutputFileBasename() {
|
||||
String[] xPath = new String[] { "/" };
|
||||
|
||||
|
@ -377,18 +380,18 @@ public class SurfaceAreaQuery {
|
|||
ModuleDefinitionsDocument.ModuleDefinitions item = (ModuleDefinitionsDocument.ModuleDefinitions)returns[0];
|
||||
return item.getOutputFileBasename();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve BuildOptions/Option or Arch/Option
|
||||
*
|
||||
*
|
||||
* @param toolChainFamilyFlag
|
||||
* if true, retrieve options for toolchain family; otherwise for
|
||||
* toolchain
|
||||
*
|
||||
*
|
||||
* @returns String[][5] name, target, toolchain, arch, coommand of options
|
||||
* if elements are found at the known xpath. String[0][] if dont
|
||||
* find element.
|
||||
*
|
||||
*
|
||||
* @returns Empty array if nothing is there
|
||||
*/
|
||||
public static String[][] getOptions(String from, String[] xPath, boolean toolChainFamilyFlag) {
|
||||
|
@ -441,7 +444,7 @@ public class SurfaceAreaQuery {
|
|||
}
|
||||
|
||||
archList = new ArrayList<String>();
|
||||
List archEnumList = option.getSupArchList();
|
||||
List archEnumList = option.getSupArchList();
|
||||
if (archEnumList == null) {
|
||||
archList.add(null);
|
||||
} else {
|
||||
|
@ -477,7 +480,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
public static String[][] getModuleBuildOptions(boolean toolChainFamilyFlag) {
|
||||
String[] xPath;
|
||||
|
||||
|
||||
if (toolChainFamilyFlag == true) {
|
||||
xPath = new String[] {
|
||||
"/Options/Option[not(@ToolChainFamily) and not(@TagName)]",
|
||||
|
@ -488,8 +491,8 @@ public class SurfaceAreaQuery {
|
|||
"/Options/Option[@TagName]", };
|
||||
}
|
||||
return getOptions("ModuleSaBuildOptions", xPath, toolChainFamilyFlag);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static String[][] getPlatformBuildOptions(boolean toolChainFamilyFlag) {
|
||||
String[] xPath;
|
||||
|
||||
|
@ -513,7 +516,7 @@ public class SurfaceAreaQuery {
|
|||
if (returns == null || returns.length == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
PlatformDefinitionsDocument.PlatformDefinitions item = (PlatformDefinitionsDocument.PlatformDefinitions)returns[0];
|
||||
ToolChainInfo toolChainInfo = new ToolChainInfo();
|
||||
toolChainInfo.addTargets(item.getBuildTargets().toString());
|
||||
|
@ -524,7 +527,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve <xxxHeader>/ModuleType
|
||||
*
|
||||
*
|
||||
* @returns The module type name if elements are found at the known xpath
|
||||
* @returns null if nothing is there
|
||||
*/
|
||||
|
@ -542,10 +545,10 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve PackageDependencies/Package
|
||||
*
|
||||
*
|
||||
* @param arch
|
||||
* Architecture name
|
||||
*
|
||||
*
|
||||
* @returns package name list if elements are found at the known xpath
|
||||
* @returns null if nothing is there
|
||||
*/
|
||||
|
@ -554,17 +557,17 @@ public class SurfaceAreaQuery {
|
|||
String packageGuid = null;
|
||||
String packageVersion = null;
|
||||
|
||||
|
||||
|
||||
xPath = new String[] { "/Package" };
|
||||
|
||||
|
||||
Object[] returns = get("PackageDependencies", xPath);
|
||||
if (returns == null) {
|
||||
return new PackageIdentification[0];
|
||||
}
|
||||
|
||||
//
|
||||
// Get packageIdentification
|
||||
//
|
||||
// Get packageIdentification
|
||||
//
|
||||
List<PackageIdentification> packageIdList = new ArrayList<PackageIdentification>();
|
||||
for (int i = 0; i < returns.length; i++) {
|
||||
PackageDependenciesDocument.PackageDependencies.Package item = (PackageDependenciesDocument.PackageDependencies.Package) returns[i];
|
||||
|
@ -579,7 +582,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
//
|
||||
// transfer packageIdentification list to array.
|
||||
//
|
||||
//
|
||||
PackageIdentification[] packageIdArray = new PackageIdentification[packageIdList.size()];
|
||||
for (int i = 0; i < packageIdList.size(); i++) {
|
||||
packageIdArray[i] = new PackageIdentification(null, packageIdList.get(i).getGuid(),packageIdList.get(i).getVersion());
|
||||
|
@ -589,10 +592,10 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve LibraryClassDefinitions/LibraryClass for specified usage
|
||||
*
|
||||
*
|
||||
* @param usage
|
||||
* Library class usage
|
||||
*
|
||||
*
|
||||
* @returns LibraryClass objects list if elements are found at the known
|
||||
* xpath
|
||||
* @returns null if nothing is there
|
||||
|
@ -614,7 +617,7 @@ public class SurfaceAreaQuery {
|
|||
List<String> libraryClassName = new ArrayList<String>();
|
||||
for (int i = 0; i < libraryClassList.length; i++) {
|
||||
List archList = libraryClassList[i].getSupArchList();
|
||||
|
||||
|
||||
if (arch == null || contains(archList, arch)) {
|
||||
libraryClassName.add(libraryClassList[i].getKeyword());
|
||||
}
|
||||
|
@ -628,7 +631,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve ModuleEntryPoint names
|
||||
*
|
||||
*
|
||||
* @returns ModuleEntryPoint name list if elements are found at the known
|
||||
* xpath
|
||||
* @returns null if nothing is there
|
||||
|
@ -653,10 +656,10 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* retrieve Protocol for specified usage
|
||||
*
|
||||
*
|
||||
* @param usage
|
||||
* Protocol usage arch Architecture
|
||||
*
|
||||
*
|
||||
* @returns Protocol String list if elements are found at the known xpath
|
||||
* @returns String[0] if nothing is there
|
||||
*/
|
||||
|
@ -693,10 +696,10 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* retrieve Protocol for specified usage
|
||||
*
|
||||
*
|
||||
* @param arch
|
||||
* Architecture
|
||||
*
|
||||
*
|
||||
* @returns Protocol String list if elements are found at the known xpath
|
||||
* @returns String[0] if nothing is there
|
||||
*/
|
||||
|
@ -716,7 +719,7 @@ public class SurfaceAreaQuery {
|
|||
Protocol[] returnlList = (Protocol[]) returns;
|
||||
|
||||
List<String> protocolList = new ArrayList<String>();
|
||||
|
||||
|
||||
for (int i = 0; i < returns.length; i++) {
|
||||
List archList = returnlList[i].getSupArchList();
|
||||
if (archList == null || contains(archList, arch)){
|
||||
|
@ -732,10 +735,10 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve ProtocolNotify for specified usage
|
||||
*
|
||||
*
|
||||
* @param usage
|
||||
* ProtocolNotify usage
|
||||
*
|
||||
*
|
||||
* @returns String[] if elements are found at the known xpath
|
||||
* @returns String[0] if nothing is there
|
||||
*/
|
||||
|
@ -754,13 +757,13 @@ public class SurfaceAreaQuery {
|
|||
}
|
||||
|
||||
List<String> protocolNotifyList = new ArrayList<String>();
|
||||
|
||||
|
||||
for (int i = 0; i < returns.length; i++) {
|
||||
List archList = ((ProtocolNotify) returns[i]).getSupArchList();
|
||||
if (archList == null || contains(archList, arch)){
|
||||
protocolNotifyList.add(((ProtocolNotify) returns[i]).getProtocolNotifyCName());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
String[] protocolNotifyArray = new String[protocolNotifyList.size()];
|
||||
for (int i = 0; i < protocolNotifyList.size(); i++) {
|
||||
|
@ -771,10 +774,10 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve ProtocolNotify for specified usage
|
||||
*
|
||||
*
|
||||
* @param usage
|
||||
* ProtocolNotify usage
|
||||
*
|
||||
*
|
||||
* @returns String[] if elements are found at the known xpath
|
||||
* @returns String[0] if nothing is there
|
||||
*/
|
||||
|
@ -811,7 +814,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve ModuleUnloadImage names
|
||||
*
|
||||
*
|
||||
* @returns ModuleUnloadImage name list if elements are found at the known
|
||||
* xpath
|
||||
* @returns null if nothing is there
|
||||
|
@ -836,7 +839,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve Extern
|
||||
*
|
||||
*
|
||||
* @returns Extern objects list if elements are found at the known xpath
|
||||
* @returns null if nothing is there
|
||||
*/
|
||||
|
@ -853,10 +856,10 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve PpiNotify for specified arch
|
||||
*
|
||||
*
|
||||
* @param arch
|
||||
* PpiNotify arch
|
||||
*
|
||||
*
|
||||
* @returns String[] if elements are found at the known xpath
|
||||
* @returns String[0] if nothing is there
|
||||
*/
|
||||
|
@ -874,14 +877,14 @@ public class SurfaceAreaQuery {
|
|||
return new String[0];
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<String> ppiNotifyList = new ArrayList<String>();
|
||||
for (int i = 0; i < returns.length; i++) {
|
||||
List archList = ((PPIsDocument.PPIs.PpiNotify) returns[i]).getSupArchList();
|
||||
if (archList == null || contains(archList, arch)){
|
||||
ppiNotifyList.add(((PPIsDocument.PPIs.PpiNotify) returns[i]).getPpiNotifyCName());
|
||||
ppiNotifyList.add(((PPIsDocument.PPIs.PpiNotify) returns[i]).getPpiNotifyCName());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
String[] ppiNotifyArray = new String[ppiNotifyList.size()];
|
||||
for (int i = 0; i < ppiNotifyList.size(); i++) {
|
||||
|
@ -893,11 +896,11 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve PpiNotify for specified usage and arch
|
||||
*
|
||||
*
|
||||
* @param arch
|
||||
* PpiNotify arch usage PpiNotify usage
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @returns String[] if elements are found at the known xpath
|
||||
* @returns String[0] if nothing is there
|
||||
*/
|
||||
|
@ -934,10 +937,10 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve Ppi for specified arch
|
||||
*
|
||||
*
|
||||
* @param arch
|
||||
* Ppi arch
|
||||
*
|
||||
*
|
||||
* @returns String[] if elements are found at the known xpath
|
||||
* @returns String[0] if nothing is there
|
||||
*/
|
||||
|
@ -959,9 +962,9 @@ public class SurfaceAreaQuery {
|
|||
for (int i = 0; i < returns.length; i++) {
|
||||
List archList = ((PPIsDocument.PPIs.Ppi) returns[i]).getSupArchList();
|
||||
if (archList == null || contains(archList, arch)){
|
||||
ppiList.add(((PPIsDocument.PPIs.Ppi) returns[i]).getPpiCName());
|
||||
ppiList.add(((PPIsDocument.PPIs.Ppi) returns[i]).getPpiCName());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
String[] ppiArray = new String[ppiList.size()];
|
||||
for (int i = 0; i < ppiList.size(); i++) {
|
||||
|
@ -972,11 +975,11 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve PpiNotify for specified usage and arch
|
||||
*
|
||||
*
|
||||
* @param arch
|
||||
* PpiNotify arch usage PpiNotify usage
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @returns String[] if elements are found at the known xpath
|
||||
* @returns String[0] if nothing is there
|
||||
*/
|
||||
|
@ -1013,10 +1016,10 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve GuidEntry information for specified usage
|
||||
*
|
||||
*
|
||||
* @param arch
|
||||
* GuidEntry arch
|
||||
*
|
||||
*
|
||||
* @returns GuidEntry objects list if elements are found at the known xpath
|
||||
* @returns null if nothing is there
|
||||
*/
|
||||
|
@ -1038,9 +1041,9 @@ public class SurfaceAreaQuery {
|
|||
for (int i = 0; i < returns.length; i++) {
|
||||
List archList = ((GuidsDocument.Guids.GuidCNames) returns[i]).getSupArchList();
|
||||
if (archList == null || contains(archList, arch)){
|
||||
guidList.add(((GuidsDocument.Guids.GuidCNames) returns[i]).getGuidCName());
|
||||
guidList.add(((GuidsDocument.Guids.GuidCNames) returns[i]).getGuidCName());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
String[] guidArray = new String[guidList.size()];
|
||||
for (int i = 0; i < guidList.size(); i++) {
|
||||
|
@ -1052,10 +1055,10 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve GuidEntry information for specified usage
|
||||
*
|
||||
*
|
||||
* @param arch
|
||||
* GuidEntry arch usage GuidEntry usage
|
||||
*
|
||||
*
|
||||
* @returns GuidEntry objects list if elements are found at the known xpath
|
||||
* @returns null if nothing is there
|
||||
*/
|
||||
|
@ -1091,12 +1094,12 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve Library instance information
|
||||
*
|
||||
*
|
||||
* @param arch
|
||||
* Architecture name
|
||||
* @param usage
|
||||
* Library instance usage
|
||||
*
|
||||
*
|
||||
* @returns library instance name list if elements are found at the known
|
||||
* xpath
|
||||
* @returns null if nothing is there
|
||||
|
@ -1112,7 +1115,7 @@ public class SurfaceAreaQuery {
|
|||
xPath = new String[] { "/Instance" };
|
||||
} else {
|
||||
//
|
||||
// Since Schema don't have SupArchList now, so the follow Xpath is
|
||||
// Since Schema don't have SupArchList now, so the follow Xpath is
|
||||
// equal to "/Instance" and [not(@SupArchList) or @SupArchList= arch]
|
||||
// don't have effect.
|
||||
//
|
||||
|
@ -1167,7 +1170,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrive library's constructor name
|
||||
*
|
||||
*
|
||||
* @returns constructor name list if elements are found at the known xpath
|
||||
* @returns null if nothing is there
|
||||
*/
|
||||
|
@ -1185,7 +1188,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrive library's destructor name
|
||||
*
|
||||
*
|
||||
* @returns destructor name list if elements are found at the known xpath
|
||||
* @returns null if nothing is there
|
||||
*/
|
||||
|
@ -1206,7 +1209,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrive DriverBinding names
|
||||
*
|
||||
*
|
||||
* @returns DriverBinding name list if elements are found at the known xpath
|
||||
* @returns null if nothing is there
|
||||
*/
|
||||
|
@ -1217,7 +1220,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrive ComponentName names
|
||||
*
|
||||
*
|
||||
* @returns ComponentName name list if elements are found at the known xpath
|
||||
* @returns null if nothing is there
|
||||
*/
|
||||
|
@ -1228,7 +1231,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrive DriverConfig names
|
||||
*
|
||||
*
|
||||
* @returns DriverConfig name list if elements are found at the known xpath
|
||||
* @returns null if nothing is there
|
||||
*/
|
||||
|
@ -1239,7 +1242,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrive DriverDiag names
|
||||
*
|
||||
*
|
||||
* @returns DriverDiag name list if elements are found at the known xpath
|
||||
* @returns null if nothing is there
|
||||
*/
|
||||
|
@ -1250,7 +1253,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrive SetVirtualAddressMapCallBack names
|
||||
*
|
||||
*
|
||||
* @returns SetVirtualAddressMapCallBack name list if elements are found at
|
||||
* the known xpath
|
||||
* @returns null if nothing is there
|
||||
|
@ -1262,7 +1265,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrive ExitBootServicesCallBack names
|
||||
*
|
||||
*
|
||||
* @returns ExitBootServicesCallBack name list if elements are found at the
|
||||
* known xpath
|
||||
* @returns null if nothing is there
|
||||
|
@ -1274,7 +1277,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve module surface area file information
|
||||
*
|
||||
*
|
||||
* @returns ModuleSA objects list if elements are found at the known xpath
|
||||
* @returns Empty ModuleSA list if nothing is there
|
||||
*/
|
||||
|
@ -1348,11 +1351,11 @@ public class SurfaceAreaQuery {
|
|||
}
|
||||
for (int j = 0; j < archList.length; j++) {
|
||||
FpdModuleIdentification fpdSaId = new FpdModuleIdentification(saId, archList[j]);
|
||||
|
||||
|
||||
if (fvBinding != null) {
|
||||
fpdSaId.setFvBinding(fvBinding);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Put element to Map<FpdModuleIdentification, Map<String,
|
||||
// Object>>.
|
||||
|
@ -1365,7 +1368,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve valid image names
|
||||
*
|
||||
*
|
||||
* @returns valid iamges name list if elements are found at the known xpath
|
||||
* @returns empty list if nothing is there
|
||||
*/
|
||||
|
@ -1384,37 +1387,37 @@ public class SurfaceAreaQuery {
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static Node getFpdUserExtensionPreBuild() {
|
||||
String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='0']" };
|
||||
String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='0']" };
|
||||
|
||||
Object[] queryResult = get("PlatformSurfaceArea", xPath);
|
||||
if (queryResult == null || queryResult.length == 0) {
|
||||
return null;
|
||||
}
|
||||
UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)queryResult[0];
|
||||
|
||||
|
||||
return a.getDomNode();
|
||||
}
|
||||
|
||||
|
||||
public static Node getFpdUserExtensionPostBuild() {
|
||||
String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='1']" };
|
||||
String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='1']" };
|
||||
|
||||
Object[] queryResult = get("PlatformSurfaceArea", xPath);
|
||||
if (queryResult == null || queryResult.length == 0) {
|
||||
return null;
|
||||
}
|
||||
UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)queryResult[0];
|
||||
|
||||
|
||||
return a.getDomNode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve FV image option information
|
||||
*
|
||||
*
|
||||
* @param fvName
|
||||
* FV image name
|
||||
*
|
||||
*
|
||||
* @returns option name/value list if elements are found at the known xpath
|
||||
* @returns empty list if nothing is there
|
||||
*/
|
||||
|
@ -1478,10 +1481,10 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve FV image attributes information
|
||||
*
|
||||
*
|
||||
* @param fvName
|
||||
* FV image name
|
||||
*
|
||||
*
|
||||
* @returns attribute name/value list if elements are found at the known
|
||||
* xpath
|
||||
* @returns empty list if nothing is there
|
||||
|
@ -1495,7 +1498,7 @@ public class SurfaceAreaQuery {
|
|||
}
|
||||
ArrayList<String[]> list = new ArrayList<String[]>();
|
||||
for (int i = 0; i < queryResult.length; i++) {
|
||||
|
||||
|
||||
FvImagesDocument.FvImages.FvImage.FvImageOptions item = (FvImagesDocument.FvImages.FvImage.FvImageOptions) queryResult[i];
|
||||
List<FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue> namevalues = item.getNameValueList();
|
||||
Iterator iter = namevalues.iterator();
|
||||
|
@ -1515,7 +1518,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve flash definition file name
|
||||
*
|
||||
*
|
||||
* @returns file name if elements are found at the known xpath
|
||||
* @returns null if nothing is there
|
||||
*/
|
||||
|
@ -1539,21 +1542,21 @@ public class SurfaceAreaQuery {
|
|||
}
|
||||
|
||||
String[][] result = new String[queryResult.length][2];
|
||||
|
||||
|
||||
for (int i = 0; i < queryResult.length; i++) {
|
||||
FvImagesDocument.FvImages.NameValue item = (FvImagesDocument.FvImages.NameValue)queryResult[i];
|
||||
result[i][0] = item.getName();
|
||||
result[i][1] = item.getValue();
|
||||
}
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve FV image component options
|
||||
*
|
||||
*
|
||||
* @param fvName
|
||||
* FV image name
|
||||
*
|
||||
*
|
||||
* @returns name/value pairs list if elements are found at the known xpath
|
||||
* @returns empty list if nothing is there
|
||||
*/
|
||||
|
@ -1580,12 +1583,12 @@ public class SurfaceAreaQuery {
|
|||
result[i][0] = list.get(i)[0];
|
||||
result[i][1] = list.get(i)[1];
|
||||
}
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve PCD tokens
|
||||
*
|
||||
*
|
||||
* @returns CName/ItemType pairs list if elements are found at the known
|
||||
* xpath
|
||||
* @returns null if nothing is there
|
||||
|
@ -1603,7 +1606,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve MAS header
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
|
@ -1635,12 +1638,12 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve Extern Specification
|
||||
*
|
||||
*
|
||||
* @param
|
||||
*
|
||||
*
|
||||
* @return String[] If have specification element in the <extern> String[0]
|
||||
* If no specification element in the <extern>
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
public static String[] getExternSpecificaiton() {
|
||||
|
@ -1661,7 +1664,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retreive MsaFile which in SPD
|
||||
*
|
||||
*
|
||||
* @param
|
||||
* @return String[][3] The string sequence is ModuleName, ModuleGuid,
|
||||
* ModuleVersion, MsaFile String[0][] If no msafile in SPD
|
||||
|
@ -1811,7 +1814,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* getSpdPpi() Retrieve the SPD PPI Entry
|
||||
*
|
||||
*
|
||||
* @param
|
||||
* @return Map<String, String[2]> if get the PPI entry from SPD. Key - PPI
|
||||
* Name String[0] - PPI CNAME String[1] - PPI Guid Null if no PPI
|
||||
|
@ -1843,7 +1846,7 @@ public class SurfaceAreaQuery {
|
|||
|
||||
/**
|
||||
* Retrieve module Guid string
|
||||
*
|
||||
*
|
||||
* @returns GUILD string if elements are found at the known xpath
|
||||
* @returns null if nothing is there
|
||||
*/
|
||||
|
@ -1875,7 +1878,7 @@ public class SurfaceAreaQuery {
|
|||
/**
|
||||
Get name array of PCD in a module. In one module, token space
|
||||
is same, and token name should not be conflicted.
|
||||
|
||||
|
||||
@return String[]
|
||||
**/
|
||||
public static String[] getModulePcdEntryNameArray() {
|
||||
|
@ -1927,7 +1930,7 @@ public class SurfaceAreaQuery {
|
|||
}
|
||||
|
||||
ExternsDocument.Externs ext = (ExternsDocument.Externs)returns[0];
|
||||
|
||||
|
||||
if (ext.getTianoR8FlashMapH()){
|
||||
return true;
|
||||
}else {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/** @file
|
||||
ConfigReader class.
|
||||
|
||||
ConfigReader is used to read tool chain config file with flat format.
|
||||
|
||||
|
||||
ConfigReader is used to read tool chain config file with flat format.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
|
@ -14,7 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
package org.tianocore.build.toolchain;
|
||||
|
||||
import org.tianocore.exception.EdkException;
|
||||
import org.tianocore.common.exception.EdkException;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
|
@ -23,10 +23,10 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
|
||||
ConfigReader is used to read tool chain config file with flat format. Comments
|
||||
is line starting with character '#'.
|
||||
|
||||
|
||||
@since GenBuild 1.0
|
||||
**/
|
||||
public class ConfigReader {
|
||||
|
@ -35,14 +35,14 @@ public class ConfigReader {
|
|||
|
||||
|
||||
/**
|
||||
Public construct method.
|
||||
Public construct method.
|
||||
**/
|
||||
public ConfigReader () {
|
||||
}
|
||||
|
||||
/**
|
||||
Default filepath is ".".
|
||||
|
||||
|
||||
@param filename the config file name like "target.txt"
|
||||
@return the variables defined in file
|
||||
**/
|
||||
|
@ -52,8 +52,8 @@ public class ConfigReader {
|
|||
|
||||
/**
|
||||
Get all variables defined in config file. the config file format is flat
|
||||
with "A=B". If line started with '#' looks as comments.
|
||||
|
||||
with "A=B". If line started with '#' looks as comments.
|
||||
|
||||
@param confPath the path of config file
|
||||
@param filename the file name of the config file
|
||||
@return the variables defined in the config file
|
||||
|
@ -78,7 +78,7 @@ public class ConfigReader {
|
|||
// without '=', or start with '='
|
||||
//
|
||||
int index;
|
||||
if (str.length() == 0 || str.startsWith("#") ||
|
||||
if (str.length() == 0 || str.startsWith("#") ||
|
||||
(index = str.indexOf('=')) <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ public class ConfigReader {
|
|||
|
||||
public static synchronized ToolChainMap parseToolChainConfig(File ConfigFile) throws EdkException {
|
||||
ToolChainMap map = new ToolChainMap();
|
||||
|
||||
|
||||
try {
|
||||
FileReader reader = new FileReader(ConfigFile);
|
||||
BufferedReader in = new BufferedReader(reader);
|
||||
|
@ -114,7 +114,7 @@ public class ConfigReader {
|
|||
// without '=', or start with '='
|
||||
//
|
||||
int index;
|
||||
if (str.length() == 0 || str.startsWith("#") ||
|
||||
if (str.length() == 0 || str.startsWith("#") ||
|
||||
(index = str.indexOf('=')) <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/** @file
|
||||
ToolChainConfig class.
|
||||
|
||||
|
||||
ToolChainFactory class parse all config files and get tool chain information.
|
||||
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
|
@ -16,7 +16,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
package org.tianocore.build.toolchain;
|
||||
|
||||
import org.apache.tools.ant.BuildException;
|
||||
import org.tianocore.exception.EdkException;
|
||||
|
||||
import org.tianocore.common.exception.EdkException;
|
||||
import org.tianocore.build.toolchain.ToolChainKey;
|
||||
import org.tianocore.build.toolchain.ToolChainMap;
|
||||
|
||||
|
@ -26,9 +27,9 @@ import java.util.Set;
|
|||
|
||||
|
||||
/**
|
||||
|
||||
|
||||
ToolChainFactory class parse all config files and get tool chain information.
|
||||
|
||||
|
||||
**/
|
||||
public class ToolChainConfig {
|
||||
///
|
||||
|
@ -37,7 +38,7 @@ public class ToolChainConfig {
|
|||
private ToolChainMap config = null;
|
||||
///
|
||||
/// tool chain information (how many targets, archs, etc.)
|
||||
///
|
||||
///
|
||||
private ToolChainInfo info = new ToolChainInfo();
|
||||
|
||||
/**
|
||||
|
@ -48,7 +49,7 @@ public class ToolChainConfig {
|
|||
|
||||
/**
|
||||
Public construct method.
|
||||
|
||||
|
||||
@param toolChainFile File object representing the tool chain configuration file
|
||||
**/
|
||||
public ToolChainConfig (File toolChainFile) {
|
||||
|
@ -64,7 +65,7 @@ public class ToolChainConfig {
|
|||
/**
|
||||
Collect target, tool chain tag, arch and command information from key part
|
||||
of configuration
|
||||
|
||||
|
||||
@param toolChainDefKey The set of keys in tool chain configuration
|
||||
**/
|
||||
private void parseToolChainDefKey (Set<ToolChainKey> toolChainDefKey) {
|
||||
|
@ -80,8 +81,8 @@ public class ToolChainConfig {
|
|||
}
|
||||
|
||||
/**
|
||||
Return the tool chain configuration information in a Map form
|
||||
|
||||
Return the tool chain configuration information in a Map form
|
||||
|
||||
@return ToolChainMap Tool chain configurations in a ToolChainMap
|
||||
**/
|
||||
public ToolChainMap getConfig() {
|
||||
|
@ -90,7 +91,7 @@ public class ToolChainConfig {
|
|||
|
||||
/**
|
||||
Return the tool chain's target, arch, tag and commands information
|
||||
|
||||
|
||||
@return ToolChainInfo
|
||||
**/
|
||||
public ToolChainInfo getConfigInfo() {
|
||||
|
@ -99,7 +100,7 @@ public class ToolChainConfig {
|
|||
|
||||
/**
|
||||
override toString()
|
||||
|
||||
|
||||
@return String The converted configuration string in name=value form
|
||||
**/
|
||||
public String toString() {
|
||||
|
|
|
@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
package org.tianocore.build.toolchain;
|
||||
|
||||
import org.tianocore.exception.EdkException;
|
||||
import org.tianocore.common.exception.EdkException;
|
||||
|
||||
public class ToolChainKey implements java.io.Serializable, Comparable<ToolChainKey> {
|
||||
static final long serialVersionUID = -8034897190740066933L;
|
||||
|
|
Loading…
Reference in New Issue