]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Change module build sequence. 1. Get FvImageName list according to their declaration...
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 18 Aug 2006 05:37:49 +0000 (05:37 +0000)
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 18 Aug 2006 05:37:49 +0000 (05:37 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1320 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java
Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
Tools/Source/GenBuild/org/tianocore/build/autogen/CommonDefinition.java
Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
Tools/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java
Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java

index 8d9704be1e94f76c8fe1cd47658f9d07eb02e123..cb699da34e28d1f994426d71ed21f9e5c0fe7ef8 100644 (file)
@@ -32,8 +32,7 @@ import org.w3c.dom.Element;
 /** \r
   <p><code>FfsProcess</code> is a class to find the corresponding FFS layout. </p>\r
   \r
-  <p>Property <code>COMMON_FILE</code> specified which file to search. The element\r
-  in <code>COMMON_FILE</code> is like following: </p>\r
+  <p>The FFS Layout is like following: </p>\r
   \r
   <pre>\r
     &lt;Ffs type="APPLICATION"&gt;\r
@@ -104,14 +103,13 @@ public class FfsProcess {
     }\r
 \r
     /**\r
-      Find the corresponding FFS layout in <code>COMMON_FILE</code> if it\r
-      does not specify in module's surface area. \r
+      Find the corresponding FFS layout in <code>FPD</code>. \r
       \r
       @param buildType Current module's component type\r
       @param project Ant project\r
       @return whether find the corresponding FFS layout\r
       @throws BuildException\r
-              If specified COMMON_FILE XML file is not valide.\r
+              If can't find FFS Layout in FPD.\r
     **/\r
     public boolean initSections(String buildType, Project project, FpdModuleIdentification fpdModuleId) throws BuildException {\r
         //\r
index c8cc4ad74890729a245d705ac896467b4ca0d5be..117e40f5e001c3b4d56b8de06452390fb4b3ca57 100644 (file)
@@ -55,6 +55,7 @@ import org.tianocore.build.tools.ModuleItem;
   <p>The main function of this task is to parse module's surface area (MSA),\r
   then generate the corresponding <em>BaseName_build.xml</em> (the real ANT\r
   build script) and call this to build the module. The whole process including:\r
+  \r
   <pre>\r
   1. generate AutoGen.c and AutoGen.h; \r
   2. build all dependent library instances;\r
@@ -69,24 +70,26 @@ import org.tianocore.build.tools.ModuleItem;
   </p>\r
 \r
   <pre>\r
-   &lt;GenBuild\r
-             msaFilename=&quot;HelloWorld.msa&quot;/&gt;\r
-             processTo=&quot;ALL&quot;/&gt;\r
+    &lt;GenBuild \r
+       msaFile="${PACKAGE_DIR}/Application/HelloWorld/HelloWorld.msa"\r
+       type="cleanall" /&gt;\r
   </pre>\r
 \r
-  <p><code>processTo</code> provides a way to customize the whole build process.\r
-  processTo can be one value of ALL, AUTOGEN, FILES, LIBRARYINSTANCES, SECTIONS, NONE.\r
-  Default is ALL, means whole\r
-  </p>\r
-\r
   <p>\r
   This task calls <code>AutoGen</code> to generate <em>AutoGen.c</em> and\r
-  <em>AutoGen.h</em>. The task also parses the development environment\r
-  configuration files, such as collecting package information, setting compiler\r
-  flags and so on.\r
+  <em>AutoGen.h</em>. \r
   </p>\r
 \r
-\r
+  <p>\r
+  This task will also set properties for current module, such as PACKAGE, \r
+  PACKAGE_GUID, PACKAGE_VERSION, PACKAGE_DIR, PACKAGE_RELATIVE_DIR \r
+  (relative to Workspace), MODULE or BASE_NAME, GUID, VERSION, MODULE_DIR, \r
+  MODULE_RELATIVE_DIR (relative to Package), CONFIG_DIR, BIN_DIR, \r
+  DEST_DIR_DEBUG, DEST_DIR_OUTPUT, TARGET, ARCH, TOOLCHAIN, TOOLCHAIN_FAMILY, \r
+  SUBSYSTEM, ENTRYPOINT, EBC_TOOL_LIB_PATH, all compiler command related \r
+  properties (CC, CC_FLAGS, CC_DPATH, CC_SPATH, CC_FAMILY, CC_EXT). \r
+  </p>\r
+  \r
   @since GenBuild 1.0\r
 **/\r
 public class GenBuildTask extends Ant {\r
@@ -569,7 +572,7 @@ public class GenBuildTask extends Ant {
         // then call the exist BaseName_build.xml directly.\r
         //\r
         if (moduleId.getModuleType().equalsIgnoreCase("USER_DEFINED")) {\r
-            GlobalData.log.info("Call user-defined " + moduleId.getName() + "_build.xml");\r
+            System.out.println("Call user-defined " + moduleId.getName() + "_build.xml");\r
             \r
             String antFilename = getProject().getProperty("MODULE_DIR") + File.separatorChar + moduleId.getName() + "_build.xml";\r
             antCall(antFilename, null);\r
@@ -599,7 +602,7 @@ public class GenBuildTask extends Ant {
         // then call the exist BaseName_build.xml directly.\r
         //\r
         if (moduleId.getModuleType().equalsIgnoreCase("USER_DEFINED")) {\r
-            GlobalData.log.info("Calling user-defined " + moduleId.getName() + "_build.xml");\r
+            System.out.println("Calling user-defined " + moduleId.getName() + "_build.xml");\r
             \r
             String antFilename = getProject().getProperty("MODULE_DIR") + File.separatorChar + moduleId.getName() + "_build.xml";\r
             antCall(antFilename, "clean");\r
@@ -617,7 +620,7 @@ public class GenBuildTask extends Ant {
         // then call the exist BaseName_build.xml directly.\r
         //\r
         if (moduleId.getModuleType().equalsIgnoreCase("USER_DEFINED")) {\r
-            GlobalData.log.info("Calling user-defined " + moduleId.getName() + "_build.xml");\r
+            System.out.println("Calling user-defined " + moduleId.getName() + "_build.xml");\r
 \r
             String antFilename = getProject().getProperty("MODULE_DIR") + File.separatorChar + moduleId.getName() + "_build.xml";\r
             antCall(antFilename, "cleanall");\r
index a99de4da4f4c0a0fbc58462457e190eea93b488f..3d0bf7ab3437a30c32d457348cac98ef5c2418c2 100644 (file)
@@ -26,9 +26,7 @@ import java.util.Set;
   \r
 **/\r
 public class CommonDefinition {\r
-    public final static String spdSuffix = ".spd";\r
-    public final static String mbdSuffix = ".mbd";\r
-    public final static String msaSuffix = ".msa";\r
+\r
     public final static String LibraryStr = "LIBRARY";\r
     public final static String autoGenHbegin = "extern int __make_me_compile_correctly;\r\n";\r
     public final static String include = "#include";\r
@@ -58,18 +56,18 @@ public class CommonDefinition {
     public final static String tianoR8FlashMapH = "TianoR8FlashMap.h";\r
     public final static String flashMapH = "FlashMap.h";\r
 \r
-    //\r
-    // The defintions for identifying current module\r
-    // is PEI Pcd driver or Dxe Pcd driver.\r
-    // \r
+    ///\r
+    /// The defintions for identifying current module\r
+    /// is PEI Pcd driver or Dxe Pcd driver.\r
+    /// \r
     public static enum   PCD_DRIVER_TYPE { NOT_PCD_DRIVER,\r
         PEI_PCD_DRIVER, \r
         DXE_PCD_DRIVER,\r
         UNKNOWN_PCD_DRIVER};\r
 \r
-    //\r
-    // AutoGen.h and AutoGen.c file's header\r
-    //\r
+    ///\r
+    /// AutoGen.h and AutoGen.c file's header\r
+    ///\r
     public final static String autogenHNotation = \r
     "/**\r\n" +\r
     "  DO NOT EDIT\r\n" +\r
@@ -90,9 +88,9 @@ public class CommonDefinition {
     "       Auto-generated AutoGen.c for building module or library.\r\n" +\r
     "**/\r\n\r\n";\r
 \r
-    //\r
-    // module type\r
-    //\r
+    ///\r
+    /// module type\r
+    ///\r
     public final static int ModuleTypeBase = 0;\r
     public final static int ModuleTypeSec = 1;\r
     public final static int ModuleTypePeiCore = 2;\r
@@ -106,35 +104,9 @@ public class CommonDefinition {
     public final static int ModuleTypeUefiApplication = 10;\r
     public final static int ModuleTypeUnknown = 11;\r
 \r
-\r
-    //\r
-    // component type\r
-    //                           \r
-    public final static int  ComponentTypeNull = 0;\r
-    public final static int  ComponentTypeApriori = 1;\r
-    public final static int  ComponentTypeSec = 2;\r
-    public final static int  ComponentTypeLibrary = 3;\r
-    public final static int  ComponentTypeFvImageFile = 4;\r
-    public final static int  ComponentTypeBsDriver = 5;\r
-    public final static int  ComponentTypeRtDriver = 6;\r
-    public final static int  ComponentTypeSalRtDriver =7;\r
-    public final static int  ComponentTypePe32Peim = 8;\r
-    public final static int  ComponentTypePicPeim =9;\r
-    public final static int  ComponentTypeCombinedPeimDriver =10;\r
-    public final static int  ComponentTypePeiCore = 11;\r
-    public final static int  ComponentTypeDxeCore = 12;\r
-    public final static int  ComponentTypeApplication = 13;\r
-    public final static int  ComponentTypeBsDriverEfi = 14;\r
-    public final static int  ComponentTypeShellApp = 15;\r
-    public final static int  ComponentTypeBinary =16;\r
-    public final static int  ComponentTypeLogo = 17;\r
-    public final static int  ComponentTypeCustomBuild = 18;\r
-    public final static int  ComponentTypeUnknown = 19;\r
-\r
-\r
-    //\r
-    // Usaged style\r
-    //\r
+    ///\r
+    /// Usaged style\r
+    ///\r
     public final static String AlwaysConsumed = "ALWAYS_CONSUMED";\r
     public final static String AlwaysProduced = "ALWAYS_PRODUCED";\r
 \r
@@ -156,9 +128,9 @@ public class CommonDefinition {
         }\r
     }\r
 \r
-    //\r
-    // Module type\r
-    //\r
+    ///\r
+    /// Module type\r
+    ///\r
     public static final MyEnum[] moduleEnum = new MyEnum[] {\r
         new MyEnum("BASE", ModuleTypeBase),\r
         new MyEnum("SEC", ModuleTypeSec),\r
@@ -172,30 +144,6 @@ public class CommonDefinition {
         new MyEnum("UEFI_DRIVER", ModuleTypeUefiDriver),\r
         new MyEnum("UEFI_APPLICATION", ModuleTypeUefiApplication)};\r
 \r
-    //\r
-    // Component type\r
-    //\r
-    public static final MyEnum[] componentEnum = new MyEnum[]{\r
-        new MyEnum("APRIORI", ComponentTypeApriori),\r
-        new MyEnum("SEC", ComponentTypeSec),\r
-        new MyEnum("LIBRARY", ComponentTypeLibrary),\r
-        new MyEnum("FV_IMAGE_FILE", ComponentTypeFvImageFile),\r
-        new MyEnum("BS_DRIVER", ComponentTypeBsDriver),\r
-        new MyEnum("RT_DRIVER", ComponentTypeRtDriver),\r
-        new MyEnum("SAL_RT_DRIVER", ComponentTypeSalRtDriver),\r
-        new MyEnum("PE32_PEIM", ComponentTypePe32Peim),\r
-        new MyEnum("PIC_PEIM", ComponentTypePicPeim),\r
-        new MyEnum("COMBINED_PEIM_DRIVER", ComponentTypeCombinedPeimDriver),\r
-        new MyEnum("PEI_CORE", ComponentTypePeiCore),\r
-        new MyEnum("DXE_CORE", ComponentTypeDxeCore),\r
-        new MyEnum("APPLICATION", ComponentTypeApplication),\r
-        new MyEnum("BS_DRIVER_EFI", ComponentTypeBsDriverEfi),\r
-        new MyEnum("SHELLAPP", ComponentTypeShellApp),\r
-        new MyEnum("BINARY", ComponentTypeBinary),\r
-        new MyEnum("LOGO", ComponentTypeLogo),\r
-        new MyEnum("CUSTOM_BUILD", ComponentTypeCustomBuild)\r
-    };\r
-\r
     /**\r
       getModuleType\r
       \r
@@ -216,71 +164,14 @@ public class CommonDefinition {
     }\r
 \r
     /**\r
-      getComponentType\r
-      \r
-      This function get the component type value according commponet type \r
-      string.\r
-      \r
-      @param    componentTypeStr  String of component type.\r
-      @return\r
-    **/\r
-    static public int getComponentType (String componentTypeStr){\r
-        int returnValue = -1;\r
-        for (int i = 0; i < CommonDefinition.componentEnum.length; i++) {\r
-            returnValue = CommonDefinition.componentEnum[i].ForInt(componentTypeStr);\r
-            if (returnValue != -1) {\r
-                return returnValue;\r
-            }\r
-        }\r
-        return CommonDefinition.ComponentTypeUnknown;\r
-    }\r
-\r
-    /**\r
-    getComponentTypeString\r
-    \r
-    This function get the commponet type string according component type value.\r
-    \r
-    @param    componentType  Integer value of component type.\r
-    @return\r
-    **/\r
-    static public String getComponentTypeString (int componentType) {\r
-        if ((componentType > CommonDefinition.ComponentTypeUnknown) || \r
-            (componentType < CommonDefinition.ComponentTypeNull)) {\r
-            return null;\r
-        }\r
-        for (int index = 0; index < CommonDefinition.componentEnum.length; index ++) {\r
-            if (componentType == CommonDefinition.componentEnum[index].type) {\r
-                return CommonDefinition.componentEnum[index].moduleTypeStr;\r
-            }\r
-        }\r
-        return null;\r
-    }\r
-\r
-    /**\r
-      isLibraryComponent \r
+      formateGuidName\r
       \r
-      This function is to check does componet is library according to commponet\r
-      type value.\r
+      This function is to formate GUID to ANSI c form.\r
       \r
-      @param   componentType     Integer value of component type.\r
-      @return\r
+      @param guidNameCon\r
+                 String of GUID.\r
+      @return Formated GUID.\r
     **/\r
-    static public boolean isLibraryComponent (int componentType) {\r
-        if (ComponentTypeLibrary == componentType) {\r
-            return true;\r
-        }\r
-        return false;\r
-    }\r
-\r
-    /**\r
-     * formateGuidName\r
-     * \r
-     * This function is to formate GUID to ANSI c form.\r
-     * \r
-     * @param guidNameCon\r
-     *            String of GUID.\r
-     * @return Formated GUID.\r
-     */\r
     public static String formatGuidName(String guidNameConv) {\r
         String[] strList;\r
         String guid = "";\r
@@ -332,14 +223,14 @@ public class CommonDefinition {
     }\r
 \r
     /**\r
-     * Remove deuplicat string in list\r
-     * \r
-     * This function is to duplicat string in list\r
-     * \r
-     * @param String[]\r
-     *            String list.\r
-     * @return String[] String list which remove the duplicate string.\r
-     */\r
+      Remove deuplicat string in list\r
+      \r
+      This function is to duplicat string in list\r
+      \r
+      @param String[]\r
+                 String list.\r
+      @return String[] String list which remove the duplicate string.\r
+    **/\r
     public static String[] remDupString (String[] orgList){\r
         Set<String> strList = new LinkedHashSet<String>();\r
         String[] desList ;\r
index edaab68aaabc3c7d863faebe327a3df200b156cb..9a7581d93d50bb668dc3094c491cdfe3747b18d9 100644 (file)
@@ -55,8 +55,7 @@ import org.tianocore.build.toolchain.ToolChainMap;
   and BUILD_DIR. </p>\r
 \r
   <p>The task generates ${PLATFORM}_build.xml file which will be called by top level\r
-  build.xml. The task also generate Fv.inf files (File is for Tool GenFvImage)\r
-  and flash definition file (File is for Tool FlashMap) if necessary. </p>\r
+  build.xml. The task also generate Fv.inf files (File is for Tool GenFvImage). </p>\r
 \r
   <p>FpdParserTask task stores all FPD information to GlobalData. And parse\r
   tools definition file to set up compiler options for different Target and\r
@@ -70,9 +69,6 @@ import org.tianocore.build.toolchain.ToolChainMap;
   &lt;FPDParser platformName="Nt32" /&gt;\r
   </pre>\r
 \r
-  <p>The task will initialize all information through parsing Framework Database,\r
-  SPD, Tool chain configuration files. </p>\r
-\r
   @since GenBuild 1.0\r
 **/\r
 public class FpdParserTask extends Task {\r
@@ -102,7 +98,6 @@ public class FpdParserTask extends Task {
 \r
     private boolean isUnified = true;\r
 \r
-\r
     /**\r
       Public construct method. It is necessary for ANT task.\r
     **/\r
@@ -174,7 +169,7 @@ public class FpdParserTask extends Task {
         //\r
         // Gen build.xml\r
         //\r
-        PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, isUnified);\r
+        PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified);\r
         fileGenerator.genBuildFile();\r
 \r
         //\r
index a20f17bc1626129c6509f83475da1bfaaaeed0fb..ef6dc7223e535a03b5596cd4b672c19926569c90 100644 (file)
@@ -12,6 +12,7 @@
 package org.tianocore.build.fpd;\r
 \r
 import java.io.File;\r
+import java.util.HashMap;\r
 import java.util.Iterator;\r
 import java.util.Map;\r
 import java.util.Set;\r
@@ -52,6 +53,12 @@ public class PlatformBuildFileGenerator {
     /// Mapping from modules identification to out put file name\r
     ///\r
     private Map<FpdModuleIdentification, String> outfiles;\r
+    \r
+    ///\r
+    /// Mapping from FV name to its modules\r
+    ///\r
+    private Map<String, Set<FpdModuleIdentification>> fvs = new HashMap<String, Set<FpdModuleIdentification>>();\r
+\r
 \r
     private boolean isUnified = true;\r
     \r
@@ -63,10 +70,11 @@ public class PlatformBuildFileGenerator {
         + "Abstract:\n"\r
         + "Auto-generated ANT build file for building EFI Modules and Platforms\n";\r
 \r
-    public PlatformBuildFileGenerator(Project project, Map<FpdModuleIdentification, String> outfiles, boolean isUnified){\r
+    public PlatformBuildFileGenerator(Project project, Map<FpdModuleIdentification, String> outfiles, Map<String, Set<FpdModuleIdentification>> fvs, boolean isUnified){\r
         this.project = project;\r
         this.outfiles = outfiles;\r
         this.isUnified = isUnified;\r
+        this.fvs = fvs;\r
         this.platformName = project.getProperty("PLATFORM");\r
     }\r
     \r
@@ -173,68 +181,119 @@ public class PlatformBuildFileGenerator {
         }\r
     }\r
     \r
+    /**\r
+      1. Get All valid Fv Image Names in sequence\r
+      2. For each FV, get modules by sequences\r
+      3. Get other modules\r
+      \r
+      @param document XML document\r
+      @param root Node\r
+    **/\r
     private void applyModules(Document document, Node root) {\r
         root.appendChild(document.createComment("Modules target"));\r
         Element ele = document.createElement("target");\r
         ele.setAttribute("name", "modules");\r
 \r
-        Set<FpdModuleIdentification> set = outfiles.keySet();\r
-        Iterator iter = set.iterator();\r
-        while (iter.hasNext()) {\r
-            FpdModuleIdentification fpdModuleId = (FpdModuleIdentification) iter.next();\r
-            ModuleIdentification moduleId = fpdModuleId.getModule();\r
-            Element moduleEle = document.createElement("GenBuild");\r
-            moduleEle.setAttribute("type", "build");\r
-            //\r
-            // Inherit Properties.\r
-            //{"ARCH", "PACKAGE", "PACKAGE_GUID", "PACKAGE_VERSION", "MODULE_DIR"}\r
-            //\r
-            \r
-            //\r
-            // ARCH\r
-            //\r
-            Element property = document.createElement("property");\r
-            property.setAttribute("name", "ARCH");\r
-            property.setAttribute("value", fpdModuleId.getArch());\r
-            moduleEle.appendChild(property);\r
-\r
-            //\r
-            // MODULE_GUID\r
-            //\r
-            property = document.createElement("property");\r
-            property.setAttribute("name", "MODULE_GUID");\r
-            property.setAttribute("value", moduleId.getGuid());\r
-            moduleEle.appendChild(property);\r
-            \r
-            //\r
-            // MODULE_VERSION\r
-            //\r
-            property = document.createElement("property");\r
-            property.setAttribute("name", "MODULE_VERSION");\r
-            property.setAttribute("value", moduleId.getVersion());\r
-            moduleEle.appendChild(property);\r
-            \r
-            //\r
-            // PACKAGE_GUID\r
-            //\r
-            property = document.createElement("property");\r
-            property.setAttribute("name", "PACKAGE_GUID");\r
-            property.setAttribute("value", moduleId.getPackage().getGuid());\r
-            moduleEle.appendChild(property);\r
-            \r
-            //\r
-            // PACKAGE_VERSION\r
-            //\r
-            property = document.createElement("property");\r
-            property.setAttribute("name", "PACKAGE_VERSION");\r
-            property.setAttribute("value", moduleId.getPackage().getVersion());\r
-            moduleEle.appendChild(property);\r
-            \r
-            ele.appendChild(moduleEle);\r
+        //\r
+        // Get all valid FV name\r
+        //\r
+        String[] validFv = SurfaceAreaQuery.getFpdValidImageNames();\r
+        \r
+        //\r
+        // For each valid FV, get all modules in sequence\r
+        //\r
+        for (int i = 0; i < validFv.length; i++) {\r
+            if (fvs.containsKey(validFv[i])) {\r
+                Set<FpdModuleIdentification> set = fvs.get(validFv[i]);\r
+                Iterator<FpdModuleIdentification> iter = set.iterator();\r
+                while (iter.hasNext()) {\r
+                    FpdModuleIdentification fpdModuleId = iter.next();\r
+                    applySingleModule(document, ele, fpdModuleId);\r
+                }\r
+            }\r
         }\r
+        \r
+        //\r
+        // Get all other modules\r
+        //\r
+        Iterator<String> fvsNameIter = fvs.keySet().iterator();\r
+        \r
+        while (fvsNameIter.hasNext()) {\r
+            String fvName = fvsNameIter.next();\r
+            if (!isContain(validFv, fvName)) {\r
+                Set<FpdModuleIdentification> set = fvs.get(fvName);\r
+                Iterator iter = set.iterator();\r
+                while (iter.hasNext()) {\r
+                    FpdModuleIdentification fpdModuleId = (FpdModuleIdentification) iter.next();\r
+                    applySingleModule(document, ele, fpdModuleId);\r
+                }\r
+            }\r
+        }\r
+\r
         root.appendChild(ele);\r
     }\r
     \r
+    private void applySingleModule(Document document, Node root, FpdModuleIdentification fpdModuleId) {\r
+        ModuleIdentification moduleId = fpdModuleId.getModule();\r
+        Element moduleEle = document.createElement("GenBuild");\r
+        moduleEle.setAttribute("type", "build");\r
+        //\r
+        // Inherit Properties.\r
+        //{"ARCH", "PACKAGE", "PACKAGE_GUID", "PACKAGE_VERSION", "MODULE_DIR"}\r
+        //\r
+        \r
+        //\r
+        // ARCH\r
+        //\r
+        Element property = document.createElement("property");\r
+        property.setAttribute("name", "ARCH");\r
+        property.setAttribute("value", fpdModuleId.getArch());\r
+        moduleEle.appendChild(property);\r
+\r
+        //\r
+        // MODULE_GUID\r
+        //\r
+        property = document.createElement("property");\r
+        property.setAttribute("name", "MODULE_GUID");\r
+        property.setAttribute("value", moduleId.getGuid());\r
+        moduleEle.appendChild(property);\r
+        \r
+        //\r
+        // MODULE_VERSION\r
+        //\r
+        property = document.createElement("property");\r
+        property.setAttribute("name", "MODULE_VERSION");\r
+        property.setAttribute("value", moduleId.getVersion());\r
+        moduleEle.appendChild(property);\r
+        \r
+        //\r
+        // PACKAGE_GUID\r
+        //\r
+        property = document.createElement("property");\r
+        property.setAttribute("name", "PACKAGE_GUID");\r
+        property.setAttribute("value", moduleId.getPackage().getGuid());\r
+        moduleEle.appendChild(property);\r
+        \r
+        //\r
+        // PACKAGE_VERSION\r
+        //\r
+        property = document.createElement("property");\r
+        property.setAttribute("name", "PACKAGE_VERSION");\r
+        property.setAttribute("value", moduleId.getPackage().getVersion());\r
+        moduleEle.appendChild(property);\r
+        \r
+        root.appendChild(moduleEle);\r
+    }\r
+    \r
+    private boolean isContain(String[] list, String item) {\r
+        for (int i = 0; i < list.length; i++) {\r
+            if (list[i].equalsIgnoreCase(item)) {\r
+                return true;\r
+            }\r
+        }\r
+        return false;\r
+    }\r
+    \r
     private void applyFvs(Document document, Node root) {\r
         //\r
         // FVS Target\r
index 3a5d1dd9a086ec730719744142484309a3fb2a1b..3ac976acfb3cd54aad6c11bd64507662ff25a323 100644 (file)
@@ -23,7 +23,6 @@ import java.util.Iterator;
 import java.util.List;\r
 import java.util.Map;\r
 import java.util.Set;\r
-import java.util.logging.Logger;\r
 \r
 import org.apache.tools.ant.BuildException;\r
 import org.apache.xmlbeans.XmlObject;\r
@@ -57,9 +56,6 @@ import org.tianocore.build.toolchain.ToolChainMap;
   @since GenBuild 1.0\r
 **/\r
 public class GlobalData {\r
-\r
-    public static Logger log = Logger.getAnonymousLogger();\r
-\r
     ///\r
     /// Record current WORKSPACE Directory\r
     ///\r
@@ -654,10 +650,10 @@ public class GlobalData {
         return result;\r
     }\r
 \r
-    ////// Tool Chain Related, try to refine and put some logic process to ToolChainFactory\r
-\r
+    ///\r
+    /// Tool Chain Related, try to refine and put some logic process to ToolChainFactory\r
+    ///\r
     public static ToolChainInfo getToolChainInfo() {\r
-//        GlobalData.log.info(toolsDef.getConfigInfo() + "" + toolChainEnvInfo + toolChainPlatformInfo);\r
         if (toolChainInfo == null) {\r
             toolChainInfo = toolsDef.getConfigInfo().intersection(toolChainEnvInfo);\r
             if (toolChainPlatformInfo != null) {\r
@@ -665,13 +661,12 @@ public class GlobalData {
             }\r
             toolChainInfo.addCommands(toolsDef.getConfigInfo().getCommands());\r
             toolChainInfo.normalize();\r
-            GlobalData.log.info(toolChainInfo + "");\r
+            System.out.println("Current build tool chain information summary: ");\r
+            System.out.println(toolChainInfo + "");\r
         }\r
         return toolChainInfo;\r
     }\r
 \r
-\r
-\r
     public static void setPlatformToolChainFamilyOption(ToolChainMap map) {\r
         platformToolChainFamilyOption = map;\r
     }\r