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