]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java
5c74ee03f18724d6fea8a7a83b47031c06d0112b
1 package org
.tianocore
.migration
;
6 public class MigrationTool
{
7 public static UI ui
= null;
8 public static Database db
= null;
10 public static String MIGRATIONCOMMENT
= "//%$//";
12 public static boolean printModuleInfo
= false;
13 public static boolean doCritic
= false;
14 public static boolean defaultoutput
= false;
16 private static final void mainFlow(ModuleInfo mi
) throws Exception
{
18 ModuleReader
.ModuleScan(mi
);
19 //MigrationTool.ui.yesOrNo("go on replace?");
20 SourceFileReplacer
.flush(mi
); // some adding library actions are taken here,so it must be put before "MsaWriter"
22 //MigrationTool.ui.yesOrNo("go on show?");
24 if (MigrationTool
.printModuleInfo
) {
25 MigrationTool
.ui
.println("\nModule Information : ");
26 MigrationTool
.ui
.println("Entrypoint : " + mi
.entrypoint
);
27 show(mi
.protocol
, "Protocol : ");
28 show(mi
.ppi
, "Ppi : ");
29 show(mi
.guid
, "Guid : ");
30 show(mi
.hashfuncc
, "call : ");
31 show(mi
.hashfuncd
, "def : ");
32 show(mi
.hashEFIcall
, "EFIcall : ");
33 show(mi
.hashnonlocalmacro
, "macro : ");
34 show(mi
.hashnonlocalfunc
, "nonlocal : ");
35 show(mi
.hashr8only
, "hashr8only : ");
38 //MigrationTool.ui.yesOrNo("go on msawrite?");
39 new MsaWriter(mi
).flush();
40 //MigrationTool.ui.yesOrNo("go on critic?");
42 if (MigrationTool
.doCritic
) {
43 Critic
.fireAt(mi
.outputpath
+ File
.separator
+ "Migration_" + mi
.modulename
);
46 //MigrationTool.ui.yesOrNo("go on delete?");
47 Common
.deleteDir(mi
.modulepath
+ File
.separator
+ "temp");
49 MigrationTool
.ui
.println("Errors Left : " + MigrationTool
.db
.error
);
50 MigrationTool
.ui
.println("Complete!");
51 //MigrationTool.ui.println("Your R9 module was placed here: " + mi.modulepath + File.separator + "result");
52 //MigrationTool.ui.println("Your logfile was placed here: " + mi.modulepath);
55 private static final void show(Set
<String
> hash
, String show
) {
56 MigrationTool
.ui
.println(show
+ hash
.size());
57 MigrationTool
.ui
.println(hash
);
60 public static final void seekModule(String filepath
) throws Exception
{
61 if (ModuleInfo
.isModule(filepath
)) {
62 mainFlow(new ModuleInfo(filepath
));
66 public static final void startMigrateAll(String path
) throws Exception
{
67 MigrationTool
.ui
.println("Project Migration");
68 MigrationTool
.ui
.println("Copyright (c) 2006, Intel Corporation");
69 Common
.toDoAll(path
, MigrationTool
.class.getMethod("seekModule", String
.class), null, null, Common
.DIR
);
72 public static void main(String
[] args
) throws Exception
{
73 ui
= FirstPanel
.getInstance();
74 db
= Database
.getInstance();