Mercurial repository interface class.
Inheritance: IDisposable
Example #1
0
        /// <summary>
        /// Doing Step 2 of the release process which includes the following:
        /// <list type="number">
        /// <item><description>Builds samples</description></item>
        /// <item><description>Creates a release notes</description></item>
        /// <item><description>Update wiki download page</description></item>
        /// <item><description>Create a new release in the contrib repository</description></item>
        /// <item><description>Commits, Tags and Pushes</description></item>
        /// </list>
        /// </summary>
        private void DoStep2()
        {
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("=========================");
            Console.WriteLine("Prerequisites for Step 2:");
            Console.WriteLine("You ran Step 1.");
            Console.WriteLine("You upgraded the Google.Apis NuGet packages for each sample in the samples " +
                "repository and pushed that change.");
            Console.WriteLine("=========================");
            if (!CanContinue())
            {
                return;
            }

            SamplesRepository = new Hg(new Uri(string.Format(CloneUrlFormat, ".samples")), "samples");
            WikiRepository = new Hg(new Uri(string.Format(CloneUrlFormat, ".wiki")), "wiki");
            ContribRepository = new Hg(new Uri(string.Format(CloneUrlFormat, ".contrib")), "contrib");

            // if there are incoming changes those changes will be printed, otherwise we can continue in the 
            // process
            if (!HasIncomingChanges(AllRepositories))
            {
                BuildSamples();
                var notes = CreateContribNewRelease();
                UpdateWiki(notes);

                foreach (var repository in AllRepositories)
                {
                    repository.AddRemoveFiles();
                }

                Console.WriteLine("=========================");
                Console.WriteLine("Commit, Tag and Push");
                Console.WriteLine("=========================");
                if (!CanContinue())
                {
                    return;
                }

                // commit
                CommitAndTag();

                // push
                foreach (Hg repository in AllRepositories)
                {
                    repository.Push();
                }

                // create branch
                PrintCreateBranch();

                // publish core components to NuGet
                if (!string.IsNullOrEmpty(options.NuGetApiKey))
                {
                    PublishPackagesToNuGet();
                    Console.WriteLine("Now... you should run the NuGet publisher to publish a new PCL "
                        + "for each generated Google API. Run: " +
                        "Google.Apis.NuGet.Publisher --all_apis true -m publisher -k [NUGET_KEY]");
                }
                else
                {
                    TraceSource.TraceEvent(TraceEventType.Error, "NuGet API key is empty!");
                }
            }
        }
Example #2
0
        /// <summary>The main release logic for creating a new release of Google.Apis.</summary>
        private void Run()
        {
            DefaultRepository = new Hg(new Uri(string.Format(CloneUrlFormat, "")), options.IsLocal ? null : "default");

            // Step 1 is only for creating the core Google.Apis packages.
            if (options.Step == 1)
            {
                DoStep1();
            }
            // Step 2 should be done after the NuGet publisher generated all the APIs and the samples repository was 
            // updated with the new packages
            else if (options.Step == 2)
            {
                DoStep2();
            }
        }