]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java
new temp schema
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / MigrationTool.java
index e159c5e4ea4b7edd5fcd4f309d6d4828d8033cda..004950f96b5fa2437a26dbe833bbbc506596fb71 100644 (file)
@@ -21,7 +21,7 @@ public class MigrationTool {
     public static UI ui = null;\r
     public static Database db = null;\r
 \r
-    public static String MIGRATIONCOMMENT = "//%@//";\r
+    public static String MIGRATIONCOMMENT = "//@MT:";\r
 \r
     public static boolean printModuleInfo = false;\r
     public static boolean doCritic = false;\r
@@ -29,9 +29,11 @@ public class MigrationTool {
     \r
     public static final HashMap<ModuleInfo, String> ModuleInfoMap = new HashMap<ModuleInfo, String>();\r
 \r
+    private static String startpath = null;\r
+    \r
     private static final void mainFlow(ModuleInfo mi) throws Exception {\r
 \r
-        ModuleReader.ModuleScan(mi);\r
+        ModuleReader.aimAt(mi);\r
         \r
         //MigrationTool.ui.yesOrNo("go on replace?");\r
         SourceFileReplacer.fireAt(mi);    // some adding library actions are taken here,so it must be put before "MsaWriter"\r
@@ -60,9 +62,6 @@ public class MigrationTool {
             Critic.fireAt(ModuleInfoMap.get(mi) + File.separator + "Migration_" + mi.modulename);\r
         }\r
 \r
-        //MigrationTool.ui.yesOrNo("go on delete?");\r
-        Common.deleteDir(mi.modulepath + File.separator + "temp");\r
-\r
         MigrationTool.ui.println("Errors Left : " + MigrationTool.db.error);\r
         MigrationTool.ui.println("Complete!");\r
         //MigrationTool.ui.println("Your R9 module was placed here: " + mi.modulepath + File.separator + "result");\r
@@ -74,9 +73,13 @@ public class MigrationTool {
         MigrationTool.ui.println(hash);\r
     }\r
 \r
+    public static final String getTempDir(String modulepath) {\r
+       return "C:" + File.separator + "MigrationTool_Temp" + modulepath.replace(startpath, "");\r
+    }\r
+\r
     private static final String assignOutPutPath(String inputpath) {\r
         if (MigrationTool.defaultoutput) {\r
-            return inputpath.replaceAll(Common.strseparate, "$1");\r
+            return inputpath.replaceAll(Common.STRSEPARATER, "$1");\r
         } else {\r
             return MigrationTool.ui.getFilepath("Please choose where to place the output module", JFileChooser.DIRECTORIES_ONLY);\r
         }\r
@@ -89,8 +92,14 @@ public class MigrationTool {
     }\r
 \r
     public static final void startMigrateAll(String path) throws Exception {\r
+       startpath = path;\r
         MigrationTool.ui.println("Project Migration");\r
         MigrationTool.ui.println("Copyright (c) 2006, Intel Corporation");\r
+        \r
+        if (new File("C:" + File.separator + "MigrationTool_Temp").exists()) {\r
+            Common.deleteDir("C:" + File.separator + "MigrationTool_Temp");\r
+        }\r
+        \r
         Common.toDoAll(path, MigrationTool.class.getMethod("seekModule", String.class), null, null, Common.DIR);\r
         \r
         Iterator<ModuleInfo> miit = ModuleInfoMap.keySet().iterator();\r
@@ -99,6 +108,8 @@ public class MigrationTool {
         }\r
         \r
         ModuleInfoMap.clear();\r
+        \r
+        Common.deleteDir("C:" + File.separator + "MigrationTool_Temp");\r
     }\r
 \r
     public static void main(String[] args) throws Exception {\r