remove MigrationTools.java
authoralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Aug 2006 10:45:49 +0000 (10:45 +0000)
committeralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Aug 2006 10:45:49 +0000 (10:45 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1352 6f19259b-4bc3-4df7-8a09-765794883524

12 files changed:
Tools/Source/MigrationTools/MANIFEST.MF
Tools/Source/MigrationTools/MigrationTools.msa
Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
Tools/Source/MigrationTools/org/tianocore/migration/Guid.java
Tools/Source/MigrationTools/org/tianocore/migration/Macro.java
Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java [deleted file]
Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
Tools/Source/MigrationTools/org/tianocore/migration/ModuleReader.java
Tools/Source/MigrationTools/org/tianocore/migration/MsaTreeEditor.java
Tools/Source/MigrationTools/org/tianocore/migration/SourceFileReplacer.java
Tools/bin/MigrationTools
Tools/bin/MigrationTools.bat

index ae3092ebad41282338942bc8feccf7ae4a21e38e..2786db510b47093d0d7d89481b1de3a604ebcd2b 100644 (file)
@@ -1,2 +1,2 @@
 Manifest-Version: 1.0\r
-Main-Class: org.tianocore.migration.MigrationTool\r
+Main-Class: org.tianocore.migration.ModuleInfo\r
index e7c78f4ac8366695d13864e37081df45a0d5870d..db02b240b11791a8f27e59e11c4c7d4dcd8292b0 100644 (file)
@@ -42,7 +42,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Filename>org/tianocore/migration/SourceFileReplacer.java</Filename>\r
     <Filename>org/tianocore/migration/UI.java</Filename>\r
     <Filename>org/tianocore/migration/MsaTreeEditor.java</Filename> \r
-    <Filename>org/tianocore/migration/MigrationTool.java</Filename> \r
     <Filename>org/tianocore/migration/Critic.java</Filename> \r
     <Filename>org/tianocore/migration/Common.java</Filename>\r
   </SourceFiles>\r
index 77162e854a07eb4153ecb1acf931b4ef1aaeb125..b933dac0ea79d6506a98b197573d237980214aac 100644 (file)
@@ -65,11 +65,11 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
                \r
                mibox = new JCheckBox("Print ModuleInfo", false);\r
                mibox.addItemListener(this);\r
-               MigrationTool.printModuleInfo = false;\r
+               ModuleInfo.printModuleInfo = false;\r
                \r
                criticbox = new JCheckBox("Run Critic", true);\r
                criticbox.addItemListener(this);\r
-               MigrationTool.doCritic = true;\r
+               ModuleInfo.doCritic = true;\r
                \r
                defaultpathbox = new JCheckBox("Use Default Output Path", true);\r
                defaultpathbox.addItemListener(this);\r
@@ -211,16 +211,16 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
                }\r
        } else if (e.getSource() == mibox) {\r
                if (e.getStateChange() == ItemEvent.DESELECTED) {\r
-                       MigrationTool.printModuleInfo = false;\r
+                       ModuleInfo.printModuleInfo = false;\r
                } else if (e.getStateChange() == ItemEvent.SELECTED) {\r
-                       MigrationTool.printModuleInfo = true;\r
+                       ModuleInfo.printModuleInfo = true;\r
                }\r
        } else if (e.getSource() == criticbox) {\r
                if (e.getStateChange() == ItemEvent.DESELECTED) {\r
-                       MigrationTool.doCritic = false;\r
+                       ModuleInfo.doCritic = false;\r
                        System.out.println("criticbox DESELECTED");\r
                } else if (e.getStateChange() == ItemEvent.SELECTED) {\r
-                       MigrationTool.doCritic = true;\r
+                       ModuleInfo.doCritic = true;\r
                        System.out.println("criticbox SELECTED");\r
                }\r
        } else if (e.getSource() == defaultpathbox) {\r
index ed6a7a77f22796827e301c3622abcb7c9cd738ff..61fa2c44b9d4ef65848ba6915c974086fd2a9c5a 100644 (file)
@@ -45,8 +45,8 @@ public class Guid {
                String temp = null;\r
                \r
                temp = mtr.group();\r
-               if (MigrationTool.db.hasGuid(temp)) {           // only changed guids registered, because both changed and not changed guids are included in database\r
-                       type = MigrationTool.db.getGuidType(temp);\r
+               if (ModuleInfo.db.hasGuid(temp)) {              // only changed guids registered, because both changed and not changed guids are included in database\r
+                       type = ModuleInfo.db.getGuidType(temp);\r
                        if (type.matches("Protocol")) {\r
                                mi.protocol.add(temp);\r
                        } else if (type.matches("Ppi")) {\r
index 47c507baf41f4b46b65a47fe71eaa963044e9af1..615dda06a1a1f435715bffa12230aae50fa81e6d 100644 (file)
@@ -35,7 +35,7 @@ public class Macro {
                String temp = null;\r
                \r
                temp = mtr.group();\r
-               if (MigrationTool.db.hasMacro(temp)) {                                  // only changed macros registered, because the database of macro has only changed ones\r
+               if (ModuleInfo.db.hasMacro(temp)) {                                     // only changed macros registered, because the database of macro has only changed ones\r
                        if (!unmacro.contains(temp)) {\r
                                mi.hashnonlocalmacro.add(temp);\r
                        }\r
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java b/Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java
deleted file mode 100644 (file)
index 9448acf..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/** @file\r
\r
- Copyright (c) 2006, Intel Corporation\r
- All rights reserved. This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution.  The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
- **/\r
-package org.tianocore.migration;\r
-\r
-public class MigrationTool {\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
-       \r
-       public static void main(String[] args) throws Exception {\r
-               ui = FirstPanel.init();\r
-               db = Database.init();\r
-       }\r
-}\r
index aa6e7a2ba0bac74ca5ade28c5768e760e49c5199..9a097872e5ca4296b3dd5a0a2a572729fbddb99e 100644 (file)
@@ -23,11 +23,11 @@ public class ModuleInfo {
        ModuleInfo(String modulepath) throws Exception {\r
                this.modulepath = modulepath;\r
                \r
-               MigrationTool.ui.println("Choose where to place the result");\r
-               if ((outputpath = MigrationTool.ui.getFilepath()) == null) {\r
+               ModuleInfo.ui.println("Choose where to place the result");\r
+               if ((outputpath = ModuleInfo.ui.getFilepath()) == null) {\r
                        outputpath = modulepath; \r
                }\r
-               MigrationTool.ui.println(outputpath);\r
+               ModuleInfo.ui.println(outputpath);\r
                \r
                mainFlow();\r
        }\r
@@ -64,9 +64,9 @@ public class ModuleInfo {
                SourceFileReplacer.flush(this); // some adding library actions are taken here,so it must be put before "MsaWriter"\r
                \r
                // show result\r
-               if (MigrationTool.printModuleInfo) {\r
-                       MigrationTool.ui.println("\nModule Information : ");\r
-                       MigrationTool.ui.println("Entrypoint : " + entrypoint);\r
+               if (ModuleInfo.printModuleInfo) {\r
+                       ModuleInfo.ui.println("\nModule Information : ");\r
+                       ModuleInfo.ui.println("Entrypoint : " + entrypoint);\r
                        show(protocol, "Protocol : ");\r
                        show(ppi, "Ppi : ");\r
                        show(guid, "Guid : ");\r
@@ -80,21 +80,21 @@ public class ModuleInfo {
                \r
                new MsaWriter(this).flush();\r
 \r
-               if (MigrationTool.doCritic) {\r
+               if (ModuleInfo.doCritic) {\r
                Critic.fireAt(outputpath + File.separator + "Migration_" + modulename);\r
                }\r
                \r
                Common.deleteDir(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: " + modulepath + File.separator + "result");\r
-               MigrationTool.ui.println("Your logfile was placed here: " + modulepath);\r
+               ModuleInfo.ui.println("Errors Left : " + ModuleInfo.db.error);\r
+               ModuleInfo.ui.println("Complete!");\r
+               ModuleInfo.ui.println("Your R9 module was placed here: " + modulepath + File.separator + "result");\r
+               ModuleInfo.ui.println("Your logfile was placed here: " + modulepath);\r
        }\r
        \r
        private void show(Set<String> hash, String show) {\r
-               MigrationTool.ui.println(show + hash.size());\r
-               MigrationTool.ui.println(hash);\r
+               ModuleInfo.ui.println(show + hash.size());\r
+               ModuleInfo.ui.println(hash);\r
        }\r
        \r
        public final void enroll(String filepath) throws Exception {\r
@@ -128,8 +128,23 @@ public class ModuleInfo {
        }\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
+               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
+       //---------------------------------------------------------------------------//\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
+       \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
index faa3efefb1399fbedd57aa32e5fe49f8ac831359..ad50952ec844591a1976059bb0d103fcba646205 100644 (file)
@@ -32,10 +32,10 @@ public final class ModuleReader {
                \r
                String filename = null;\r
                if (mi.msaorinf.isEmpty()) {\r
-                       MigrationTool.ui.println("No INF nor MSA file found!");\r
+                       ModuleInfo.ui.println("No INF nor MSA file found!");\r
                        System.exit(0);\r
                } else {\r
-                       filename = MigrationTool.ui.choose("Found .inf or .msa file for module\n" + mi.modulepath + "\nChoose one Please", mi.msaorinf.toArray());\r
+                       filename = ModuleInfo.ui.choose("Found .inf or .msa file for module\n" + mi.modulepath + "\nChoose one Please", mi.msaorinf.toArray());\r
                }\r
                if (filename.contains(".inf")) {\r
                        readInf(filename);\r
@@ -100,7 +100,7 @@ public final class ModuleReader {
                                        }\r
                                        if (mtrinfequation.group(1).matches("DPX_SOURCE")) {\r
                                                if (!mi.localmodulesources.contains(mtrinfequation.group(2))) {\r
-                                                       MigrationTool.ui.println("DPX File Missing! : " + mtrinfequation.group(2));\r
+                                                       ModuleInfo.ui.println("DPX File Missing! : " + mtrinfequation.group(2));\r
                                                }\r
                                        }\r
                                }\r
@@ -109,7 +109,7 @@ public final class ModuleReader {
                                mtrfilename = ptnfilename.matcher(mtrsection.group(2));\r
                                while (mtrfilename.find()) {\r
                                        if (!mi.localmodulesources.contains(mtrfilename.group())) {\r
-                                               MigrationTool.ui.println("Source File Missing! : " + mtrfilename.group());\r
+                                               ModuleInfo.ui.println("Source File Missing! : " + mtrfilename.group());\r
                                        }\r
                                }\r
                        }\r
@@ -137,7 +137,7 @@ public final class ModuleReader {
                                        mtrinclude = ptninclude.matcher(line);\r
                                        if (mtrinclude.find() && mi.localmodulesources.contains(mtrinclude.group(1))) {\r
                                        } else {\r
-                                               line = MigrationTool.migrationcomment + line;\r
+                                               line = ModuleInfo.migrationcomment + line;\r
                                        }\r
                                }\r
                                outfile.append(line + '\n');\r
@@ -204,7 +204,7 @@ public final class ModuleReader {
                        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, mi, MigrationTool.db)) != null) {                            // 2.use 3 different matchers , search 3 times to find each\r
-                                       //matguid.appendReplacement(result, MigrationTool.db.getR9Guidname(temp));              // search the database for all 3 kinds of guids , high cost\r
+                                       //matguid.appendReplacement(result, ModuleInfo.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 final class ModuleReader {
                        matfuncc = Func.ptnfuncc.matcher(line);\r
                        while (matfuncc.find()) {\r
                                if ((temp = Func.register(matfuncc, mi, MigrationTool.db)) != null) {\r
-                                       //MigrationTool.ui.println(ifile + "  dofunc  " + temp);\r
-                                       //matfuncc.appendReplacement(result, MigrationTool.db.getR9Func(temp));\r
+                                       //ModuleInfo.ui.println(ifile + "  dofunc  " + temp);\r
+                                       //matfuncc.appendReplacement(result, ModuleInfo.db.getR9Func(temp));\r
                                }\r
                        }\r
                        //matfuncc.appendTail(result);\r
index 7bdf0281199ca2c57c6b25fcbab17bc79b62106b..2b5e434a612b69614b9735ab68217548c217ee92 100644 (file)
@@ -102,7 +102,7 @@ public class MsaTreeEditor extends JPanel {
        }\r
        \r
        private void addNode() {\r
-               addNode((DefaultMutableTreeNode)(tree.getSelectionPath().getLastPathComponent()), MigrationTool.ui.getInput("Input Node Name"));\r
+               addNode((DefaultMutableTreeNode)(tree.getSelectionPath().getLastPathComponent()), ModuleInfo.ui.getInput("Input Node Name"));\r
        }\r
        \r
        private void addNode(DefaultMutableTreeNode parentNode, Object child) {\r
index fdc8a657a7884f60b320cbfd504e44dfa007b46c..7d4c13ba96668ff3f328b9cff29ada8ed8aa9cb2 100644 (file)
@@ -44,7 +44,7 @@ public final class SourceFileReplacer {
                \r
                String outname = null;\r
                String inname = null;\r
-               if (MigrationTool.ui.yesOrNo("Changes will be made to the Source Code.  View details?")) {\r
+               if (ModuleInfo.ui.yesOrNo("Changes will be made to the Source Code.  View details?")) {\r
                        showdetails = true;\r
                }\r
                \r
@@ -57,7 +57,7 @@ public final class SourceFileReplacer {
                                } else {\r
                                        outname = inname;\r
                                }\r
-                               MigrationTool.ui.println("\nModifying file: " + inname);\r
+                               ModuleInfo.ui.println("\nModifying file: " + inname);\r
                                Common.string2file(sourcefilereplace(mi.modulepath + File.separator + "temp" + File.separator + inname), mi.outputpath + File.separator + "Migration_" + mi.modulename + File.separator + outname);\r
                        } else if (inname.contains(".h") || inname.contains(".H") || inname.contains(".dxs") || inname.contains(".uni")) {\r
                                if (inname.contains(".H")) {\r
@@ -65,7 +65,7 @@ public final class SourceFileReplacer {
                                } else {\r
                                        outname = inname;\r
                                }\r
-                               MigrationTool.ui.println("\nCopying file: " + inname);\r
+                               ModuleInfo.ui.println("\nCopying file: " + inname);\r
                                Common.string2file(Common.file2string(mi.modulepath + File.separator + "temp" + File.separator + inname), mi.outputpath + File.separator + "Migration_" + mi.modulename + File.separator + outname);\r
                        }\r
                }\r
@@ -77,7 +77,7 @@ public final class SourceFileReplacer {
        \r
        private static final void addr8only() throws Exception {\r
                String paragraph = null;\r
-               String line = Common.file2string(MigrationTool.db.DatabasePath + File.separator + "R8Lib.c");\r
+               String line = Common.file2string(ModuleInfo.db.DatabasePath + File.separator + "R8Lib.c");\r
                //Common.ensureDir(mi.modulepath + File.separator + "Migration_" + mi.modulename + File.separator + "R8Lib.c");\r
                PrintWriter outfile1 = new PrintWriter(new BufferedWriter(new FileWriter(mi.outputpath + File.separator + "Migration_" + mi.modulename + File.separator + "R8Lib.c")));\r
                PrintWriter outfile2 = new PrintWriter(new BufferedWriter(new FileWriter(mi.outputpath + File.separator + "Migration_" + mi.modulename + File.separator + "R8Lib.h")));\r
@@ -128,7 +128,7 @@ public final class SourceFileReplacer {
                // replace BS -> gBS , RT -> gRT\r
                Matcher mat = pat.matcher(line);\r
                if (mat.find()) {                                                                                               // add a library here\r
-                       MigrationTool.ui.println("Converting all BS->gBS, RT->gRT");\r
+                       ModuleInfo.ui.println("Converting all BS->gBS, RT->gRT");\r
                        line = mat.replaceAll("g$1$2$3");                                                       //unknown correctiveness\r
                }\r
                mat.reset();\r
@@ -145,7 +145,7 @@ public final class SourceFileReplacer {
                Pattern patentrypoint = Pattern.compile("EFI_DRIVER_ENTRY_POINT[^\\}]*\\}");\r
                Matcher matentrypoint = patentrypoint.matcher(line);\r
                if (matentrypoint.find()) {\r
-                       MigrationTool.ui.println("Deleting Entry_Point");\r
+                       ModuleInfo.ui.println("Deleting Entry_Point");\r
                        line = matentrypoint.replaceAll("");\r
                }\r
                */\r
@@ -163,10 +163,10 @@ public final class SourceFileReplacer {
                                mi.hashrequiredr9libs.add("UefiRuntimeServicesTableLib");               //a\r
                                mi.hashrequiredr9libs.add("DxeServicesTableLib");                               //l\r
                        } else {                                                                                                                        //\r
-                               mi.hashrequiredr9libs.add(MigrationTool.db.getR9Lib(r8thing));                          // add a library here\r
+                               mi.hashrequiredr9libs.add(ModuleInfo.db.getR9Lib(r8thing));                             // add a library here\r
                        }\r
                        \r
-                       if ((r9thing = MigrationTool.db.getR9Func(r8thing)) != null) {\r
+                       if ((r9thing = ModuleInfo.db.getR9Func(r8thing)) != null) {\r
                                if (!r8thing.equals(r9thing)) {\r
                                        if (line.contains(r8thing)) {\r
                                                line = line.replaceAll(r8thing, r9thing);\r
@@ -174,7 +174,7 @@ public final class SourceFileReplacer {
                                                Iterator<r8tor9> rt = filefunc.iterator();\r
                                                while (rt.hasNext()) {\r
                                                        temp = rt.next();\r
-                                                       if (MigrationTool.db.r8only.contains(temp.r8thing)) {\r
+                                                       if (ModuleInfo.db.r8only.contains(temp.r8thing)) {\r
                                                                filer8only.add(r8thing);\r
                                                                mi.hashr8only.add(r8thing);\r
                                                                addr8 = true;\r
@@ -192,8 +192,8 @@ public final class SourceFileReplacer {
                it = mi.hashnonlocalmacro.iterator();\r
                while (it.hasNext()) {                                          //macros are all assumed MdePkg currently\r
                        r8thing = it.next();\r
-                       //mi.hashrequiredr9libs.add(MigrationTool.db.getR9Lib(r8thing));                \r
-                       if ((r9thing = MigrationTool.db.getR9Macro(r8thing)) != null) {\r
+                       //mi.hashrequiredr9libs.add(ModuleInfo.db.getR9Lib(r8thing));           \r
+                       if ((r9thing = ModuleInfo.db.getR9Macro(r8thing)) != null) {\r
                                if (line.contains(r8thing)) {\r
                                        line = line.replaceAll(r8thing, r9thing);\r
                                        filemacro.add(new r8tor9(r8thing, r9thing));\r
@@ -260,7 +260,7 @@ public final class SourceFileReplacer {
                show(fileppi, "ppi");\r
                show(fileprotocol, "protocol");\r
                if (!filer8only.isEmpty()) {\r
-                       MigrationTool.ui.println("Converting r8only : " + filer8only);\r
+                       ModuleInfo.ui.println("Converting r8only : " + filer8only);\r
                }\r
 \r
                filefunc.clear();\r
@@ -278,12 +278,12 @@ public final class SourceFileReplacer {
                r8tor9 temp;\r
                if (showdetails) {\r
                        if (!hash.isEmpty()) {\r
-                               MigrationTool.ui.print("Converting " + sh + " : ");\r
+                               ModuleInfo.ui.print("Converting " + sh + " : ");\r
                                while (it.hasNext()) {\r
                                        temp = it.next();\r
-                                       MigrationTool.ui.print("[" + temp.r8thing + "->" + temp.r9thing + "] ");\r
+                                       ModuleInfo.ui.print("[" + temp.r8thing + "->" + temp.r9thing + "] ");\r
                                }\r
-                               MigrationTool.ui.println("");\r
+                               ModuleInfo.ui.println("");\r
                        }\r
                }\r
        }\r
@@ -295,7 +295,7 @@ public final class SourceFileReplacer {
                it = hash.iterator();\r
                while (it.hasNext()) {\r
                        r8thing = it.next();\r
-                       if ((r9thing = MigrationTool.db.getR9Guidname(r8thing)) != null) {\r
+                       if ((r9thing = ModuleInfo.db.getR9Guidname(r8thing)) != null) {\r
                                if (!r8thing.equals(r9thing)) {\r
                                        if (line.contains(r8thing)) {\r
                                                line = line.replaceAll(r8thing, r9thing);\r
index fc47bef2eb0237c4ef4bbae680c7a9838217c005..c0d13d4c221f28789330d4adc6a35239d5e3127e 100644 (file)
@@ -12,4 +12,4 @@
 export CLASSPATH=$CLASSPATH:$WORKSPACE/Tools/bin/MigrationTools.jar
 
 # Run Migration Tool
-java org.tianocore.migration.MigrationTool
\ No newline at end of file
+java org.tianocore.migration.ModuleInfo
\ No newline at end of file
index a29044144bc18a34da36d89540acb378c0fbf6fa..fd6c5936dd29dd7db394335626a34a190f247848 100644 (file)
@@ -29,7 +29,7 @@ if not exist %WORKSPACE%\Tools\bin\MigrationTools.jar (
 )\r
 \r
 @REM Run Migration\r
-call "java" org.tianocore.migration.MigrationTool\r
+call "java" org.tianocore.migration.ModuleInfo\r
 \r
 goto end\r
 \r