Exemplo n.º 1
0
        public static int Main(string[] args)
        {
            var argumentCheckResult = CheckArguments (args);
              if (argumentCheckResult != 0)
            return (argumentCheckResult);

              var version = args[0];
              var outputDirectory = Path.GetFullPath (args[1]);
              var outputFile = Path.Combine (outputDirectory, "ReleaseNotes_v" + version + ".html");;
              string customJQuery = null;
              string title = null;

              if (args.Length == 4)
              {
            title = args[2].Substring(2);
            customJQuery = Uri.EscapeDataString(args[3]);
              }
              else if (args.Length == 3)
              {
            if (args[2].StartsWith ("t:"))
            {
              title = args[2].Substring (2);
            }
            else
            {
              customJQuery = Uri.EscapeDataString(args[2]);
            }
              }

              var customConstraints = new CustomConstraints (version, customJQuery);

              Console.Out.WriteLine ("Starting Remotion.BuildTools for version " + version);

              var webClient = new NtlmAuthenticatedWebClient ();
              webClient.Credentials = CredentialCache.DefaultNetworkCredentials;
              var requestUrlBuilder = new JiraRequestUrlBuilder (s_Configuration);
              var jiraClient = new JiraClient (webClient, () => requestUrlBuilder);
              var jiraIssueAggregator = new JiraIssueAggregator (jiraClient);
              var xmlTransformer = new XmlTransformer (s_Configuration.XsltStyleSheetPath, s_Configuration.XsltProcessorPath);
              var releaseNoteGenerator = new ReleaseNoteGenerator (s_Configuration, jiraIssueAggregator, xmlTransformer);

              var exitCode = releaseNoteGenerator.GenerateReleaseNotes (customConstraints, outputFile, title);

              if (exitCode == WebServiceError)
            return 3;

              if (exitCode == XmlTransformerError)
            return 4;

              Console.Out.WriteLine ("Creation of ReleaseNotes for version {0} was successful.", version);

              return 0;
        }
Exemplo n.º 2
0
        public static int Main(string[] args)
        {
            var argumentCheckResult = CheckArguments(args);

            if (argumentCheckResult != 0)
            {
                return(argumentCheckResult);
            }


            var    version         = args[0];
            var    outputDirectory = Path.GetFullPath(args[1]);
            var    outputFile      = Path.Combine(outputDirectory, "ReleaseNotes_v" + version + ".html");;
            string customJQuery    = null;
            string title           = null;

            if (args.Length == 4)
            {
                title        = args[2].Substring(2);
                customJQuery = Uri.EscapeDataString(args[3]);
            }
            else if (args.Length == 3)
            {
                if (args[2].StartsWith("t:"))
                {
                    title = args[2].Substring(2);
                }
                else
                {
                    customJQuery = Uri.EscapeDataString(args[2]);
                }
            }

            var customConstraints = new CustomConstraints(version, customJQuery);

            Console.Out.WriteLine("Starting Remotion.BuildTools for version " + version);

            var webClient = new NtlmAuthenticatedWebClient();

            webClient.Credentials = CredentialCache.DefaultNetworkCredentials;
            var requestUrlBuilder    = new JiraRequestUrlBuilder(s_Configuration);
            var jiraClient           = new JiraClient(webClient, () => requestUrlBuilder);
            var jiraIssueAggregator  = new JiraIssueAggregator(jiraClient);
            var xmlTransformer       = new XmlTransformer(s_Configuration.XsltStyleSheetPath, s_Configuration.XsltProcessorPath);
            var releaseNoteGenerator = new ReleaseNoteGenerator(s_Configuration, jiraIssueAggregator, xmlTransformer);

            var exitCode = releaseNoteGenerator.GenerateReleaseNotes(customConstraints, outputFile, title);

            if (exitCode == WebServiceError)
            {
                return(3);
            }

            if (exitCode == XmlTransformerError)
            {
                return(4);
            }

            Console.Out.WriteLine("Creation of ReleaseNotes for version {0} was successful.", version);

            return(0);
        }