示例#1
0
        static async Task Main(string[] args)
        {
            var configPath = String.Empty;

            if (args.Length > 0)
            {
                configPath = args[0];
            }
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("------------ SmartCode Build Start! --------------");

            if (String.IsNullOrEmpty(configPath))
            {
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine("Pleace Please enter the path to build configuration file:");
                configPath = Console.ReadLine();
                if (String.IsNullOrEmpty(configPath))
                {
                    Console.ForegroundColor = ConsoleColor.Yellow;
                    Console.WriteLine("------- Not Find ConfigPath Arg! -------");
                    Console.ForegroundColor = ConsoleColor.Magenta;
                    Console.WriteLine($"------- Use default config :{DEFAULT_CONFIG_PATH}! -------");
                    configPath = DEFAULT_CONFIG_PATH;
                }
            }
            SmartCodeApp app = new DefaultSmartCodeAppBuilder().Build(configPath);
            await app.Run();

            Console.ReadLine();
        }
示例#2
0
        private async Task OnExecute()
        {
            if (String.IsNullOrEmpty(ConfigPath))
            {
                var useDefaultConfig = Prompt.GetYesNo($"If you do not enter ConfigPath, you will use the default configuration:{DEFAULT_CONFIG_PATH}", true);
                ConfigPath = useDefaultConfig ? DEFAULT_CONFIG_PATH
                    : Prompt.GetString("Please enter the path to build configuration file:");
            }

            SmartCodeApp app = new DefaultSmartCodeAppBuilder().Build(ConfigPath);
            await app.Run();
        }
示例#3
0
        static async Task Main(string[] args)
        {
            var configPath = String.Empty;

            if (args.Length > 0)
            {
                configPath = args[0];
            }
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("------------ SmartCode Build Start! --------------");

            if (String.IsNullOrEmpty(configPath))
            {
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine("Please enter the path to build configuration file:");
                configPath = Console.ReadLine();
                if (String.IsNullOrEmpty(configPath))
                {
                    Console.ForegroundColor = ConsoleColor.Yellow;
                    Console.WriteLine("------- Not Find ConfigPath Arg! -------");
                    Console.ForegroundColor = ConsoleColor.Magenta;
                    Console.WriteLine($"------- Use default config :{DEFAULT_CONFIG_PATH}! -------");
                    configPath = DEFAULT_CONFIG_PATH;
                }
            }
            try
            {
                SmartCodeApp app = new DefaultSmartCodeAppBuilder().Build(configPath);
                await app.Run();

                Thread.Sleep(200);//Wait for Logger
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine($"------------ SmartCode Build End! Output:[{app.Project.Output?.Path}] --------------");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                Console.ResetColor();
            }
        }
示例#4
0
        private async Task OnExecute()
        {
            if (!String.IsNullOrEmpty(CultureInfo))
            {
                System.Globalization.CultureInfo culture = System.Globalization.CultureInfo.GetCultureInfo(CultureInfo);
                System.Threading.Thread.CurrentThread.CurrentCulture = culture;
            }

            if (String.IsNullOrEmpty(ConfigPath))
            {
                var useDefaultConfig =
                    Prompt.GetYesNo(
                        $"If you do not enter ConfigPath, you will use the default configuration:{DEFAULT_CONFIG_PATH}",
                        true);
                ConfigPath = useDefaultConfig
                    ? DEFAULT_CONFIG_PATH
                    : Prompt.GetString("Please enter the path to build configuration file:");
            }

            SmartCodeApp app = new DefaultSmartCodeAppBuilder().Build(ConfigPath);
            await app.Run();
        }