Example #1
0
        /// <summary>
        /// Run the coverage tool
        /// </summary>
        /// <returns></returns>
        protected override StageCompletionStatusEnum ExecuteProcess()
        {
            if (!CISession.SlugCIConfigObj.UseCodeCoverage)
            {
                Logger.Info("Code Coverage is not enabled for this solution.");
                return(StageCompletionStatusEnum.Skipped);
            }

            FileSystemTasks.EnsureExistingDirectory(CISession.CoveragePath);
            ReportGeneratorSettings settings = new ReportGeneratorSettings()
            {
                ProcessWorkingDirectory = CISession.CoveragePath,
                TargetDirectory         = CISession.CoveragePath,
                ProcessToolPath         = "reportgenerator",
                ReportsInternal         = new List <string>()
                {
                    "coverage.cobertura.xml"
                },
                ReportTypesInternal = new List <ReportTypes>()
                {
                    ReportTypes.Badges,
                    ReportTypes.HtmlInline
                },
            };

            AbsolutePath   coverageFile   = CISession.CoveragePath / "index.html";
            SlugCmdProcess slugCmdProcess = new SlugCmdProcess("Code Coverage", SlugCmdProcess.GetDefaultProcessSettings());

            Process.Start(@"cmd.exe ", @"/c " + coverageFile);

            // TODO Await completion

            return(StageCompletionStatusEnum.Success);
        }
Example #2
0
        /// <summary>
        ///   <p>Pushes a package to the server and publishes it.</p>
        ///   <p>For more details, visit the <a href="https://docs.microsoft.com/en-us/dotnet/core/tools/">official website</a>.</p>
        /// </summary>
        /// <remarks>
        ///   <p>This is a <a href="http://www.nuke.build/docs/authoring-builds/cli-tools.html#fluent-apis">CLI wrapper with fluent API</a> that allows to modify the following arguments:</p>
        ///   <ul>
        ///     <li><c>&lt;targetPath&gt;</c> via <see cref="DotNetNuGetPushSettings.TargetPath"/></li>
        ///     <li><c>--api-key</c> via <see cref="DotNetNuGetPushSettings.ApiKey"/></li>
        ///     <li><c>--disable-buffering</c> via <see cref="DotNetNuGetPushSettings.DisableBuffering"/></li>
        ///     <li><c>--force-english-output</c> via <see cref="DotNetNuGetPushSettings.ForceEnglishOutput"/></li>
        ///     <li><c>--no-service-endpoint</c> via <see cref="DotNetNuGetPushSettings.NoServiceEndpoint"/></li>
        ///     <li><c>--no-symbols</c> via <see cref="DotNetNuGetPushSettings.NoSymbols"/></li>
        ///     <li><c>--skip-duplicate</c> via <see cref="DotNetNuGetPushSettings.SkipDuplicate"/></li>
        ///     <li><c>--source</c> via <see cref="DotNetNuGetPushSettings.Source"/></li>
        ///     <li><c>--symbol-api-key</c> via <see cref="DotNetNuGetPushSettings.SymbolApiKey"/></li>
        ///     <li><c>--symbol-source</c> via <see cref="DotNetNuGetPushSettings.SymbolSource"/></li>
        ///     <li><c>--timeout</c> via <see cref="DotNetNuGetPushSettings.Timeout"/></li>
        ///   </ul>
        /// </remarks>
        private (BlockingCollection <ILineOut>, int) DotNetNuGetPush(DotNetNuGetPushSettings toolSettings = null)
        {
            toolSettings = toolSettings ?? new DotNetNuGetPushSettings();
            ProcessStartInfo processStartInfo = SlugCmdProcess.GetDefaultProcessSettings();

            ToolSettingsToProcessInfoConverter.Convert(toolSettings, processStartInfo);
            SlugCmdProcess slugCmdProcess = new SlugCmdProcess("Dot Net Nuget Push", processStartInfo);

            slugCmdProcess.Execute(DotNetNugetPush_OutputProcessor);
            return(slugCmdProcess.Output, slugCmdProcess.ExitCode);
        }
Example #3
0
        public (BlockingCollection <ILineOut>, int) DotNetRestore(DotNetRestoreSettings toolSettings = null)
        {
            toolSettings = toolSettings ?? new DotNetRestoreSettings();
            ProcessStartInfo processStartInfo = SlugCmdProcess.GetDefaultProcessSettings();

            ToolSettingsToProcessInfoConverter.Convert(toolSettings, processStartInfo);
            SlugCmdProcess slugCmdProcess = new SlugCmdProcess("Dot Net Restore", processStartInfo);

            slugCmdProcess.Execute(DotNetRestore_OutputProcessor);

            return(slugCmdProcess.Output, slugCmdProcess.ExitCode);


            /*            using var process = ProcessTasks.StartProcess(toolSettings);
             *                      process.AssertZeroExitCode();
             *                      process.Output;
             */
        }