Пример #1
0
        static int Main(string[] args)
        {
            if (!ParametersParser.Start(args))
            {
                return(-1);
            }
            try
            {
                ParametersParser.LoadParameters();

                Console.WriteLine("Command: " + Context.Command + " nugets ");
                Console.WriteLine("File: file: " + Context.FileName);
                Console.WriteLine();

                if (Context.Command == Command.Extract)
                {
                    Extract.Start();
                }
                else
                {
                    Restore.Start();
                }

                Console.WriteLine("Cashe Nuget was done");

                return(0);
            }
            catch (Exception ex)
            {
                Helper.ShowError(ex);
                return(-1);
            }
        }
Пример #2
0
        static int Main(string[] args)
        {
            if (!ParametersParser.Start(args))
            {
                return(-1);
            }
            try
            {
                ParametersParser.LoadParameters();

                Console.WriteLine("Generating Event Bus Command from...");
                Console.WriteLine("Assembly: " + Context.AssemblyFile);
                Console.WriteLine("Command: " + Context.CommandName);
                Console.WriteLine("Temp folder: " + Context.TempPath);

                Context.LoadAssembly();
                Context.PrepareOutputDirectory();

                new List <ProjectCreator> {
                    new EventBusCommandProjectCreator()
                };

                var eventBusCommandProjectCreator = new EventBusCommandProjectCreator();
                eventBusCommandProjectCreator.Build();
                new NugetCreator(eventBusCommandProjectCreator).Create();

                Console.WriteLine("Add done");
                return(0);
            }
            catch (Exception ex)
            {
                Helper.ShowError(ex);
                return(-1);
            }
        }
Пример #3
0
        static int Main(string[] args)
        {
            ParametersParser.SetArgs(args);

            if (!Initialize(args))
            {
                return(-1);
            }

            try
            {
                ParametersParser.Current.LoadParameters(null);

                Console.WriteLine("Generating Client SDK proxy from...");
                Console.WriteLine("Publisher service: " + Context.Current.PublisherService);
                Console.WriteLine("Api assembly: " + Context.Current.AssemblyFile);
                Console.WriteLine("Api controller: " + Context.Current.ControllerName);
                Console.WriteLine("Temp folder: " + Context.Current.TempPath);

                Context.Current.LoadAssembly();
                Context.Current.PrepareOutputDirectory();


                DtoTypes.FindAll(
                    Context.Current.ActionMethods.SelectMany(x => x.GetArgAndReturnTypes()).ToArray()
                    , Context.Current.AssemblyObj);

                DtoDataProviderClassGenerator.ValidateRemoteDataProviderAttributes();

                new List <ProjectCreatorBase> {
                    new ProxyProjectCreator()
                };

                var proxyCreator = new ProxyProjectCreator();
                proxyCreator.Build();

                new NugetCreator(proxyCreator).Create();

                GenerateMSharps();

                if (Context.Current.Output != null)
                {
                    Context.Current.TempPath.CopyTo(Context.Current.Output.FullName, true);
                }


                Console.WriteLine("Add done");
                return(0);
            }
            catch (Exception ex)
            {
                ShowError(ex);
                return(-1);
            }
        }
Пример #4
0
        static int Main(string[] args)
        {
            ParametersParser.SetArgs(args);

            if (!ParametersParser.Current.Start())
            {
                return(-1);
            }
            try
            {
                ParametersParser.Current.LoadParameters(null);

                Console.WriteLine("Generating Event Bus Command from...");
                Console.WriteLine("Assembly: " + Context.Current.AssemblyFile);
                Console.WriteLine("Command: " + Context.Current.CommandName);
                Console.WriteLine("Temp folder: " + Context.Current.TempPath);

                Context.Current.LoadAssembly();
                Context.Current.PrepareOutputDirectory();


                DtoTypes.FindAll(Context.Current.CommandType.GetFiledTypes(), Context.Current.AssemblyObj);


                new List <ProjectCreatorBase> {
                    new EventBusCommandProjectCreator()
                };

                var proxyCreator = new EventBusCommandProjectCreator();
                proxyCreator.Build();


                //if (Context.Current.Output != null)
                //    Context.Current.TempPath.CopyTo(Context.Current.Output.FullName, true);

                new NugetCreator(proxyCreator).Create();


                Console.WriteLine("Add done");
                return(0);
            }
            catch (Exception ex)
            {
                Helper.ShowError(ex);
                return(-1);
            }
        }
