X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=Tools%2FSource%2FMigrationTools%2Forg%2Ftianocore%2Fmigration%2FMigrationTool.java;h=5c74ee03f18724d6fea8a7a83b47031c06d0112b;hb=b678aacaa9876e8a1f14c4e9e93df87d3d4977b2;hp=d6119e6e45eee3634e03600dd77ee5614bb171b4;hpb=778d35c92a569812c3b2f6d0b913315bdce4c874;p=mirror_edk2.git diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java b/Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java index d6119e6e45..5c74ee03f1 100644 --- a/Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java +++ b/Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java @@ -1,23 +1,76 @@ -/** @file - - Copyright (c) 2006, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - **/ package org.tianocore.migration; +import java.io.File; +import java.util.Set; + public class MigrationTool { public static UI ui = null; public static Database db = null; - + + public static String MIGRATIONCOMMENT = "//%$//"; + + public static boolean printModuleInfo = false; + public static boolean doCritic = false; + public static boolean defaultoutput = false; + + private static final void mainFlow(ModuleInfo mi) throws Exception { + + ModuleReader.ModuleScan(mi); + //MigrationTool.ui.yesOrNo("go on replace?"); + SourceFileReplacer.flush(mi); // some adding library actions are taken here,so it must be put before "MsaWriter" + + //MigrationTool.ui.yesOrNo("go on show?"); + // show result + if (MigrationTool.printModuleInfo) { + MigrationTool.ui.println("\nModule Information : "); + MigrationTool.ui.println("Entrypoint : " + mi.entrypoint); + show(mi.protocol, "Protocol : "); + show(mi.ppi, "Ppi : "); + show(mi.guid, "Guid : "); + show(mi.hashfuncc, "call : "); + show(mi.hashfuncd, "def : "); + show(mi.hashEFIcall, "EFIcall : "); + show(mi.hashnonlocalmacro, "macro : "); + show(mi.hashnonlocalfunc, "nonlocal : "); + show(mi.hashr8only, "hashr8only : "); + } + + //MigrationTool.ui.yesOrNo("go on msawrite?"); + new MsaWriter(mi).flush(); + //MigrationTool.ui.yesOrNo("go on critic?"); + + if (MigrationTool.doCritic) { + Critic.fireAt(mi.outputpath + File.separator + "Migration_" + mi.modulename); + } + + //MigrationTool.ui.yesOrNo("go on delete?"); + Common.deleteDir(mi.modulepath + File.separator + "temp"); + + MigrationTool.ui.println("Errors Left : " + MigrationTool.db.error); + MigrationTool.ui.println("Complete!"); + //MigrationTool.ui.println("Your R9 module was placed here: " + mi.modulepath + File.separator + "result"); + //MigrationTool.ui.println("Your logfile was placed here: " + mi.modulepath); + } + + private static final void show(Set hash, String show) { + MigrationTool.ui.println(show + hash.size()); + MigrationTool.ui.println(hash); + } + + public static final void seekModule(String filepath) throws Exception { + if (ModuleInfo.isModule(filepath)) { + mainFlow(new ModuleInfo(filepath)); + } + } + + public static final void startMigrateAll(String path) throws Exception { + MigrationTool.ui.println("Project Migration"); + MigrationTool.ui.println("Copyright (c) 2006, Intel Corporation"); + Common.toDoAll(path, MigrationTool.class.getMethod("seekModule", String.class), null, null, Common.DIR); + } + public static void main(String[] args) throws Exception { - ui = FirstPanel.init(); - db = Database.init(); + ui = FirstPanel.getInstance(); + db = Database.getInstance(); } }