]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
add MigrationTool
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / ModuleInfo.java
index 242b5c545026e0961f83a8d23c7afae4a98c4109..3fd446433a97d835eb9c10747e6d880529e0a6ac 100644 (file)
@@ -23,14 +23,14 @@ public final class ModuleInfo {
        ModuleInfo(String modulepath) throws Exception {\r
                this.modulepath = modulepath;\r
                \r
-               if (ModuleInfo.defaultoutput) {\r
+               if (MigrationTool.defaultoutput) {\r
                        this.outputpath = this.modulepath.replaceAll(Common.strseparate, "$1");\r
                } else {\r
-                       ModuleInfo.ui.println("Choose where to place the result");\r
-                       if ((outputpath = ModuleInfo.ui.getFilepath("Please choose where to place the output module")) == null) {\r
+                       MigrationTool.ui.println("Choose where to place the result");\r
+                       if ((outputpath = MigrationTool.ui.getFilepath("Please choose where to place the output module")) == null) {\r
                                outputpath = modulepath; \r
                        }\r
-                       ModuleInfo.ui.println("Output to: " + outputpath);\r
+                       MigrationTool.ui.println("Output to: " + outputpath);\r
                }\r
        }\r
 \r
@@ -79,76 +79,4 @@ public final class ModuleInfo {
                }\r
                return false;\r
        }\r
-\r
-       //---------------------------------------------------------------------------//\r
-       \r
-       private static final void manipulate(ModuleInfo mi) throws Exception {\r
-               \r
-               ModuleReader.ModuleScan(mi);\r
-               //ModuleInfo.ui.yesOrNo("go on replace?");\r
-               SourceFileReplacer.flush(mi);   // some adding library actions are taken here,so it must be put before "MsaWriter"\r
-\r
-               //ModuleInfo.ui.yesOrNo("go on show?");\r
-               // show result\r
-               if (ModuleInfo.printModuleInfo) {\r
-                       ModuleInfo.ui.println("\nModule Information : ");\r
-                       ModuleInfo.ui.println("Entrypoint : " + mi.entrypoint);\r
-                       show(mi.protocol, "Protocol : ");\r
-                       show(mi.ppi, "Ppi : ");\r
-                       show(mi.guid, "Guid : ");\r
-                       show(mi.hashfuncc, "call : ");\r
-                       show(mi.hashfuncd, "def : ");\r
-                       show(mi.hashEFIcall, "EFIcall : ");\r
-                       show(mi.hashnonlocalmacro, "macro : ");\r
-                       show(mi.hashnonlocalfunc, "nonlocal : ");\r
-                       show(mi.hashr8only, "hashr8only : ");\r
-               }\r
-\r
-               //ModuleInfo.ui.yesOrNo("go on msawrite?");\r
-               new MsaWriter(mi).flush();\r
-               //ModuleInfo.ui.yesOrNo("go on critic?");\r
-\r
-               if (ModuleInfo.doCritic) {\r
-               Critic.fireAt(mi.outputpath + File.separator + "Migration_" + mi.modulename);\r
-               }\r
-\r
-               //ModuleInfo.ui.yesOrNo("go on delete?");\r
-               Common.deleteDir(mi.modulepath + File.separator + "temp");\r
-               \r
-               ModuleInfo.ui.println("Errors Left : " + ModuleInfo.db.error);\r
-               ModuleInfo.ui.println("Complete!");\r
-               //ModuleInfo.ui.println("Your R9 module was placed here: " + mi.modulepath + File.separator + "result");\r
-               //ModuleInfo.ui.println("Your logfile was placed here: " + mi.modulepath);\r
-       }\r
-       \r
-       private static final void show(Set<String> hash, String show) {\r
-               ModuleInfo.ui.println(show + hash.size());\r
-               ModuleInfo.ui.println(hash);\r
-       }\r
-       \r
-       public static final void seekModule(String filepath) throws Exception {\r
-               if (ModuleInfo.isModule(filepath)) {\r
-                       manipulate(new ModuleInfo(filepath));\r
-               }\r
-       }\r
-\r
-       public static final void triger(String path) throws Exception {\r
-               ModuleInfo.ui.println("Project Migration");\r
-               ModuleInfo.ui.println("Copyright (c) 2006, Intel Corporation");\r
-               Common.toDoAll(path, ModuleInfo.class.getMethod("seekModule", String.class), null, null, Common.DIR);\r
-       }\r
-       \r
-       public static UI ui = null;\r
-       public static Database db = null;\r
-       \r
-       public static final String migrationcomment = "//%$//";\r
-       \r
-       public static boolean printModuleInfo = false;\r
-       public static boolean doCritic = false;\r
-       public static boolean defaultoutput = false;\r
-       \r
-       public static void main(String[] args) throws Exception {\r
-               ui = FirstPanel.init();\r
-               db = Database.init();\r
-       }\r
 }
\ No newline at end of file