コード例 #1
0
        private static void Run(CommandLineArguments args)
        {
            if (!File.Exists(args.HeaderScanListFile))
            {
                PrintError($"File '{args.HeaderScanListFile}' is not exists");
                return;
            }

            if (!File.Exists(args.ConfigPath))
            {
                PrintError($"Project directory '{args.ConfigPath}' is not exists");
                return;
            }

            var config = JsonConvert.DeserializeObject <Config>(File.ReadAllText(args.ConfigPath));
            var files  = GetScanFiles(args);

            if (!Directory.Exists(args.Output))
            {
                PrintError($"Project directory '{args.Output}' is not exists");
                return;
            }

            Watch.Start();

            var domain = ParceManager.Parce(files, config);

            GenarateDomain(domain, args.Output, config);

            Watch.Stop();

            Console.WriteLine();
            domain.PrintTotal();
            Console.WriteLine($"Total time {Watch.ElapsedMilliseconds / 1000.0}s");
        }
コード例 #2
0
        private static void Run(CommandLineArguments args)
        {
            if (!File.Exists(args.HeaderScanListFile))
            {
                PrintError($"File '{args.HeaderScanListFile}' is not exists");
                return;
            }

            if (!File.Exists(args.ConfigPath))
            {
                PrintError($"Project directory '{args.ConfigPath}' is not exists");
                return;
            }

            var config = JsonConvert.DeserializeObject <Config>(File.ReadAllText(args.ConfigPath));

            if (!Directory.Exists(args.Output))
            {
                PrintError($"Project directory '{args.Output}' is not exists");
                return;
            }

            if (args.IsInteractive)
            {
                new InteractiveShell(config, args).Enter();
            }
            else
            {
                Watch.Start();

                var files = GetScanFiles(args);

                var domain = ParceManager.Parce(files, config);
                GenarateDomain(domain, args.Output, config);

                Watch.Stop();

                Console.WriteLine();
                Console.WriteLine("Export:");
                Console.WriteLine(domain.PrintTotal());

                if (!string.IsNullOrEmpty(config.GenerateStatFile))
                {
                    File.WriteAllText(config.GenerateStatFile, domain.PrintTotal());
                }

                Console.WriteLine($"Total time {Watch.ElapsedMilliseconds / 1000.0}s");
            }
        }
コード例 #3
0
        private void RunParce(string[] args)
        {
            var files = new List <string>();

            if (args.Length == 0)
            {
                files = Program.GetScanFiles(_args);
            }
            else
            {
                files.Add(string.Join(' ', args));
            }

            _domain = ParceManager.Parce(files, _config);
        }