MsaOwner.java & ModuleInfo.java
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1644 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -17,6 +17,8 @@ import java.util.*;
|
||||
|
||||
import javax.swing.JFileChooser;
|
||||
|
||||
import org.tianocore.UsageTypes;
|
||||
|
||||
public class MigrationTool {
|
||||
public static UI ui = null;
|
||||
public static Database db = null;
|
||||
@@ -51,6 +53,13 @@ public class MigrationTool {
|
||||
}
|
||||
|
||||
new MsaWriter(mi).flush();
|
||||
/*
|
||||
mi.addGuid("guid", UsageTypes.ALWAYS_CONSUMED);
|
||||
mi.addLibraryClass("class", UsageTypes.ALWAYS_CONSUMED);
|
||||
mi.addPpi("ppi", UsageTypes.ALWAYS_CONSUMED);
|
||||
mi.addProtocol("protocol", UsageTypes.ALWAYS_CONSUMED);
|
||||
*/
|
||||
mi.getMsaOwner().flush(MigrationTool.ModuleInfoMap.get(mi) + File.separator + "Migration_" + mi.modulename + File.separator + mi.modulename + ".___");
|
||||
|
||||
if (MigrationTool.doCritic) {
|
||||
Critic.fireAt(ModuleInfoMap.get(mi) + File.separator + "Migration_" + mi.modulename);
|
||||
|
@@ -30,7 +30,7 @@ public final class ModuleInfo {
|
||||
public final String modulepath;
|
||||
public final String temppath;
|
||||
|
||||
private MsaOwner msaowner = new MsaOwner();
|
||||
private MsaOwner msaowner = MsaOwner.initNewMsaOwner();
|
||||
|
||||
public String modulename = null;
|
||||
public String guidvalue = null;
|
||||
@@ -59,22 +59,23 @@ public final class ModuleInfo {
|
||||
//-----------------------------------------------------------------------------------//
|
||||
|
||||
public final boolean addProtocol (String proname, UsageTypes.Enum usage) {
|
||||
protocols.add(proname);
|
||||
//protocols.add(proname);
|
||||
System.out.println("I'm in");
|
||||
return msaowner.addProtocol(proname, usage);
|
||||
}
|
||||
|
||||
public final boolean addPpi (String ppiname, UsageTypes.Enum usage) {
|
||||
ppis.add(ppiname);
|
||||
//ppis.add(ppiname);
|
||||
return msaowner.addPpi(ppiname, usage);
|
||||
}
|
||||
|
||||
public final boolean addGuid (String guidname, UsageTypes.Enum usage) {
|
||||
guids.add(guidname);
|
||||
//guids.add(guidname);
|
||||
return msaowner.addGuid(guidname, usage);
|
||||
}
|
||||
|
||||
public final boolean addLibraryClass(String name, UsageTypes.Enum usage) {
|
||||
hashrequiredr9libs.add(name);
|
||||
//hashrequiredr9libs.add(name);
|
||||
return msaowner.addLibraryClass(name, usage);
|
||||
}
|
||||
|
||||
@@ -112,4 +113,8 @@ public final class ModuleInfo {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final MsaOwner getMsaOwner() {
|
||||
return msaowner;
|
||||
}
|
||||
}
|
@@ -1,7 +1,10 @@
|
||||
package org.tianocore.migration;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.FileWriter;
|
||||
import java.util.*;
|
||||
|
||||
import org.apache.xmlbeans.XmlOptions;
|
||||
import org.tianocore.*;
|
||||
import org.tianocore.SupportedArchitectures.Enum;
|
||||
|
||||
@@ -362,8 +365,18 @@ public class MsaOwner {
|
||||
}
|
||||
//-----------------------------msaheader-------------------------------------//
|
||||
|
||||
public final void addSourceFiles (String filename, int arch) {
|
||||
public final void flush(String outputpath) throws Exception {
|
||||
XmlOptions options = new XmlOptions();
|
||||
|
||||
options.setCharacterEncoding("UTF-8");
|
||||
options.setSavePrettyPrint();
|
||||
options.setSavePrettyPrintIndent(2);
|
||||
options.setUseDefaultNamespace();
|
||||
|
||||
BufferedWriter bw = new BufferedWriter(new FileWriter(outputpath));
|
||||
msadoc.save(bw, options);
|
||||
bw.flush();
|
||||
bw.close();
|
||||
}
|
||||
|
||||
private final MsaOwner init () {
|
||||
|
Reference in New Issue
Block a user