]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
remodel 1
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / ModuleInfo.java
index 2f3af0309e9c16b8fda479de182c0eab1d5bfec2..5502cbb00c573b475b251496072e1dbbdf7bbb5b 100644 (file)
@@ -24,16 +24,16 @@ public class ModuleInfo {
        ModuleInfo(String modulepath) throws Exception {\r
                this.modulepath = modulepath;\r
                \r
-               ui.println("Choose where to place the result");\r
-               if ((outputpath = ui.getFilepath()) == null) {\r
+               MigrationTool.ui.println("Choose where to place the result");\r
+               if ((outputpath = MigrationTool.ui.getFilepath()) == null) {\r
                        outputpath = modulepath; \r
                }\r
-               ui.println(outputpath);\r
+               MigrationTool.ui.println(outputpath);\r
                \r
                moduleScan();\r
        }\r
 \r
-       public static UI ui = null;                             //if MIM is still usefull, this can be given to it\r
+       //public static UI ui = null;                           //if MIM is still usefull, this can be given to it\r
        public static Database db = null;                       //if MIM is still usefull, this can be given to it\r
        \r
        public String modulepath = null;\r
@@ -68,10 +68,10 @@ public class ModuleInfo {
                \r
                String filename = null;\r
                if (msaorinf.isEmpty()) {\r
-                       ui.println("No INF nor MSA file found!");\r
+                       MigrationTool.ui.println("No INF nor MSA file found!");\r
                        System.exit(0);\r
                } else {\r
-                       filename = ui.choose("Found .inf or .msa file for module\n" + modulepath + "\nChoose one Please", msaorinf.toArray());\r
+                       filename = MigrationTool.ui.choose("Found .inf or .msa file for module\n" + modulepath + "\nChoose one Please", msaorinf.toArray());\r
                }\r
                //ModuleReader mr = new ModuleReader(modulepath, this, db, ui);\r
                if (filename.contains(".inf")) {\r
@@ -83,12 +83,12 @@ public class ModuleInfo {
                CommentOutNonLocalHFile();\r
                parsePreProcessedSourceCode();\r
 \r
-               new SourceFileReplacer(modulepath, outputpath, this, db, ui).flush();   // some adding library actions are taken here,so it must be put before "MsaWriter"\r
+               new SourceFileReplacer(modulepath, outputpath, this).flush();   // some adding library actions are taken here,so it must be put before "MsaWriter"\r
                \r
                // show result\r
-               if (ui.yesOrNo("Parse of the Module Information has completed. View details?")) {\r
-                       ui.println("\nModule Information : ");\r
-                       ui.println("Entrypoint : " + entrypoint);\r
+               if (MigrationTool.ui.yesOrNo("Parse of the Module Information has completed. View details?")) {\r
+                       MigrationTool.ui.println("\nModule Information : ");\r
+                       MigrationTool.ui.println("Entrypoint : " + entrypoint);\r
                        show(protocol, "Protocol : ");\r
                        show(ppi, "Ppi : ");\r
                        show(guid, "Guid : ");\r
@@ -100,20 +100,20 @@ public class ModuleInfo {
                        show(hashr8only, "hashr8only : ");\r
                }\r
                \r
-               new MsaWriter(modulepath, outputpath, this, db, ui).flush();\r
+               new MsaWriter(modulepath, outputpath, this).flush();\r
 \r
                Common.deleteDir(modulepath + File.separator + "temp");\r
                //Common.toDoAll(modulepath + File.separator + "temp", Common.class.getMethod("deleteDir", String.class), null, null, Common.DIR);\r
                \r
-               ui.println("Errors Left : " + db.error);\r
-               ui.println("Complete!");\r
-               ui.println("Your R9 module was placed here: " + modulepath + File.separator + "result");\r
-               ui.println("Your logfile was placed here: " + modulepath);\r
+               MigrationTool.ui.println("Errors Left : " + MigrationTool.db.error);\r
+               MigrationTool.ui.println("Complete!");\r
+               MigrationTool.ui.println("Your R9 module was placed here: " + modulepath + File.separator + "result");\r
+               MigrationTool.ui.println("Your logfile was placed here: " + modulepath);\r
        }\r
        \r
        private void show(Set<String> hash, String show) {\r
-               ui.println(show + hash.size());\r
-               ui.println(hash);\r
+               MigrationTool.ui.println(show + hash.size());\r
+               MigrationTool.ui.println(hash);\r
        }\r
        \r
        // add '//' to all non-local include lines\r
@@ -204,7 +204,7 @@ public class ModuleInfo {
                        matguid = Guid.ptnguid.matcher(line);                                                                           // several ways to implement this , which one is faster ? :\r
                        while (matguid.find()) {                                                                                                        // 1.currently , find once , then call to identify which is it\r
                                if ((temp = Guid.register(matguid, this, db)) != null) {                                // 2.use 3 different matchers , search 3 times to find each\r
-                                       //matguid.appendReplacement(result, db.getR9Guidname(temp));            // search the database for all 3 kinds of guids , high cost\r
+                                       //matguid.appendReplacement(result, MigrationTool.db.getR9Guidname(temp));              // search the database for all 3 kinds of guids , high cost\r
                                }\r
                        }\r
                        //matguid.appendTail(result);\r
@@ -221,8 +221,8 @@ public class ModuleInfo {
                        matfuncc = Func.ptnfuncc.matcher(line);\r
                        while (matfuncc.find()) {\r
                                if ((temp = Func.register(matfuncc, this, db)) != null) {\r
-                                       //ui.println(ifile + "  dofunc  " + temp);\r
-                                       //matfuncc.appendReplacement(result, db.getR9Func(temp));\r
+                                       //MigrationTool.ui.println(ifile + "  dofunc  " + temp);\r
+                                       //matfuncc.appendReplacement(result, MigrationTool.db.getR9Func(temp));\r
                                }\r
                        }\r
                        //matfuncc.appendTail(result);\r
@@ -268,10 +268,9 @@ public class ModuleInfo {
                        msaorinf.add(temp[temp.length - 1]);\r
                }\r
        }\r
-       \r
+\r
        public static final void seekModule(String filepath) throws Exception {\r
                if (isModule(filepath)) {\r
-                       //System.out.println("I'm in");\r
                        new ModuleInfo(filepath);\r
                }\r
        }\r
@@ -287,10 +286,10 @@ public class ModuleInfo {
                }\r
                return false;\r
        }\r
-/*\r
-       public static final void main(String[] args) throws Exception {\r
-               ui = FirstPanel.init();\r
-               db = new Database();\r
+       \r
+       public static final void triger(String path) throws Exception {\r
+               MigrationTool.ui.println("Project Migration");\r
+               MigrationTool.ui.println("Copyright (c) 2006, Intel Corporation");\r
+               Common.toDoAll(path, ModuleInfo.class.getMethod("seekModule", String.class), null, null, Common.DIR);\r
        }\r
-       */\r
 }
\ No newline at end of file