Example #1
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 #2
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;
             */
        }