import org.tianocore.PackageNameDocument;\r
import org.tianocore.ProtocolsDocument;\r
import org.tianocore.PcdCodedDocument.PcdCoded;\r
+import org.tianocore.MsaHeaderDocument;\r
+import org.tianocore.MsaHeaderDocument.MsaHeader;\r
\r
/**\r
SurfaceAreaQuery class is used to query Surface Area information from msa, mbd,\r
};\r
} else {\r
xPath = new String[] {\r
- "/Filename[not(@ArchType) or @ArchType='ALL' or @ArchType='" + arch + "']",\r
+ "/Filename[not(@SupArchList) and not(@ArchType) or @SupArchList='ALL' or @SupArchList='" + arch + "' or @ArchType='ALL' or @ArchType='" + arch + "']",\r
+ "/Filename[not(@SupArchList) and not(@ArchType) or @ArchType='ALL' or @ArchType='" + arch + "']",\r
"/Arch[@ArchType='ALL' or @ArchType='" + arch + "']/Filename"\r
};\r
}\r
} else {\r
xPath = new String[] {\r
"/Option",\r
+ "/Option[@SupArchList='ALL' or @SupArchList='" + arch + "']",\r
"/Arch[@ArchType='ALL' or @ArchType='" + arch + "']/Option"\r
};\r
}\r
return result;\r
}\r
\r
+ public static String getModuleName() {\r
+ String[] xPath = new String[] { "/ModuleName", "/BaseName" };\r
+\r
+ XmlObject[] returns = get(xPath);\r
+ if (returns != null && returns.length > 0) {\r
+ return returns[0].toString();\r
+ }\r
+\r
+ return null;\r
+ }\r
+\r
/**\r
Retrieve <xxxHeader>/ModuleType\r
\r
} else {\r
xPath = new String[] {\r
"/PackageName",\r
+ "/PackageName[@SupArchList='ALL' or @SupArchList='" + arch + "']",\r
+ "/PackageName[@Arch='ALL' or @Arch='" + arch + "']",\r
"/Arch[@ArchType='ALL' or @ArchType='" + arch + "']/PackageName"\r
};\r
}\r
\r
XmlObject[] returns = get("Includes", xPath);\r
if (returns == null || returns.length == 0) {\r
- return null;\r
+ returns = get("PackageDependencies", xPath);\r
+ if (returns == null || returns.length == 0) {\r
+ return null;\r
+ }\r
}\r
\r
List<String> packageNames = new ArrayList<String>();\r
@returns null if nothing is there\r
**/\r
public static String getModuleGuid() {\r
- String[] xPath = new String[] { "/Guid" };\r
+ String[] xPath = new String[] { "" };\r
\r
- XmlObject[] returns = get(xPath);\r
+ XmlObject[] returns = get("MsaHeader", xPath);\r
if (returns != null && returns.length > 0) {\r
- GuidDocument.Guid guid = (GuidDocument.Guid) returns[0];\r
- return guid.getStringValue();\r
+ MsaHeaderDocument.MsaHeader moduleHeader = (MsaHeaderDocument.MsaHeader) returns[0];\r
+ if (moduleHeader.isSetGuid()) {\r
+ return moduleHeader.getGuid().getStringValue();\r
+ } else if (moduleHeader.isSetGuidValue()) {\r
+ return moduleHeader.getGuidValue();\r
+ }\r
+ }\r
+\r
+ return null;\r
+ }\r
+\r
+ /**\r
+ Retrieve module Guid string\r
+ \r
+ @returns GUILD string if elements are found at the known xpath\r
+ @returns null if nothing is there\r
+ **/\r
+ public static String getModuleGuidValue() {\r
+ String[] xPath = new String[] { "" };\r
+\r
+ XmlObject[] returns = get("MsaHeader", xPath);\r
+ if (returns != null && returns.length > 0) { \r
+ MsaHeaderDocument.MsaHeader moduleHeader = (MsaHeaderDocument.MsaHeader) returns[0];\r
+ return moduleHeader.getGuidValue();\r
}\r
\r
return null;\r
}\r
\r
xPath = new String[] {\r
- "/Library" + usageAttribute,\r
+ "/Library" + archAttribute, //usageAttribute,\r
+ "/Library[not(@SupArchList) or @SupArchList='" + arch + "']",\r
"/Arch" + archAttribute + "/Library" + usageAttribute\r
};\r
\r
\r
XmlObject[] result = get("FrameworkPlatformDescription", xPath);\r
if (result == null) {\r
+ xPath = new String[] { "/FrameworkModules/*/ModuleSA" };\r
+ result = get("FrameworkPlatformDescription", xPath);\r
+ if (result != null) {\r
+ return (ModuleSADocument.ModuleSA[]) result;\r
+ }\r
return new ModuleSADocument.ModuleSA[0];\r
}\r
\r