Пример #5
0
        static int Main(string[] args)
        {
            if (!Initialize(args))
            {
                return(-1);
            }

            try
            {
                ParametersParser.LoadParameters();

                Console.WriteLine("Generating Client SDK proxy from...");
                Console.WriteLine("Publisher service: " + Context.PublisherService);
                Console.WriteLine("Api assembly: " + Context.AssemblyFile);
                Console.WriteLine("Api controller: " + Context.ControllerName);
                Console.WriteLine("Temp folder: " + Context.TempPath);
                Context.LoadAssembly();
                Context.PrepareOutputDirectory();
                DtoTypes.FindAll();
                DtoDataProviderClassGenerator.ValidateRemoteDataProviderAttributes();

                new List <ProjectCreator> {
                    new ProxyProjectCreator()
                };

                var proxyCreator = new ProxyProjectCreator();
                proxyCreator.Build();
                new NugetCreator(proxyCreator).Create();

                if (DtoTypes.All.Any())
                {
                    var projectCreators = new[] { new MSharpProjectCreator(), new MSharp46ProjectCreator() };
                    projectCreators.AsParallel().Do(x => x.Build());
                    new NugetCreator(projectCreators).Create();
                }

                Console.WriteLine("Add done");
                return(0);
            }
            catch (Exception ex)
            {
                ShowError(ex);
                return(-1);
            }
        }
Пример #6
0
        static int Main(string[] args)
        {
            if (!ParametersParser.Start(args))
            {
                return(-1);
            }
            try
            {
                ParametersParser.LoadParameters();

                Console.WriteLine("Generating Data Endpoint from...");
                Console.WriteLine("Assembly: " + Context.AssemblyFile);
                Console.WriteLine("Endpoint: " + Context.EndpointName);
                Console.WriteLine("Temp folder: " + Context.TempPath);

                Context.LoadAssembly();
                Context.FindExposedTypes();
                Context.PrepareOutputDirectory();

                new List <ProjectCreator> {
                    new EndpointProjectCreator()
                };

                var endPointCreator = new EndpointProjectCreator();
                endPointCreator.Build();
                new NugetCreator(endPointCreator).Create();

                if (Context.ExposedTypes.Any())
                {
                    var projectCreators = new[] { new MSharpProjectCreator(), new MSharp46ProjectCreator() };
                    projectCreators.AsParallel().Do(x => x.Build());
                    new NugetCreator(projectCreators).Create();
                }

                Console.WriteLine("Add done");
                return(0);
            }
            catch (Exception ex)
            {
                Helper.ShowError(ex);
                return(-1);
            }
        }
Пример #7
0
        static bool Initialize(string[] args)
        {
            Console.WriteLine("Current directory: " + Environment.CurrentDirectory);

            if (args.Contains("/debug"))
            {
                Console.Write("Waiting for debugger to attach...");
                while (!Debugger.IsAttached)
                {
                    Thread.Sleep(100);
                }
                Console.WriteLine("Attached.");
            }

            AppDomain.CurrentDomain.ResolveAssemblies();

            if (!ParametersParser.Start(args))
            {
                Helper.ShowHelp();
                return(false);
            }
            return(true);
        }
Пример #8
0
 //public static ParametersParser SetArgs(string[] args) { return Current = new ParametersParser(Context.Current, args); }
 public static void SetArgs(string[] args)
 {
     Current = new ParametersParser(Context.Current, args);
 }
Пример #9
0
 public static ParametersParser SetArgs(string[] args)
 {
     return(Current = new ParametersParser(Context.Current, args));
 }