Beispiel #1
0
        public void KeepsCustomisations()
        {
            IRepository   repo;
            IIssueTracker issueTracker;

            new TestDataCreator(new DateTimeOffset(2012, 1, 1, 0, 0, 0, new TimeSpan()))
            .CreateRelease("0.1.0", "Issue1", "Issue2")
            .CreateRelease("0.2.0", "Issue3")
            .Build(out repo, out issueTracker);

            var tagToStartFrom     = GitRepositoryInfoFinder.GetFirstCommit(repo);
            var currentReleaseInfo = GitRepositoryInfoFinder.GetCurrentReleaseInfo(repo);

            var previousReleaseNotes = SemanticReleaseNotes.Parse(@"# vNext


Commits: ...


# 0.2.0 (05 January 2012)

**Note this release does some stuff!**


 - [2] - Edited Issue3

Another comment

Commits:  AC39885536...CA74E870F2


# 0.1.0 (03 January 2012)

## Features
 - [0] - Edited Issue1
 - [1] - Edited Issue2
 - [2] - Edited Issue3

## Fixes
 - [3] - Edited Issue4
 - [4] - Edited Issue5

This is a comment about the release

Which spans multiple lines


Commits: E413A880DB...F6924D7A0B");

            var releaseNotes = ReleaseNotesGenerator.GenerateReleaseNotes(
                repo, issueTracker, previousReleaseNotes, new Categories(),
                tagToStartFrom, currentReleaseInfo, "url/{0}...{1}");

            Approvals.Verify(releaseNotes.ToString(), Scrubber);
        }
Beispiel #2
0
        public void AllTagsWithNoCommitsOrIssuesAfterLastRelease()
        {
            IRepository   repo;
            IIssueTracker issueTracker;

            new TestDataCreator(new DateTimeOffset(2012, 1, 1, 0, 0, 0, new TimeSpan()))
            .CreateRelease("0.1.0", "Issue1", "Issue2")
            .CreateRelease("0.2.0", "Issue3")
            .Build(out repo, out issueTracker);

            var tagToStartFrom     = GitRepositoryInfoFinder.GetFirstCommit(repo);
            var currentReleaseInfo = GitRepositoryInfoFinder.GetCurrentReleaseInfo(repo);

            var releaseNotes = ReleaseNotesGenerator.GenerateReleaseNotes(
                repo, issueTracker, new SemanticReleaseNotes(), new Categories(),
                tagToStartFrom, currentReleaseInfo, issueTracker.DiffUrlFormat);

            Approvals.Verify(releaseNotes.ToString(), Scrubber);
        }
        public void AllTags()
        {
            IRepository   repo;
            IIssueTracker issueTracker;

            new TestDataCreator(new DateTimeOffset(2012, 1, 1, 0, 0, 0, new TimeSpan()))
            .CreateRelease("0.1.0", "Issue1", "Issue2")
            .CreateRelease("0.2.0", "Issue3")
            .AddIssues("Issue4")
            .Build(out repo, out issueTracker);

            var tagToStartFrom     = GitRepositoryInfoFinder.GetFirstCommit(repo);
            var currentReleaseInfo = GitRepositoryInfoFinder.GetCurrentReleaseInfo(repo);

            var releaseNotes = ReleaseNotesGenerator.GenerateReleaseNotes(
                repo, issueTracker, new SemanticReleaseNotes(), new string[0],
                tagToStartFrom, currentReleaseInfo, string.Empty);

            Approvals.Verify(releaseNotes.ToString());
        }
Beispiel #4
0
        public void AppendOnlyNewItems()
        {
            IRepository   repo;
            IIssueTracker issueTracker;

            new TestDataCreator(new DateTimeOffset(2012, 1, 1, 0, 0, 0, new TimeSpan()))
            .CreateRelease("0.1.0", "Issue1", "Issue2")
            .CreateRelease("0.2.0", "Issue3")
            .AddIssues("Issue4")
            .Build(out repo, out issueTracker);

            var tagToStartFrom     = GitRepositoryInfoFinder.GetFirstCommit(repo);
            var currentReleaseInfo = GitRepositoryInfoFinder.GetCurrentReleaseInfo(repo);

            var previousReleaseNotes = SemanticReleaseNotes.Parse(@"# vNext


Commits: ...


# 0.2.0 (05 January 2012)

 - [2] - Edited Issue3

Commits:  AC39885536...CA74E870F2


# 0.1.0 (03 January 2012)

 - [0] - Edited Issue1
 - [1] - Edited Issue2

Commits: E413A880DB...F6924D7A0B");

            var releaseNotes = ReleaseNotesGenerator.GenerateReleaseNotes(
                repo, issueTracker, previousReleaseNotes, new Categories(),
                tagToStartFrom, currentReleaseInfo, string.Empty);

            Approvals.Verify(releaseNotes.ToString(), Scrubber);
        }
Beispiel #5
0
        // output a class library instead

        /*
         * static void Main(string[] args)
         * {
         *  programStart(args);
         * }*/

        public static void programStart(string[] args)
        {
            // silent mode is true by default -
            // it's faster and quieter.
            bool silent = true;

                        #if DEBUG
            silent = false;
                        #endif

            // program header
            printProgramHeader();

            // create logger
            Logger logger = new Logger()
                            .SetLoggingType(Logger.Type.Message);

            // try to generate the notes
            try
            {
                // arguments
                if (args.Length == 0)
                {
                    throw new Exception("Settings.json file path argument missing.");
                }

                // create release notes generator
                ReleaseNotesGenerator generator = null;

                // set vars from args
                var    configuration = (SaveFile.CreateSaveFileFromPath(args[0])).GetInternalObject();
                string generatorType = configuration.GetValue("Generator Type").ToString();

                var settings = new NamedLookup("Settings");
                settings["Team Project Path"] = configuration.GetValue("Team Project Path").ToString();
                settings["Project Name"]      = configuration.GetValue("Project Name").ToString();
                settings["Project Subpath"]   = configuration.GetValue("Project Subpath").ToString();
                settings["Iteration"]         = configuration.GetValue("Iteration").ToString();
                settings["Database"]          = configuration.GetValue("Database").ToString();
                settings["Database Server"]   = configuration.GetValue("Database Server").ToString();
                settings["Web Server"]        = configuration.GetValue("Web Server").ToString();
                settings["Doc Type"]          = "APPLICATION BUILD/RELEASE NOTES\n";
                settings["Web Location"]      = configuration.GetValue("Web Location").ToString();

                switch (generatorType.ToLowerInvariant())
                {
                case "excel":
                    generator = ExcelGenerator.ExcelGeneratorFactory(settings, silent);
                    break;

                case "server":
                    generator = ExcelServerGenerator.ExcelServerGeneratorFactory(settings, silent);
                    break;

                case "word":
                    generator = WordGenerator.WordGeneratorFactory(settings, silent);
                    break;

                case "html":
                    throw new NotImplementedException("Not implemented generator type");

                default:
                    throw new Exception("Invalid generator type specified");
                }

                // generate
                generator.GenerateReleaseNotes();
            }
            catch (Exception e)
            {
                // display error
                logger
                .SetLoggingType(Logger.Type.Error)
                .SetMessage(e.Message)
                .Display();
                Thread.Sleep(1000);
            }

            if (!silent)             //if we're in silent mode, the program exits. The file has been saved.
            {
                // wait for exit
                logger.SetLoggingType(Logger.Type.General)
                .SetMessage("Press any key to exit.")
                .Display();

                // wait for key
                Console.ReadKey();
            }
        }