import org.tianocore.IndustryStdIncludesDocument.IndustryStdIncludes;\r
import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;\r
import org.tianocore.MsaFilesDocument.MsaFiles;\r
+import org.tianocore.PackageDependenciesDocument.PackageDependencies;\r
import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;\r
+import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;\r
import org.tianocore.SourceFilesDocument.SourceFiles;\r
import org.tianocore.frameworkwizard.common.DataType;\r
import org.tianocore.frameworkwizard.common.GlobalData;\r
modulePath = modulePaths.get(index);\r
ModuleIdentification id = GlobalData.openingModuleList.getIdByPath(modulePath);\r
if (id != null) {\r
- v.addElement(id); \r
+ v.addElement(id);\r
+ }\r
+ }\r
+ Sort.sortModules(v, DataType.SORT_TYPE_ASCENDING);\r
+ return v;\r
+ }\r
+\r
+ /**\r
+ Get all module basic information from a platform\r
+ \r
+ @param id Package id\r
+ @return A vector includes all modules' basic information\r
+ \r
+ **/\r
+ public Vector<ModuleIdentification> getAllModules(PlatformIdentification fid) {\r
+ Vector<ModuleIdentification> v = new Vector<ModuleIdentification>();\r
+ PlatformSurfaceArea fpd = GlobalData.openingPlatformList.getOpeningPlatformById(fid).getXmlFpd();\r
+ if (fpd.getFrameworkModules() != null) {\r
+ for (int index = 0; index < fpd.getFrameworkModules().getModuleSAList().size(); index++) {\r
+ String guid = fpd.getFrameworkModules().getModuleSAList().get(index).getModuleGuid();\r
+ String version = fpd.getFrameworkModules().getModuleSAList().get(index).getModuleVersion();\r
+ ModuleIdentification id = GlobalData.openingModuleList.getIdByGuidVersion(guid, version);\r
+ if (id != null) {\r
+ boolean isFind = false;\r
+ for (int indexOfModules = 0; indexOfModules < v.size(); indexOfModules++) {\r
+ if (v.elementAt(indexOfModules).equals(id)) {\r
+ isFind = true;\r
+ break;\r
+ }\r
+ }\r
+ if (!isFind) {\r
+ v.addElement(id);\r
+ }\r
+ }\r
}\r
}\r
Sort.sortModules(v, DataType.SORT_TYPE_ASCENDING);\r
Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
return vector;\r
}\r
+ \r
+ public Vector<String> getAllLibraryClassDefinitionsFromPackages(Vector<PackageIdentification> vpid) {\r
+ Vector<String> vector = new Vector<String>();\r
+ for (int index = 0; index < vpid.size(); index++) {\r
+ Vector<String> v = getAllLibraryClassDefinitionsFromPackage(GlobalData.openingPackageList\r
+ .getPackageSurfaceAreaFromId(vpid.get(index)));\r
+ if (v != null && v.size() > 0) {\r
+ vector.addAll(v);\r
+ }\r
+\r
+ }\r
+ Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+ return vector;\r
+ }\r
\r
public Vector<String> getAllProtocolDeclarationsFromWorkspace() {\r
Vector<String> vector = new Vector<String>();\r
return vector;\r
}\r
\r
+ public Vector<String> getAllProtocolDeclarationsFromPackages(Vector<PackageIdentification> vpid) {\r
+ Vector<String> vector = new Vector<String>();\r
+ for (int index = 0; index < vpid.size(); index++) {\r
+ Vector<String> v = getAllProtocolDeclarationsFromPackage(GlobalData.openingPackageList\r
+ .getPackageSurfaceAreaFromId(vpid\r
+ .get(index)));\r
+ if (v != null && v.size() > 0) {\r
+ vector.addAll(v);\r
+ }\r
+ }\r
+ Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+ return vector;\r
+ }\r
+\r
public Vector<String> getAllPpiDeclarationsFromWorkspace() {\r
Vector<String> vector = new Vector<String>();\r
for (int index = 0; index < GlobalData.vPackageList.size(); index++) {\r
return vector;\r
}\r
\r
+ public Vector<String> getAllPpiDeclarationsFromPackages(Vector<PackageIdentification> vpid) {\r
+ Vector<String> vector = new Vector<String>();\r
+ for (int index = 0; index < vpid.size(); index++) {\r
+ Vector<String> v = getAllPpiDeclarationsFromPackage(GlobalData.openingPackageList\r
+ .getPackageSurfaceAreaFromId(vpid\r
+ .get(index)));\r
+ if (v != null && v.size() > 0) {\r
+ vector.addAll(v);\r
+ }\r
+ }\r
+ Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+ return vector;\r
+ }\r
+\r
public Vector<String> getAllGuidDeclarationsFromWorkspace() {\r
Vector<String> vector = new Vector<String>();\r
for (int index = 0; index < GlobalData.vPackageList.size(); index++) {\r
return vector;\r
}\r
\r
+ public Vector<String> getAllGuidDeclarationsFromPackages(Vector<PackageIdentification> vpid) {\r
+ Vector<String> vector = new Vector<String>();\r
+ for (int index = 0; index < vpid.size(); index++) {\r
+ Vector<String> v = getAllGuidDeclarationsFromPackage(GlobalData.openingPackageList\r
+ .getPackageSurfaceAreaFromId(vpid\r
+ .get(index)));\r
+ if (v != null && v.size() > 0) {\r
+ vector.addAll(v);\r
+ }\r
+\r
+ }\r
+ Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+ return vector;\r
+ }\r
+\r
public PcdVector getAllPcdDeclarationsFromWorkspace() {\r
PcdVector vector = new PcdVector();\r
for (int index = 0; index < GlobalData.openingPackageList.size(); index++) {\r
return vector;\r
}\r
\r
+ public PcdVector getAllPcdDeclarationsFromPackages(Vector<PackageIdentification> vpid) {\r
+ PcdVector vector = new PcdVector();\r
+ for (int index = 0; index < vpid.size(); index++) {\r
+ PcdVector v = getAllPcdDeclarationsFromPackage(GlobalData.openingPackageList\r
+ .getPackageSurfaceAreaFromId(vpid\r
+ .get(index)));\r
+ if (v != null && v.size() > 0) {\r
+ vector.addAll(v);\r
+ }\r
+\r
+ }\r
+ Sort.sortPcds(vector, DataType.SORT_TYPE_ASCENDING);\r
+ return vector;\r
+ }\r
+\r
/**\r
Find a module's package's id\r
\r
\r
return v;\r
}\r
+\r
+ /**\r
+ Get a module's all package dependencies\r
+ \r
+ @param mid The module id\r
+ @return A vector of all package dependency ids\r
+ \r
+ **/\r
+ public Vector<PackageIdentification> getPackageDependenciesOfModule(ModuleIdentification mid) {\r
+ Vector<PackageIdentification> vpid = new Vector<PackageIdentification>();\r
+ ModuleSurfaceArea msa = GlobalData.openingModuleList.getModuleSurfaceAreaFromId(mid);\r
+ if (msa != null) {\r
+ PackageDependencies pd = msa.getPackageDependencies();\r
+ if (pd != null) {\r
+ for (int index = 0; index < pd.getPackageList().size(); index++) {\r
+ String guid = pd.getPackageList().get(index).getPackageGuid();\r
+ String version = pd.getPackageList().get(index).getPackageVersion();\r
+ PackageIdentification pid = GlobalData.openingPackageList.getIdByGuidVersion(guid, version);\r
+ if (pid != null) {\r
+ vpid.addElement(pid);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return vpid;\r
+ }\r
}\r