예제 #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));
 }