import org.tianocore.SkuInfoDocument;\r
import org.tianocore.UserDefinedAntTasksDocument;\r
import org.tianocore.UserExtensionsDocument;\r
+import org.tianocore.LibrariesDocument.Libraries.Instance;\r
import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;\r
import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery;\r
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
cursor.dispose();\r
}\r
\r
- public boolean adjustPcd (int seqModuleSa, Vector<String> vExceptions) throws Exception {\r
+ public boolean adjustPcd (String seqModuleSa, Vector<String> vExceptions) throws Exception {\r
boolean dataModified = false;\r
ModuleSADocument.ModuleSA moduleSa = getModuleSA(seqModuleSa);\r
int pcdCount = getPcdDataCount(seqModuleSa);\r
//\r
// key for ModuleSA : "ModuleGuid ModuleVer PackageGuid PackageVer Arch"\r
//\r
- public int getPcdDataCount (int i){\r
- ModuleSADocument.ModuleSA msa = getModuleSA(i);\r
+ public int getPcdDataCount (String key){\r
+ ModuleSADocument.ModuleSA msa = getModuleSA(key);\r
\r
if (msa == null || msa.getPcdBuildDefinition() == null || msa.getPcdBuildDefinition().getPcdDataList() == null){\r
return 0;\r
\r
}\r
\r
- public void getPcdData (int i, String[][] saa) {\r
- ModuleSADocument.ModuleSA msa = getModuleSA(i);\r
+ public void getPcdData (String key, String[][] saa) {\r
+ ModuleSADocument.ModuleSA msa = getModuleSA(key);\r
\r
if (msa == null || msa.getPcdBuildDefinition() == null || msa.getPcdBuildDefinition().getPcdDataList() == null){\r
return;\r
}\r
}\r
\r
- public void removePcdData (int seqModuleSa, String cName, String tsGuid) {\r
- ModuleSADocument.ModuleSA moduleSa = getModuleSA(seqModuleSa);\r
+ public void removePcdData (String key, String cName, String tsGuid) {\r
+ ModuleSADocument.ModuleSA moduleSa = getModuleSA(key);\r
if (moduleSa == null || moduleSa.getPcdBuildDefinition() == null){\r
return;\r
}\r
PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData pcdData = (PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData)cursor.getObject();\r
if (pcdData.getCName().equals(cName) && pcdData.getTokenSpaceGuidCName().equals(tsGuid)) {\r
maintainDynPcdMap(cName + " " + tsGuid, moduleKey);\r
- if (getPcdDataCount(seqModuleSa) == 1) {\r
+ if (getPcdDataCount(key) == 1) {\r
cursor.toParent();\r
}\r
cursor.removeXml();\r
return false;\r
}\r
\r
- public void removeLibraryInstance(String key, int i) {\r
+ public void removeLibraryInstance(String key, String instanceKey) {\r
ModuleSADocument.ModuleSA msa = getModuleSA(key);\r
if (msa == null || msa.getLibraries() == null){\r
return ;\r
}\r
\r
+ String[] instanceInfo = instanceKey.split(" ");\r
XmlCursor cursor = msa.getLibraries().newCursor();\r
if (cursor.toFirstChild()) {\r
- for (int j = 0; j < i; ++j) {\r
- cursor.toNextSibling();\r
+ do {\r
+ Instance libIns = (Instance)cursor.getObject();\r
+ if (libIns.getModuleGuid().equalsIgnoreCase(instanceInfo[0]) && libIns.getPackageGuid().equalsIgnoreCase(instanceInfo[2])) {\r
+ break;\r
}\r
+ }while (cursor.toNextSibling());\r
cursor.push();\r
while (cursor.hasPrevToken()) {\r
cursor.toPrevToken();\r