Exemplo n.º 1
0
        /// <summary>Builds the "default" repository projects.</summary>
        /// <returns><c>true</c> if the default repository was build successfully</returns>
        private bool BuildDefaultRepository()
        {
            TraceSource.TraceEvent(TraceEventType.Information, "Building projects....");

            var allProjects = new List <Project>();

            allProjects.AddRange(ReleaseProjects);
            allProjects.Add(new Project(DefaultRepository.Combine("Src", "GoogleApis.Tests",
                                                                  "GoogleApis.Tests.csproj")));
            allProjects.Add(new Project(DefaultRepository.Combine("Src", "GoogleApis.Auth.Tests",
                                                                  "GoogleApis.Auth.Tests.csproj")));

            foreach (var project in allProjects)
            {
                var name = project.GetName();
                TraceSource.TraceEvent(TraceEventType.Information, "Replacing version for {0}", name);
                project.ReplaceVersion(options.Version);

                // TODO(peleyal): Currently some projects can't build. Build manually for now! That's why the following
                // if statement is commented out. INVESTIGATE!

                /*
                 * project.SetProperty("Configuration", "ReleaseSigned");
                 * TraceSource.TraceEvent(TraceEventType.Information, "Building {0}", name);
                 * bool success = project.Build("Build", new[] { new ConsoleLogger(LoggerVerbosity.Quiet) });
                 *
                 * if (success)
                 * {
                 *  TraceSource.TraceEvent(TraceEventType.Information, "Building {0} succeeded!", name);
                 * }
                 * else
                 * {
                 *  TraceSource.TraceEvent(TraceEventType.Error, "Building {0} failed!", name);
                 *  return false;
                 * }
                 */

                if (!ReleaseProjects.Contains(project))
                {
                    // TODO(peleyal): run unit tests for all test projects
                }
            }

            return(true);
        }
Exemplo n.º 2
0
        /// <summary>Builds the "default" repository projects.</summary>
        /// <returns><c>true</c> if the default repository was build successfully</returns>
        private bool BuildDefaultRepository()
        {
            TraceSource.TraceEvent(TraceEventType.Information, "Building projects....");

            var allProjects = new List <Project>();

            allProjects.AddRange(ReleaseProjects);
            allProjects.Add(new Project(DefaultRepository.Combine("Src", "GoogleApis.Tests",
                                                                  "GoogleApis.Tests.csproj")));
            allProjects.Add(new Project(DefaultRepository.Combine("Src", "GoogleApis.Auth.Tests",
                                                                  "GoogleApis.Auth.Tests.csproj")));

            foreach (var project in allProjects)
            {
                var name = project.GetName();
                TraceSource.TraceEvent(TraceEventType.Information, "Replacing version for {0}", name);
                project.ReplaceVersion(options.Version);
                project.SetProperty("Configuration", "Release");
                TraceSource.TraceEvent(TraceEventType.Information, "Building {0}", name);
                bool success = project.Build("Build", new[] { new ConsoleLogger(LoggerVerbosity.Quiet) });

                if (success)
                {
                    TraceSource.TraceEvent(TraceEventType.Information, "Building {0} succeeded!", name);
                }
                else
                {
                    TraceSource.TraceEvent(TraceEventType.Error, "Building {0} failed!", name);
                    return(false);
                }

                if (!ReleaseProjects.Contains(project))
                {
                    // TODO(peleyal): run unit tests for all test projects
                }
            }

            return(true);
        }