]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
Use unified global data to get module informations.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdFileContents.java
index a11a63598e606fe55739cf96a4f496afa7d74248..73ee69e9a83f498ce0dd135f37c1bfa66266edc2 100644 (file)
@@ -60,8 +60,8 @@ import org.tianocore.UserDefinedAntTasksDocument;
 import org.tianocore.UserExtensionsDocument;\r
 import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;\r
 import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery;\r
-import org.tianocore.frameworkwizard.platform.ui.id.ModuleIdentification;\r
-import org.tianocore.frameworkwizard.platform.ui.id.PackageIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
 \r
 /**\r
  This class processes fpd file contents such as add remove xml elements. \r
@@ -702,14 +702,14 @@ public class FpdFileContents {
         String mn = libMi.getName();\r
         String mg = libMi.getGuid();\r
         String mv = libMi.getVersion();\r
-        String pn = libMi.getPackage().getName();\r
-        String pg = libMi.getPackage().getGuid();\r
-        String pv = libMi.getPackage().getVersion();\r
+        String pn = libMi.getPackageId().getName();\r
+        String pg = libMi.getPackageId().getGuid();\r
+        String pv = libMi.getPackageId().getVersion();\r
         LibrariesDocument.Libraries.Instance instance = libs.addNewInstance();\r
         XmlCursor cursor = instance.newCursor();\r
         try{\r
             String comment = "Pkg: " + pn + " Mod: " + mn \r
-                + " Path: " + WorkspaceProfile.getMsaFile(libMi).getPath().substring(System.getenv("WORKSPACE").length() + 1);\r
+                + " Path: " + libMi.getPath().substring(System.getenv("WORKSPACE").length() + 1);\r
             cursor.insertComment(comment);\r
         }\r
         catch (Exception e){\r
@@ -797,6 +797,19 @@ public class FpdFileContents {
         msa.getModuleSaBuildOptions().setFfsFormatKey(ffsKey);\r
     }\r
     \r
+    public void setModuleSAForceDebug(int i, boolean dbgEnable) {\r
+        ModuleSADocument.ModuleSA moduleSa = getModuleSA(i);\r
+        moduleSa.setForceDebug(dbgEnable);\r
+    }\r
+    \r
+    public boolean getModuleSAForceDebug (int i) {\r
+        ModuleSADocument.ModuleSA moduleSa = getModuleSA(i);\r
+        if (moduleSa.getForceDebug() == true) {\r
+            return true;\r
+        }\r
+        return false;\r
+    }\r
+    \r
     public void getModuleSAOptions(String moduleKey, String[][] saa) {\r
         ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);\r
         if (msa == null || msa.getModuleSaBuildOptions() == null || msa.getModuleSaBuildOptions().getOptions() == null\r
@@ -934,12 +947,10 @@ public class FpdFileContents {
     \r
     private PcdDeclarationsDocument.PcdDeclarations.PcdEntry LookupPcdDeclaration (PcdCodedDocument.PcdCoded.PcdEntry msaPcd, PackageIdentification[] depPkgs) {\r
         \r
-        Map<String, XmlObject> m = new HashMap<String, XmlObject>();\r
         PcdDeclarationsDocument.PcdDeclarations.PcdEntry spdPcd = null;\r
         for (int i = 0; i < depPkgs.length; ++i) {\r
-            m.put("PackageSurfaceArea", WorkspaceProfile.getPackageXmlObject(depPkgs[i]));\r
-            SurfaceAreaQuery.setDoc(m);\r
-            XmlObject[] xo = SurfaceAreaQuery.getSpdPcdDeclarations();\r
+\r
+            XmlObject[] xo = SurfaceAreaQuery.getSpdPcdDeclarations(depPkgs[i]);\r
             if (xo == null) {\r
                 continue;\r
             }\r
@@ -967,8 +978,8 @@ public class FpdFileContents {
         ModuleSADocument.ModuleSA msa = getfpdFrameworkModules().addNewModuleSA();\r
         XmlCursor cursor = msa.newCursor();\r
         try{\r
-            String comment = "Mod: " + mi.getName() + " Type: " + mi.getModuleType() + " Path: "\r
-                            + WorkspaceProfile.getMsaFile(mi).getPath().substring(System.getenv("WORKSPACE").length() + 1);\r
+            String comment = "Mod: " + mi.getName() + " Type: " + SurfaceAreaQuery.getModuleType(mi) + " Path: "\r
+                            + mi.getPath().substring(System.getenv("WORKSPACE").length() + 1);\r
             cursor.insertComment(comment);\r
         }\r
         catch(Exception e){\r
@@ -1132,7 +1143,7 @@ public class FpdFileContents {
                 \r
                 if (value > 0xFF) {\r
 //                   "[FPD file error] The datum type of PCD %s in %s is VOID*, "+\r
-//                   "it is byte array in fact. But the element of %s exceed the byte range",\r
+//                   "it must be a byte array. But the element of %s exceed the byte range",\r
                     throw new PcdValueMalFormed (datum);                               \r
                 }\r
             }\r
@@ -2680,7 +2691,7 @@ class PcdItemTypeConflictException extends Exception {
     \r
     PcdItemTypeConflictException(String pcdName, String info){\r
         ModuleIdentification mi = WorkspaceProfile.getModuleId(info);\r
-        details = pcdName + " ItemType Conflicts with " + mi.getName() + " in Pkg " + mi.getPackage().getName();\r
+        details = pcdName + " ItemType Conflicts with " + mi.getName() + " in Pkg " + mi.getPackageId().getName();\r
     }\r
     \r
     public String getMessage() {\r