private static void RunGeneration(IAnnotator annotator, NugetSpec nuspec, Args parsedArgs)
        {
            var version = parsedArgs.Version ?? new Version("1.0.0.0");
            var dir = parsedArgs.Directory ?? new DirectoryInfo(Environment.CurrentDirectory);
            var fixedSpec = SpecWithVersion(nuspec, version);
            annotator.CreateNugetPackage(fixedSpec, dir);

            Console.WriteLine($"Generated version {version}  in {dir.FullName}");
        }
 private static NugetSpec SpecWithVersion(NugetSpec spec, Version version)
 {
     return new NugetSpec(
         spec.Id,
         version.ToString(),
         spec.Title,
         spec.Authors,
         spec.Owners,
         spec.ProjectUrl,
         spec.IconUrl,
         spec.Description,
         spec.Tags);
 }
        static int Main(string[] args)
        {
            var annotator = Annotator.Create();

            AnnotateLogger(annotator);
            AnnotateFactories(annotator);

            var nuspec = new NugetSpec(
                id: "NLog.Annotations",
                title: "NLog Annotations",
                authors: "Julien Roncaglia",
                owners: "Julien Roncaglia",
                projectUrl: "https://github.com/vbfox/NLogResharperAnnotations",
                iconUrl: "https://raw.github.com/vbfox/NLogResharperAnnotations/master/nlog.png",
                description: "Annotations for the NLog.dll file",
                tags: "NLog Annotations");

            return RunApp("NLogResharperAnnotations", args, annotator, nuspec);
        }
        private static int RunApp(string exeName, string[] args, IAnnotator annotator, NugetSpec nuspec)
        {
            try
            {
                var parsedArgs = ParseArgs(args);
                if (parsedArgs.ShowHelp)
                {
                    ShowHelp(exeName, parsedArgs);
                    return parsedArgs.ParseError == null ? SuccessExitCode : InvalidArgumentsExitCode;
                }

                RunGeneration(annotator, nuspec, parsedArgs);
                return SuccessExitCode;
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: " + e.Message);
                return ExceptionExitCode;
            }
        }
 public static void CreateNugetPackage([NotNull] this IAnnotator annotator, NugetSpec spec,
     DirectoryInfo directory)
 {
     var annotationFiles = CoreHelper.GetAnnotations(annotator).GenerateFiles();
     NuGetGeneration.CreateNugetPackage(spec, annotationFiles, directory);
 }