xBuild.Shell 0.1.1

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package xBuild.Shell --version 0.1.1
                    
NuGet\Install-Package xBuild.Shell -Version 0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="xBuild.Shell" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="xBuild.Shell" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="xBuild.Shell" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add xBuild.Shell --version 0.1.1
                    
#r "nuget: xBuild.Shell, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package xBuild.Shell@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=xBuild.Shell&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=xBuild.Shell&version=0.1.1
                    
Install as a Cake Tool

xBuild Shell

Overview

Provides a utility to directly invoke shell commands using and bash-like syntax, and ITarget extensions to add these as invocations.

Usage

Configuring

Call .AddShell() when constructing the build to make shell execution available to the build.

Basic Usage

Call .Executes() on a target with the command string:

ITarget Target => field ??= new Target()
    .Executes(
        $"ENV_VAR1=val1 dotnet build Solution.sln --verbosity {Verbosity.Value}", 
        ShellLoggingOptions.StandardError
    );

This will add an execution to the target to invoke the specified process from the application working directory using the environment variables and arguments supplied in the string. The command executed, standard output, and standard error will be logged to the available ITargetLogger depending on the ShellLoggingOptions provided. By default all logging options are enabled.

DotNet Tool Execution

Call ExecutesDotNetTool() on a target specifying the dotnet tool to call and arguments to supply to it:

ITarget Target => field ??= new Target()
    .ExecutesDotNetTool($"jetbrains.resharper.globaltools cleanupcode Solution.sln"));

// > dotnet tool exec -y --allow-roll-forward --ignore-failed-sources jetbrains.resharper.globaltools -- cleanupcode Solution.sln"

This command definition will be transformed into a dotnet tool exec command running the tool with the targets supplied, running the tool with the specified arguments.

This

Multiple Commands

Multiple commands can be supplied to be executed sequentially.

ITarget Target => field ??= new Target()
    .Executes(
        [
            $"ENV_VAR1=val1 dotnet build Solution.sln --verbosity {Verbosity.Value}", 
            $"ENV_VAR1=val1 dotnet test Solution.sln --verbosity {Verbosity.Value}"
        ]
    );

Manual Invocation

A Shell singleton instance is injected into the build on configuration. This can be resolved using normal execution and used for more complex calls:

ITarget Target => field ??= new Target()
    .Executes((Shell shell) => 
    {
        var output = await shell
            .Command($"ENV_VAR1=val1 dotnet build Solution.sln --verbosity {Verbosity.Value}")
            .ExecuteAndCaptureOutputAsync(buildContext.StoppingToken)
            .ToArrayAsync()
        
        // Process output
    });

Argument Redaction

Arguments can be redacted in logs by specifying :redacted in the argument format.

ITarget Target => field ??= new Target()
    .Executes($"dotnet nuget push --api-key {ApiKey:redacted}");

// > dotnet nuget push --api_key [REDACTED]

Sensitive BuildOptions are always redacted.

BuildOption<string> ApiKey { get; } = new("--api-key", sensitive: true)


ITarget Target => field ??= new Target()
    .Executes($"dotnet nuget push --api-key {ApiKey}");

// > dotnet nuget push --api_key [REDACTED]
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated