123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using FlutterCodeGenerator.Helper;
- using FlutterCodeGenerator.Model;
- using System;
- using System.Diagnostics;
- using System.IO;
- namespace FlutterCodeGenerator
- {
- internal class Program
- {
- private static void Main(string[] args)
- {
- try
- {
- var generatedFolderPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "GeneratedCode");
- var dllPath = AppDomain.CurrentDomain.BaseDirectory;
- if (args.Length == 2)
- {
- dllPath = args[0];
- generatedFolderPath = args[1];
- }
- if (string.IsNullOrWhiteSpace(dllPath) || string.IsNullOrWhiteSpace(generatedFolderPath))
- {
- throw new ArgumentException("The argments are invalid!");
- }
- var codeGeneratorForWing = new CodeGeneratorForWing(dllPath, generatedFolderPath);
- codeGeneratorForWing.GeneratedCode();
- var codeGeneratorForFISLib = new CodeGeneratorForFISLib(dllPath, generatedFolderPath);
- codeGeneratorForFISLib.GeneratedCode();
- using (Process process = new Process())
- {
- ProcessStartInfo psi = new ProcessStartInfo("Explorer.exe")
- {
- Arguments = generatedFolderPath
- };
- process.StartInfo = psi;
- process.Start();
- }
- Console.WriteLine($"The code has already generated! The path is {generatedFolderPath}");
- }
- catch (Exception ex)
- {
- Console.WriteLine($"An Error occured when generated!!!CodeGenerator:{GenerateDataCache.Instance.CurrentGenerator}, Service:{GenerateDataCache.Instance.CurrentService},Method:{GenerateDataCache.Instance.CurrentMethod},Parameter:{GenerateDataCache.Instance.CurrentParameter},IsLoadFinished:{GenerateDataCache.Instance.IsLoadFinished},IsGenerateFinished:{GenerateDataCache.Instance.IsGenerateFinished} Error Message : {ex}");
- }
- Console.ReadLine();
- }
- }
- }
|