summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2006-10-14 07:01:53 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2006-10-14 07:01:53 +0000
commit9c0e70cb4a8155ffac7aff028f0760b8137cc26c (patch)
tree06a7b72ec00efd3fb4a148549e13f3c2e59f4d46
parent8c84e1b1aca1f2eac14ba331f3fec892210a70c4 (diff)
downloadedk2-platforms-9c0e70cb4a8155ffac7aff028f0760b8137cc26c.tar.xz
Add Package-Guid Map.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1745 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--Tools/Conf/Migration/PkgGuid.csv3
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/Database.java26
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaOwner.java10
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaWriter.java10
4 files changed, 43 insertions, 6 deletions
diff --git a/Tools/Conf/Migration/PkgGuid.csv b/Tools/Conf/Migration/PkgGuid.csv
new file mode 100644
index 0000000000..5ad3f90a4d
--- /dev/null
+++ b/Tools/Conf/Migration/PkgGuid.csv
@@ -0,0 +1,3 @@
+PackageName,GuidValue
+MdePkg,5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec
+EdkModulePkg,68169ab0-d41b-4009-9060-292c253ac43d
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/Database.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/Database.java
index 68ddf40b30..f14184ab61 100644
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/Database.java
+++ b/Tools/Java/Source/MigrationTools/org/tianocore/migration/Database.java
@@ -23,6 +23,7 @@ public final class Database {
DatabasePath = path;
try {
+ importPkgGuid("PkgGuid.csv");
importDBLib("Library.csv");
importDBGuid("Guid.csv", "Guid");
importDBGuid("Ppi.csv", "Ppi");
@@ -41,9 +42,32 @@ public final class Database {
private Map<String,Guid> hashguid = new HashMap<String,Guid>();
private Map<String,Func> hashfunc = new HashMap<String,Func>();
private Map<String,Macro> hashmacro = new HashMap<String,Macro>();
+ private Map<String,String> hashPkgGuid = new HashMap<String,String>();
//-------------------------------------import------------------------------------------//
-
+ private void importPkgGuid(String filename) throws Exception {
+ BufferedReader rd = new BufferedReader(new FileReader(DatabasePath + File.separator + filename));
+ String line;
+ String[] linecontext;
+ Func lf;
+
+ if (rd.ready()) {
+ System.out.println("Found " + filename + ", Importing Package Guid Database.");
+ //
+ // Skip the title row.
+ //
+ line = rd.readLine();
+ while ((line = rd.readLine()) != null) {
+ if (line.length() != 0) {
+ linecontext = line.split(",");
+ hashPkgGuid.put(linecontext[0], linecontext[1]);
+ }
+ }
+ }
+ }
+ public Iterator<String> dumpAllPkgGuid() {
+ return hashPkgGuid.values().iterator();
+ }
private void importDBLib(String filename) throws Exception {
BufferedReader rd = new BufferedReader(new FileReader(DatabasePath + File.separator + filename));
String line;
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaOwner.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaOwner.java
index 9217857fc6..5c2eaf0caf 100644
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaOwner.java
+++ b/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaOwner.java
@@ -225,8 +225,14 @@ public class MsaOwner {
}
public final boolean setupPackageDependencies() {
- addPackage("5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec");
- addPackage("68169ab0-d41b-4009-9060-292c253ac43d");
+ Iterator<String> it;
+ //
+ // For now, simply add all package guids in the database.
+ //
+ it = MigrationTool.db.dumpAllPkgGuid();
+ while (it.hasNext()) {
+ packagedependencies.addNewPackage().setPackageGuid(it.next());
+ }
return true;
}
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaWriter.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaWriter.java
index af8646f792..a8e26c573f 100644
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaWriter.java
+++ b/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaWriter.java
@@ -120,9 +120,13 @@ public class MsaWriter {
md.setSupportedArchitectures(arch);
md.setBinaryModule(false);
md.setOutputFileBasename(mi.modulename);
-
- pd.addNewPackage().setPackageGuid("5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec");
- pd.addNewPackage().setPackageGuid("68169ab0-d41b-4009-9060-292c253ac43d");
+ //
+ // For now, simply add all package guids in the database.
+ //
+ it = MigrationTool.db.dumpAllPkgGuid();
+ while (it.hasNext()) {
+ pd.addNewPackage().setPackageGuid(it.next());
+ }
externs.addNewSpecification().setStringValue("EFI_SPECIFICATION_VERSION 0x00020000");
externs.addNewSpecification().setStringValue("EDK_RELEASE_VERSION 0x00020000");
if (mi.entrypoint != null) {