enhance ModuleInfo.java

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1642 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
alfred
2006-09-29 07:32:35 +00:00
parent b88170614f
commit 323e2ffc21
5 changed files with 44 additions and 18 deletions

View File

@@ -48,11 +48,11 @@ public class Guid {
if (MigrationTool.db.hasGuid(temp)) { // only changed guids registered, because both changed and not changed guids are included in database if (MigrationTool.db.hasGuid(temp)) { // only changed guids registered, because both changed and not changed guids are included in database
type = MigrationTool.db.getGuidType(temp); type = MigrationTool.db.getGuidType(temp);
if (type.matches("Protocol")) { if (type.matches("Protocol")) {
mi.protocol.add(temp); mi.protocols.add(temp);
} else if (type.matches("Ppi")) { } else if (type.matches("Ppi")) {
mi.ppi.add(temp); mi.ppis.add(temp);
} else if (type.matches("Guid")) { } else if (type.matches("Guid")) {
mi.guid.add(temp); mi.guids.add(temp);
} }
return temp; return temp;
} }

View File

@@ -39,9 +39,9 @@ public class MigrationTool {
if (MigrationTool.printModuleInfo) { if (MigrationTool.printModuleInfo) {
MigrationTool.ui.println("\nModule Information : "); MigrationTool.ui.println("\nModule Information : ");
MigrationTool.ui.println("Entrypoint : " + mi.entrypoint); MigrationTool.ui.println("Entrypoint : " + mi.entrypoint);
show(mi.protocol, "Protocol : "); show(mi.protocols, "Protocol : ");
show(mi.ppi, "Ppi : "); show(mi.ppis, "Ppi : ");
show(mi.guid, "Guid : "); show(mi.guids, "Guid : ");
show(mi.hashfuncc, "call : "); show(mi.hashfuncc, "call : ");
show(mi.hashfuncd, "def : "); show(mi.hashfuncd, "def : ");
show(mi.hashEFIcall, "EFIcall : "); show(mi.hashEFIcall, "EFIcall : ");

View File

@@ -15,6 +15,8 @@ package org.tianocore.migration;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
import org.tianocore.UsageTypes;
/* /*
Class ModuleInfo is built for scanning the source files, it contains all the needed Class ModuleInfo is built for scanning the source files, it contains all the needed
information and all the temporary data. information and all the temporary data.
@@ -50,10 +52,34 @@ public final class ModuleInfo {
public final Set<String> hashmacro = new HashSet<String>(); public final Set<String> hashmacro = new HashSet<String>();
public final Set<String> hashrequiredr9libs = new HashSet<String>(); // hashrequiredr9libs is now all added in SourceFileReplacer public final Set<String> hashrequiredr9libs = new HashSet<String>(); // hashrequiredr9libs is now all added in SourceFileReplacer
public final Set<String> guid = new HashSet<String>(); public final Set<String> guids = new HashSet<String>();
public final Set<String> protocol = new HashSet<String>(); public final Set<String> protocols = new HashSet<String>();
public final Set<String> ppi = new HashSet<String>(); public final Set<String> ppis = new HashSet<String>();
//-----------------------------------------------------------------------------------//
public final boolean addProtocol (String proname, UsageTypes.Enum usage) {
protocols.add(proname);
return msaowner.addProtocol(proname, usage);
}
public final boolean addPpi (String ppiname, UsageTypes.Enum usage) {
ppis.add(ppiname);
return msaowner.addPpi(ppiname, usage);
}
public final boolean addGuid (String guidname, UsageTypes.Enum usage) {
guids.add(guidname);
return msaowner.addGuid(guidname, usage);
}
public final boolean addLibraryClass(String name, UsageTypes.Enum usage) {
hashrequiredr9libs.add(name);
return msaowner.addLibraryClass(name, usage);
}
//-----------------------------------------------------------------------------------//
public final String getModuleType() { public final String getModuleType() {
if (moduletype.contains("PEI")) { if (moduletype.contains("PEI")) {
return "PEIM"; return "PEIM";

View File

@@ -132,9 +132,9 @@ public class MsaWriter {
while (it.hasNext()) { while (it.hasNext()) {
addSourceFiles(it.next()); addSourceFiles(it.next());
} }
if (!mi.protocol.isEmpty()) { if (!mi.protocols.isEmpty()) {
protocols = msa.addNewProtocols(); protocols = msa.addNewProtocols();
it = mi.protocol.iterator(); it = mi.protocols.iterator();
while (it.hasNext()) { while (it.hasNext()) {
if ((temp = it.next()) != null) { if ((temp = it.next()) != null) {
ProtocolsDocument.Protocols.Protocol pr = protocols.addNewProtocol(); ProtocolsDocument.Protocols.Protocol pr = protocols.addNewProtocol();
@@ -143,9 +143,9 @@ public class MsaWriter {
} }
} }
} }
if (!mi.ppi.isEmpty()) { if (!mi.ppis.isEmpty()) {
ppis = msa.addNewPPIs(); ppis = msa.addNewPPIs();
it = mi.ppi.iterator(); it = mi.ppis.iterator();
while (it.hasNext()) { while (it.hasNext()) {
if ((temp = it.next()) != null) { if ((temp = it.next()) != null) {
PPIsDocument.PPIs.Ppi pp = ppis.addNewPpi(); PPIsDocument.PPIs.Ppi pp = ppis.addNewPpi();
@@ -154,9 +154,9 @@ public class MsaWriter {
} }
} }
} }
if (!mi.guid.isEmpty()) { if (!mi.guids.isEmpty()) {
guids = msa.addNewGuids(); guids = msa.addNewGuids();
it = mi.guid.iterator(); it = mi.guids.iterator();
while (it.hasNext()) { while (it.hasNext()) {
if ((temp = it.next()) != null) { if ((temp = it.next()) != null) {
GuidsDocument.Guids.GuidCNames gcn = guids.addNewGuidCNames(); GuidsDocument.Guids.GuidCNames gcn = guids.addNewGuidCNames();

View File

@@ -127,9 +127,9 @@ public final class SourceFileReplacer implements Common.ForDoAll {
wholeline = replaceMacro (wholeline, mi.hashnonlocalmacro); wholeline = replaceMacro (wholeline, mi.hashnonlocalmacro);
// Converting guid // Converting guid
replaceGuid(wholeline, mi.guid, "guid", fileguid); replaceGuid(wholeline, mi.guids, "guid", fileguid);
replaceGuid(wholeline, mi.ppi, "ppi", fileppi); replaceGuid(wholeline, mi.ppis, "ppi", fileppi);
replaceGuid(wholeline, mi.protocol, "protocol", fileprotocol); replaceGuid(wholeline, mi.protocols, "protocol", fileprotocol);
// Converting Pei // Converting Pei
if (mi.getModuleType().matches("PEIM")) { if (mi.getModuleType().matches("PEIM")) {