예제 #1
0
        static void Main(string[] args)
        {
            var options = new Options();

            if (!Parser.Default.ParseArguments(args, options))
            {
                Environment.Exit(Parser.DefaultExitCodeFail);
            }

            using (var vs = VisualStudio.Create(logTo: Console.Out))
            {
                vs.OpenSolution(options.SlnPath);

                if (string.IsNullOrEmpty(options.ProjectName))
                {
                    var exportedTemplates = vs.ExportTemplate(options.IncludeNuGetPackages).ToList();

                    if (exportedTemplates.Any())
                    {
                        vs.CombineTemplates(Path.GetFileNameWithoutExtension(options.SlnPath), exportedTemplates);
                    }
                    else
                    {
                        Console.WriteLine("No Projects to export!");
                    }
                }
                else
                {
                    vs.ExportTemplate(options.ProjectName, options.IncludeNuGetPackages);
                }

                if (!string.IsNullOrEmpty(options.VsixProjectName))
                {
                    vs.CreateVsix(options.ProjectName, options.VsixProjectName);
                }
            }

            Console.WriteLine("Everything is OK!");
        }
예제 #2
0
파일: Program.cs 프로젝트: codedecay/vspte
        static void Main(string[] args)
        {
            var options = new Options();

            if (!Parser.Default.ParseArguments(args, options))
            {
                Environment.Exit(Parser.DefaultExitCodeFail);
            }

            using (var vs = VisualStudio.Create(logTo: Console.Out))
            {
                vs.OpenSolution(options.SlnPath);
                vs.ExportTemplate(options.ProjectName, options.IncludeNuGetPackages);

                if (!string.IsNullOrEmpty(options.VsixProjectName))
                {
                    vs.CreateVsix(options.ProjectName, options.VsixProjectName);
                }
            }

            Console.WriteLine("Everything is OK!");
        }