]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java
1. Add help for ToolChainConfig
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / workspace / WorkspaceTools.java
index 73fba9a86140a8082b2c2758a1f95119d8592a3e..a87ab07794cfd53a3b0dbe29e7db5efad65f58f7 100644 (file)
@@ -20,6 +20,7 @@ import java.util.Vector;
 import org.apache.xmlbeans.XmlException;\r
 import org.tianocore.DbPathAndFilename;\r
 import org.tianocore.FrameworkDatabaseDocument;\r
+import org.tianocore.IndustryStdIncludesDocument.IndustryStdIncludes;\r
 import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;\r
 import org.tianocore.MsaFilesDocument.MsaFiles;\r
 import org.tianocore.MsaHeaderDocument.MsaHeader;\r
@@ -96,6 +97,34 @@ public class WorkspaceTools {
         }\r
         return modulePath;\r
     }\r
+    \r
+    /**\r
+    Get all Industry Std Includes' paths from one package\r
+    \r
+    @return a Vector with all paths\r
+    \r
+    **/\r
+   public Vector<String> getAllIndustryStdIncludesOfPackage(String path) {\r
+       Vector<String> includePath = new Vector<String>();\r
+       try {\r
+           IndustryStdIncludes files = OpenFile.openSpdFile(path).getIndustryStdIncludes();\r
+           if (files != null) {\r
+               for (int index = 0; index < files.getIndustryStdHeaderList().size(); index++) {\r
+                   String temp = files.getIndustryStdHeaderList().get(index).getName();\r
+                   temp = Tools.addFileSeparator(Tools.getFilePathOnly(path)) + temp;\r
+                   temp = Tools.convertPathToCurrentOsType(temp);\r
+                   includePath.addElement(temp);\r
+               }\r
+           }\r
+       } catch (IOException e) {\r
+           e.printStackTrace();\r
+       } catch (XmlException e) {\r
+           e.printStackTrace();\r
+       } catch (Exception e) {\r
+           e.printStackTrace();\r
+       }\r
+       return includePath;\r
+   }\r
 \r
     /**\r
      Get all package basic information form the FrameworkDatabase.db file\r
@@ -583,7 +612,7 @@ public class WorkspaceTools {
      @throws Exception\r
      \r
      **/\r
-    public Vector<String> getAllModuleFiles(String path) throws IOException, XmlException, Exception {\r
+    public Vector<String> getAllModuleFilesPath(String path) throws IOException, XmlException, Exception {\r
         Vector<String> v = new Vector<String>();\r
         path = Tools.convertPathToCurrentOsType(path);\r
         v.addElement(path);\r
@@ -615,7 +644,7 @@ public class WorkspaceTools {
      @throws Exception\r
      \r
      **/\r
-    public Vector<String> getAllPakcageFiles(String path) throws IOException, XmlException, Exception {\r
+    public Vector<String> getAllPakcageFilesPath(String path) throws IOException, XmlException, Exception {\r
         Vector<String> v = new Vector<String>();\r
         path = Tools.convertPathToCurrentOsType(path);\r
         //\r
@@ -624,17 +653,25 @@ public class WorkspaceTools {
         v.addElement(path);\r
         \r
         //\r
-        // Add module's files one by one\r
+        // Add the package's industry std includes one by one\r
         //\r
         Vector<String> f1 = new Vector<String>();\r
+        f1 = getAllIndustryStdIncludesOfPackage(path);\r
+        for (int index = 0; index < f1.size(); index++) {\r
+            v.addElement(f1.get(index));\r
+        }\r
+        \r
+        //\r
+        // Add module's files one by one\r
+        //\r
+        f1 = new Vector<String>();\r
         f1 = getAllModulesOfPackage(path);\r
         for (int indexI = 0; indexI < f1.size(); indexI++) {\r
-            Vector<String> f2 = getAllModuleFiles(f1.get(indexI));\r
+            Vector<String> f2 = getAllModuleFilesPath(f1.get(indexI));\r
             for (int indexJ = 0; indexJ < f2.size(); indexJ++) {\r
                 v.addElement(f2.get(indexJ));\r
             }\r
         }\r
-        //v.add(0, path);\r
 \r
         return v;\r
     }\r