]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fully support active platform policy.
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 5 Jul 2006 06:22:06 +0000 (06:22 +0000)
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 5 Jul 2006 06:22:06 +0000 (06:22 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@763 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Conf/target.template
Tools/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java
Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
Tools/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java
Tools/Source/GenBuild/org/tianocore/build/OutputDirSetup.java
Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java
Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java
Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java

index e961d705c605af10a494af1049006c0253314096..fde5df2d5a9a0cc47dc2299a67ea2fdc3f565bb0 100644 (file)
@@ -1,3 +1,11 @@
-ACTIVE_PLATFORM = MdePkg.fpd
-ACTIVE_TARGET = DEBUG
-ACTIVE_ARCH = IA32
+# Relative to WORKSPACE
+TOOLS_DEFINITION_FILE = Tools/Conf/tools_def.txt
+
+# Relative to WORKSPACE
+# ACTIVE_PLATFORM       = MdePkg/MdePkg.fpd
+
+# Separate multiple targets with space, not not use comma 
+TARGET                = 
+TARGET_ARCH           = 
+TAGNAME               = 
+
index b9afc57bad39774a4ea23e976f0068eb7d69c6fe..f91002ace195995e14a32894826c639b91d0527e 100644 (file)
@@ -1,3 +1,16 @@
+/** @file FrameworkBuildTask.java\r
+  \r
+  The file is ANT task to find MSA or FPD file and build them. \r
\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution.  The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ **/\r
 package org.tianocore.build;\r
 \r
 import java.io.BufferedReader;\r
@@ -12,6 +25,8 @@ import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Task;\r
 import org.tianocore.build.fpd.FpdParserTask;\r
 import org.tianocore.build.global.GlobalData;\r
+import org.tianocore.build.toolchain.ConfigReader;\r
+import org.tianocore.build.toolchain.ToolChainConfig;\r
 import org.tianocore.build.toolchain.ToolChainInfo;\r
 \r
 public class FrameworkBuildTask extends Task{\r
@@ -22,6 +37,12 @@ public class FrameworkBuildTask extends Task{
     \r
     private Set<File> msaFiles = new LinkedHashSet<File>();\r
     \r
+    String toolsDefFilename = "Tools" + File.separatorChar + "Conf" + File.separatorChar + "tools_def.txt";\r
+    \r
+    String targetFilename = "target.txt";\r
+    \r
+    String activePlatform = null;\r
+    \r
     ///\r
     /// there are three type: all (build), clean and cleanall\r
     ///\r
@@ -64,45 +85,65 @@ public class FrameworkBuildTask extends Task{
             throw new BuildException(e.getMessage());\r
         }\r
         \r
-        //\r
-        // If there is no build files or FPD files or MSA files, stop build\r
-        //\r
-        if (fpdFiles.size() == 0 && msaFiles.size() == 0) {\r
-            throw new BuildException("Can't find any build.xml file or FPD files or MSA files in current directory. ");\r
-        }\r
-        \r
-        File buildFile = intercommuniteWithUser();\r
-        System.out.println("Start to build file [" + buildFile.getPath() + "] ..>> ");\r
-        \r
         //\r
         // Deal with all environment variable (Add them to properties)\r
         //\r
         backupSystemProperties();\r
         \r
         //\r
-        // Get ToolChain Info from environment\r
+        // Read target.txt file\r
         //\r
-        ToolChainInfo envToolChainInfo = new ToolChainInfo(); \r
-        envToolChainInfo.addTargets(getProject().getProperty("TARGET")); \r
-        envToolChainInfo.addTagnames(getProject().getProperty("TAGNAME")); \r
-        envToolChainInfo.addArchs(getProject().getProperty("ARCH")); \r
-        GlobalData.setToolChainEnvInfo(envToolChainInfo);\r
-        \r
+        readTargetFile();\r
+\r
         //\r
         // Global Data initialization\r
         //\r
-        String toolsDefFilename = "tools_def.txt";\r
-        if (getProject().getProperty("TOOLS_DEF") != null) {\r
-            toolsDefFilename = getProject().getProperty("TOOLS_DEF");\r
-        }\r
-        \r
         GlobalData.initInfo("Tools" + File.separatorChar + "Conf" + File.separatorChar + "FrameworkDatabase.db",\r
                             getProject().getProperty("WORKSPACE_DIR"), toolsDefFilename);\r
         \r
+\r
+        \r
+        //\r
+        // If find MSA file and ACTIVE_PLATFORM is set, build the module; \r
+        // else fail build. \r
+        // If without MSA file, and ACTIVE_PLATFORM is set, build the ACTIVE_PLATFORM. \r
+        // If ACTIVE_PLATFORM is not set, and only find one FPD file, build the platform; \r
+        // If find more than one FPD files, let user select one. \r
+        //\r
+        File buildFile = null;\r
+        if (msaFiles.size() > 1) {\r
+            throw new BuildException("More than one MSA file under current directory. It is not allowd. ");\r
+        }\r
+        else if (msaFiles.size() == 1 && activePlatform == null) {\r
+            throw new BuildException("If try to build a single module, please set ACTIVE_PLATFORM in file [Tool/Conf/target.txt]. ");\r
+        }\r
+        else if (msaFiles.size() == 1 && activePlatform != null) {\r
+            //\r
+            // Build the single module\r
+            //\r
+            buildFile = msaFiles.toArray(new File[1])[0];\r
+        }\r
+        else if (activePlatform != null) {\r
+            buildFile = new File(GlobalData.getWorkspacePath() + File.separatorChar + activePlatform);\r
+        }\r
+        else if (fpdFiles.size() == 1) {\r
+            buildFile = fpdFiles.toArray(new File[1])[0];\r
+        }\r
+        else if (fpdFiles.size() > 1) {\r
+            buildFile = intercommuniteWithUser();\r
+        }\r
+        //\r
+        // If there is no build files or FPD files or MSA files, stop build\r
+        //\r
+        else {\r
+            throw new BuildException("Can't find any FPD files or MSA files in current directory. ");\r
+        }\r
+\r
         //\r
         // Build every FPD files (PLATFORM build)\r
         //\r
         if (buildFile.getName().endsWith(".fpd")) {\r
+            System.out.println("Start to build FPD file [" + buildFile.getPath() + "] ..>> ");\r
             FpdParserTask fpdParserTask = new FpdParserTask();\r
             fpdParserTask.setType(type);\r
             fpdParserTask.setProject(getProject());\r
@@ -114,8 +155,11 @@ public class FrameworkBuildTask extends Task{
         // Build every MSA files (SINGLE MODULE BUILD)\r
         //\r
         else if (buildFile.getName().endsWith(".msa")) {\r
+            System.out.println("Start to build MSA file [" + buildFile.getPath() + "] ..>> ");\r
             GenBuildTask genBuildTask = new GenBuildTask();\r
+            genBuildTask.setSingleModuleBuild(true);\r
             genBuildTask.setType(type);\r
+            getProject().setProperty("PLATFORM_FILE", activePlatform);\r
             genBuildTask.setProject(getProject());\r
             genBuildTask.setMsaFile(buildFile);\r
             genBuildTask.execute();\r
@@ -207,4 +251,62 @@ public class FrameworkBuildTask extends Task{
             this.type = "all";\r
         }\r
     }\r
+    \r
+    private void readTargetFile(){\r
+        try {\r
+            String[][] targetFileInfo = ConfigReader.parse(getProject().getProperty("WORKSPACE_DIR"), "Tools" + File.separatorChar + "Conf" + File.separatorChar + targetFilename);\r
+            \r
+            //\r
+            // Get ToolChain Info from target.txt\r
+            //\r
+            ToolChainInfo envToolChainInfo = new ToolChainInfo(); \r
+            String str = getValue("TARGET", targetFileInfo);\r
+            if (str == null || str.trim().equals("")) {\r
+                envToolChainInfo.addTargets("*");\r
+            }\r
+            else {\r
+                envToolChainInfo.addTargets(str);\r
+            }\r
+            str = getValue("TAGNAME", targetFileInfo);\r
+            if (str == null || str.trim().equals("")) {\r
+                envToolChainInfo.addTagnames("*");\r
+            }\r
+            else {\r
+                envToolChainInfo.addTagnames(str);\r
+            }\r
+            str = getValue("TARGET_ARCH", targetFileInfo);\r
+            if (str == null || str.trim().equals("")) {\r
+                envToolChainInfo.addArchs("*");\r
+            }\r
+            else {\r
+                envToolChainInfo.addArchs(str);\r
+            }\r
+            GlobalData.setToolChainEnvInfo(envToolChainInfo);\r
+            \r
+            str = getValue("TOOLS_DEFINITION_FILE", targetFileInfo);\r
+            if (str != null) {\r
+                toolsDefFilename = str;\r
+            }\r
+            \r
+            str = getValue("ACTIVE_PLATFORM", targetFileInfo);\r
+            if (str != null && ! str.trim().equals("")) {\r
+                if ( ! str.endsWith(".fpd")) {\r
+                    throw new BuildException("FPD file's file extension must be \".fpd\"");\r
+                }\r
+                activePlatform = str;\r
+            }\r
+        }\r
+        catch (Exception ex) {\r
+            throw new BuildException(ex.getMessage());\r
+        }\r
+    }\r
+    \r
+    private String getValue(String key, String[][] map) {\r
+        for (int i = 0; i < map[0].length; i++){\r
+            if (key.equalsIgnoreCase(map[0][i])) {\r
+                return map[1][i];\r
+            }\r
+        }\r
+        return null;\r
+    }\r
 }\r
index 9eb509bca3bfe97df3ec3278647c617e1a0e255e..1299e11059a27aac7017ae8c05a41168c3f4624e 100644 (file)
@@ -100,11 +100,10 @@ public class GenBuildTask extends Ant {
     private ModuleIdentification moduleId;\r
 \r
     private Vector<Property> properties = new Vector<Property>();\r
-    \r
+\r
     private static Stack<Hashtable> backupPropertiesStack = new Stack<Hashtable>();\r
     \r
-    \r
-    private static Hashtable backupProperties;\r
+    private boolean isSingleModuleBuild = false;\r
     \r
     /**\r
       Public construct method. It is necessary for ANT task.\r
@@ -170,7 +169,7 @@ public class GenBuildTask extends Ant {
         //\r
         // Judge whether it is single module build or not\r
         //\r
-        if (getProject().getProperty("PLATFORM") == null) {\r
+        if (isSingleModuleBuild) {\r
             //\r
             // Single Module build\r
             //\r
@@ -180,8 +179,8 @@ public class GenBuildTask extends Ant {
             //\r
             // Platform build. Restore the platform related info\r
             //\r
-            String platformName = getProject().getProperty("PLATFORM");\r
-            PlatformIdentification platformId = GlobalData.getPlatform(platformName);\r
+            String filename = getProject().getProperty("PLATFORM_FILE");\r
+            PlatformIdentification platformId = GlobalData.getPlatform(filename);\r
             getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));\r
             getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));\r
             \r
@@ -309,13 +308,13 @@ public class GenBuildTask extends Ant {
         //\r
         // Read ACTIVE_PLATFORM's FPD file (Call FpdParserTask's method)\r
         //\r
-        String activePlatformName = getProject().getProperty("ACTIVE_PLATFORM");\r
+        String filename = getProject().getProperty("PLATFORM_FILE");\r
         \r
-        if (activePlatformName == null){\r
+        if (filename == null){\r
             throw new BuildException("Plese set ACTIVE_PLATFORM if you want to build a single module. ");\r
         }\r
         \r
-        PlatformIdentification platformId = GlobalData.getPlatform(activePlatformName);\r
+        PlatformIdentification platformId = GlobalData.getPlatform(filename);\r
         \r
         //\r
         // Read FPD file\r
@@ -328,7 +327,7 @@ public class GenBuildTask extends Ant {
         // Prepare for Platform related common properties\r
         // PLATFORM, PLATFORM_DIR, PLATFORM_RELATIVE_DIR\r
         //\r
-        getProject().setProperty("PLATFORM", activePlatformName);\r
+        getProject().setProperty("PLATFORM", platformId.getName());\r
         getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));\r
         getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));\r
     }\r
@@ -766,4 +765,8 @@ public class GenBuildTask extends Ant {
             getProject().setProperty(item, (String)backupProperties.get(item));\r
         }\r
     }\r
+\r
+    public void setSingleModuleBuild(boolean isSingleModuleBuild) {\r
+        this.isSingleModuleBuild = isSingleModuleBuild;\r
+    }\r
 }\r
index 4c6843e6b2ce996312a9d16b415bfac9c91f4375..7d8bf8b59e11d64d8df5937d70c2c0969666a71e 100644 (file)
@@ -46,7 +46,7 @@ public class ModuleBuildFileGenerator {
     /// Pass: TARGET, TOOLCHAIN, ARCH\r
     /// PACKAGE, PACKAGE_GUID, PACKAGE_VERSION\r
     ///\r
-    String[] inheritProperties = {"ARCH", "MODULE_GUID", "MODULE_VERSION", "PLATFORM", "PACKAGE_GUID", "PACKAGE_VERSION"};\r
+    String[] inheritProperties = {"ARCH", "MODULE_GUID", "MODULE_VERSION", "PLATFORM_FILE", "PACKAGE_GUID", "PACKAGE_VERSION"};\r
 \r
     ///\r
     /// The information at the header of <em>build.xml</em>.\r
index 6a53fa6dbbabe62f1bc3de96335df420be403689..fc24f6f67b73bf8815c9601bb807218f039c282e 100644 (file)
@@ -8,9 +8,7 @@ import org.apache.tools.ant.Task;
 import org.apache.xmlbeans.XmlObject;\r
 import org.tianocore.build.fpd.FpdParserTask;\r
 import org.tianocore.build.global.GlobalData;\r
-import org.tianocore.build.global.OutputManager;\r
 import org.tianocore.build.global.SurfaceAreaQuery;\r
-import org.tianocore.build.id.FpdModuleIdentification;\r
 import org.tianocore.build.id.ModuleIdentification;\r
 import org.tianocore.build.id.PackageIdentification;\r
 import org.tianocore.build.id.PlatformIdentification;\r
@@ -31,6 +29,7 @@ public class OutputDirSetup extends Task {
     ///\r
     private String componentType;\r
     \r
+    private boolean isSingleModuleBuild = false;\r
 //    private ToolChainFactory toolChainFactory;\r
     \r
     /**\r
@@ -64,7 +63,7 @@ public class OutputDirSetup extends Task {
         //\r
         // Judge whether it is single module build or not\r
         //\r
-        if (getProject().getProperty("PLATFORM") == null) {\r
+        if (isSingleModuleBuild) {\r
             //\r
             // Single Module build\r
             //\r
@@ -74,8 +73,8 @@ public class OutputDirSetup extends Task {
             //\r
             // Platform build\r
             //\r
-            String platformName = getProject().getProperty("PLATFORM");\r
-            PlatformIdentification platformId = GlobalData.getPlatform(platformName);\r
+            String filename = getProject().getProperty("PLATFORM_FILE");\r
+            PlatformIdentification platformId = GlobalData.getPlatform(filename);\r
             getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));\r
             getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));\r
           \r
@@ -160,9 +159,9 @@ public class OutputDirSetup extends Task {
         //\r
         // Read ACTIVE_PLATFORM's FPD file (Call FpdParserTask's method)\r
         //\r
-        String activePlatformName = getProject().getProperty("env.ACTIVE_PLATFORM");\r
-        \r
-        PlatformIdentification platformId = GlobalData.getPlatform(activePlatformName);\r
+        String filename = getProject().getProperty("PLATFORM_FILE");\r
+\r
+        PlatformIdentification platformId = GlobalData.getPlatform(filename);\r
         \r
         //\r
         // Read FPD file\r
@@ -174,7 +173,7 @@ public class OutputDirSetup extends Task {
         // Prepare for Platform related common properties\r
         // PLATFORM, PLATFORM_DIR, PLATFORM_RELATIVE_DIR\r
         //\r
-        getProject().setProperty("PLATFORM", activePlatformName);\r
+        getProject().setProperty("PLATFORM", platformId.getName());\r
         getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));\r
         getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));\r
     }\r
index ffbd919a728e3328760b2e20385998dd2ac52a3d..b61ad065f137e6b6b5fd1cf6f293f0b2d173ce58 100644 (file)
@@ -139,7 +139,7 @@ public class FpdParserTask extends Task {
             if (platformName == null) {\r
                 throw new BuildException("FpdParserTask parameter error. Please specify platform name or FPD file. ");\r
             }\r
-            platformId = GlobalData.getPlatform(platformName);\r
+            platformId = GlobalData.getPlatformByName(platformName);\r
             fpdFile = platformId.getFpdFile();\r
         }\r
         \r
@@ -147,20 +147,6 @@ public class FpdParserTask extends Task {
         // Parse FPD file\r
         //\r
         parseFpdFile();\r
-\r
-        getProject().setProperty("PLATFORM", platformId.getName());\r
-        getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));\r
-        getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));\r
-\r
-        //\r
-        // Pcd Collection. Call CollectPCDAction to collect pcd info.\r
-        //\r
-        try {\r
-            CollectPCDAction ca = new CollectPCDAction();\r
-            ca.perform(GlobalData.getWorkspacePath(),platformId.getFpdFile().getPath(),ActionMessage.NULL_MESSAGE_LEVEL);\r
-        } catch (Exception e){\r
-            throw new BuildException(e.getMessage());\r
-        }\r
         \r
         //\r
         // Prepare BUILD_DIR\r
@@ -359,12 +345,16 @@ public class FpdParserTask extends Task {
             Map<String, XmlObject> map = new HashMap<String, XmlObject>();\r
             map.put("PlatformSurfaceArea", doc);\r
             SurfaceAreaQuery.setDoc(map);\r
-            \r
+            SurfaceAreaQuery.getFpdUserExtension();\r
             //\r
             // Initialize\r
             //\r
             platformId = SurfaceAreaQuery.getFpdHeader();\r
             platformId.setFpdFile(fpdFile);\r
+            getProject().setProperty("PLATFORM", platformId.getName());\r
+            getProject().setProperty("PLATFORM_FILE", platformId.getRelativeFpdFile().replaceAll("(\\\\)", "/"));\r
+            getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));\r
+            getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));\r
 \r
             //\r
             // Build mode. User-defined output dir. \r
@@ -393,6 +383,16 @@ public class FpdParserTask extends Task {
             parseToolChainOptions();\r
 \r
             SurfaceAreaQuery.setDoc(map);\r
+            \r
+            //\r
+            // Pcd Collection. Call CollectPCDAction to collect pcd info.\r
+            //\r
+            try {\r
+                CollectPCDAction ca = new CollectPCDAction();\r
+                ca.perform(GlobalData.getWorkspacePath(),platformId.getFpdFile().getPath(),ActionMessage.NULL_MESSAGE_LEVEL);\r
+            } catch (Exception e){\r
+                throw new BuildException(e.getMessage());\r
+            }\r
         } catch (Exception e) {\r
             e.printStackTrace();\r
             throw new BuildException("Load FPD file [" + fpdFile.getPath() + "] error. \n" + e.getMessage());\r
index 195f2e93aaa6959d11ccdbf1573e1c7a832a845c..f3f0a048d92332936ba114166bc81c0e6a297f8c 100644 (file)
@@ -166,8 +166,7 @@ public class GlobalData {
         // If ToolChain has been set up before, do nothing.\r
         // CONF dir + tools definition file name\r
         //\r
-        String confDir = GlobalData.workspaceDir + File.separatorChar + "Tools" + File.separatorChar + "Conf";\r
-        File toolsDefFile = new File(confDir + File.separatorChar + toolsDefFilename);\r
+        File toolsDefFile = new File(workspaceDir + File.separatorChar + toolsDefFilename);\r
         System.out.println("Using file [" + toolsDefFile.getPath() + "] as tools definition file. ");\r
         toolsDef = new ToolChainConfig(toolsDefFile);\r
         \r
@@ -576,21 +575,27 @@ public class GlobalData {
 \r
     }\r
     \r
-    /////////////////////////// Update!! Update!! Update!!\r
-//    public synchronized static MemoryDatabaseManager getPCDMemoryDBManager() {\r
-//        return pcdDbManager;\r
-//    }\r
-    ///////////////////////////\r
-    public synchronized static PlatformIdentification getPlatform(String name) throws BuildException {\r
+    public synchronized static PlatformIdentification getPlatformByName(String name) throws BuildException {\r
         Iterator iter = platformList.iterator();\r
         while(iter.hasNext()){\r
             PlatformIdentification platformId = (PlatformIdentification)iter.next();\r
             if (platformId.getName().equalsIgnoreCase(name)) {\r
-//                GlobalData.log.info("Platform: " + platformId + platformId.getFpdFile());\r
                 return platformId;\r
             }\r
         }\r
-        throw new BuildException("Can't find platform [" + name + "] in current workspace. ");\r
+        throw new BuildException("Can't find platform [" + name + "] in current workspace database. ");\r
+    }\r
+    \r
+    public synchronized static PlatformIdentification getPlatform(String filename) throws BuildException {\r
+        File file = new File(workspaceDir + File.separatorChar + filename);\r
+        Iterator iter = platformList.iterator();\r
+        while(iter.hasNext()){\r
+            PlatformIdentification platformId = (PlatformIdentification)iter.next();\r
+            if (platformId.getFpdFile().getPath().equalsIgnoreCase(file.getPath())) {\r
+                return platformId;\r
+            }\r
+        }\r
+        throw new BuildException("Can't find platform file [" + filename + "] in current workspace database. ");\r
     }\r
     \r
     public synchronized static PackageIdentification refreshPackageIdentification(PackageIdentification packageId) throws BuildException {\r
index 5f86217378e1fa021c0c4d09e7cd4b5834bad05b..f6b00fdf37631784859dda3c2829d04f2732b06a 100644 (file)
@@ -26,7 +26,37 @@ import java.util.regex.Pattern;
 import org.apache.xmlbeans.XmlNormalizedString;\r
 import org.apache.xmlbeans.XmlObject;\r
 import org.apache.xmlbeans.XmlString;\r
-import org.tianocore.*;\r
+import org.tianocore.BuildOptionsDocument;\r
+import org.tianocore.CNameType;\r
+import org.tianocore.DataIdDocument;\r
+import org.tianocore.ExternsDocument;\r
+import org.tianocore.FileNameConvention;\r
+import org.tianocore.FvAttributeDocument;\r
+import org.tianocore.FvImagesDocument;\r
+import org.tianocore.FvOptionDocument;\r
+import org.tianocore.GuidDeclarationsDocument;\r
+import org.tianocore.GuidsDocument;\r
+import org.tianocore.LibrariesDocument;\r
+import org.tianocore.LibraryClassDeclarationsDocument;\r
+import org.tianocore.LibraryClassDocument;\r
+import org.tianocore.ModuleDefinitionsDocument;\r
+import org.tianocore.ModuleSADocument;\r
+import org.tianocore.ModuleSaBuildOptionsDocument;\r
+import org.tianocore.ModuleTypeDef;\r
+import org.tianocore.MsaFilesDocument;\r
+import org.tianocore.MsaHeaderDocument;\r
+import org.tianocore.OptionDocument;\r
+import org.tianocore.PPIsDocument;\r
+import org.tianocore.PackageDependenciesDocument;\r
+import org.tianocore.PackageHeadersDocument;\r
+import org.tianocore.PcdCodedDocument;\r
+import org.tianocore.PlatformDefinitionsDocument;\r
+import org.tianocore.PlatformHeaderDocument;\r
+import org.tianocore.PpiDeclarationsDocument;\r
+import org.tianocore.ProtocolDeclarationsDocument;\r
+import org.tianocore.Sentence;\r
+import org.tianocore.SpdHeaderDocument;\r
+import org.tianocore.SupportedArchitectures;\r
 import org.tianocore.FilenameDocument.Filename;\r
 import org.tianocore.MsaHeaderDocument.MsaHeader;\r
 import org.tianocore.ProtocolsDocument.Protocols.Protocol;\r
@@ -1344,7 +1374,7 @@ public class SurfaceAreaQuery {
     }\r
     \r
     public static XmlObject getFpdUserExtension() {\r
-        String[] xPath = new String[] { "" };\r
+        String[] xPath = new String[] { "/UserExtensions" };\r
 \r
         Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
         if (queryResult == null) {\r
index 8ee6cf04f30aa77d9f6b6be73012da4834560f4e..e1048808c9d6c35bab744c81215c7523f0c6b6b1 100644 (file)
@@ -37,6 +37,10 @@ public class PlatformIdentification extends Identification{
         return fpdFile;\r
     }\r
     \r
+    public String getRelativeFpdFile (){\r
+        return fpdFile.getPath().substring(GlobalData.getWorkspacePath().length());\r
+    }\r
+    \r
     public String getPlatformRelativeDir(){\r
         return fpdFile.getParent().substring(GlobalData.getWorkspacePath().length());\r
     }\r