Bullseye 3.8.0

Runs a target dependency graph.

There is a newer prerelease version of this package available.
See the version list below for details.
Install-Package Bullseye -Version 3.8.0
dotnet add package Bullseye --version 3.8.0
<PackageReference Include="Bullseye" Version="3.8.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Bullseye --version 3.8.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Bullseye, 3.8.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Bullseye as a Cake Addin
#addin nuget:?package=Bullseye&version=3.8.0

// Install Bullseye as a Cake Tool
#tool nuget:?package=Bullseye&version=3.8.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Bullseye

Bullseye

NuGet version

Build status CodeQL analysis Lint Spell check

Appveyor smoke test status Azure DevOps smoke test status CircleCI smoke test status Cirrus CI smoke test status GitLab CI/CD smoke test status

Bullseye is a .NET library that runs a target dependency graph.

Bullseye targets can do anything. They are not restricted to building .NET projects.

Platform support: .NET Standard 2.0 and later.

Quick start

  • Create a .NET console app named targets and add a reference to Bullseye.

  • Replace the contents of Program.cs with:

    using static Bullseye.Targets;
    
    class Program
    {
        static void Main(string[] args)
        {
            Target("default", () => System.Console.WriteLine("Hello, world!"));
            RunTargetsAndExit(args);
        }
    }
    
  • Run the app. E.g. dotnet run or F5 in Visual Studio:

VoilĂ ! You've just written and run your first Bullseye program. You will see output similar to:

<img src="https://user-images.githubusercontent.com/677704/93706096-506d7800-fb23-11ea-8154-d8c8c90bada5.png" width="314px" />

For help, run dotnet run -- --help.

Also see the async quick start.

Defining dependencies

Target("make-tea", () => Console.WriteLine("Tea made."));
Target("drink-tea", DependsOn("make-tea"), () => Console.WriteLine("Ahh... lovely!"));
Target("walk-dog", () => Console.WriteLine("Walkies!"));
Target("default", DependsOn("drink-tea", "walk-dog"));

<img src="https://user-images.githubusercontent.com/677704/93706154-c96ccf80-fb23-11ea-926a-9e3836e79f06.png" width="325px" />

Enumerable inputs

Target(
    "eat-biscuits",
    ForEach("digestives", "chocolate hobnobs"),
    biscuits => Console.WriteLine($"Mmm...{biscuits}! Nom nom."));
dotnet run -- eat-biscuits

<img src="https://user-images.githubusercontent.com/677704/95656205-f7cf4080-0b0c-11eb-9f82-a4fb706ae33b.png" width="444px" />

Sample wrapper scripts

  • build.cmd

    @echo Off
    dotnet run --project targets -- %*
    
  • build.sh

    #!/usr/bin/env bash
    set -euo pipefail
    dotnet run --project targets -- "$@"
    
  • build.ps1

    $ErrorActionPreference = "Stop";
    dotnet run --project targets -- $args
    

Command line arguments

Generally, all the command line arguments passed to Program.cs should be passed along to Bullseye, as shown in the quick start above (RunTargetsAndExit(args);). This is because Bullseye effectively provides a command line interface, with options for displaying a list of targets, performing dry runs, suppressing colour, and more. For full details of the command line options, run your targets project supplying the --help (-h/-?) option:

dotnet run --project targets -- --help
./build.cmd --help
./build.sh -h
./build.ps1 -?

You can also handle custom arguments in Program.cs, but you should ensure that only valid arguments are passed along to Bullseye and that the help text contains both your custom arguments and the arguments supported by Bullseye. A good way to do this is to use a command line parsing package to define your custom arguments, and to provide translation between the package and Bullseye. For example, see the test projects for:

Non-static API

For most cases, the static API described above is sufficient. For more complex scenarios where a number of target collections are required, the non-static API may be used.

var targets1 = new Targets();
targets1.Add("foo", () => Console.Out.WriteLine("foo1"));

var targets2 = new Targets();
targets2.Add("foo", () => Console.Out.WriteLine("foo2"));

targets1.RunWithoutExiting(args);
targets2.RunWithoutExiting(args);

NO_COLOR

Bullseye supports NO_COLOR.

FAQ

Can I force a pause before exiting when debugging in Visual Studio 2017 (or earlier)?

Yes! Add the following line anywhere before calling RunTargetsAndExit/RunTargetsAndExitAsync:

AppDomain.CurrentDomain.ProcessExit += (s, e) => Console.ReadKey();

Note that the common way to do this for .NET console apps is to add a line such as the following before the end of the Program.Main method:

Console.ReadKey();

This does not work after calling RunTargetsAndExit/RunTargetsAndExit because that is the final statement that will be executed.

In Visual Studio 2019 and later, .NET console apps pause before exiting by default, so none of this is required.

Who's using Bullseye?

To name a few:

Feel free to send a pull request to add your repo or organisation to this list!


<sub>Target by Franck Juncker from the Noun Project.</sub>

Bullseye

Bullseye

NuGet version

Build status CodeQL analysis Lint Spell check

Appveyor smoke test status Azure DevOps smoke test status CircleCI smoke test status Cirrus CI smoke test status GitLab CI/CD smoke test status

Bullseye is a .NET library that runs a target dependency graph.

Bullseye targets can do anything. They are not restricted to building .NET projects.

Platform support: .NET Standard 2.0 and later.

Quick start

  • Create a .NET console app named targets and add a reference to Bullseye.

  • Replace the contents of Program.cs with:

    using static Bullseye.Targets;
    
    class Program
    {
        static void Main(string[] args)
        {
            Target("default", () => System.Console.WriteLine("Hello, world!"));
            RunTargetsAndExit(args);
        }
    }
    
  • Run the app. E.g. dotnet run or F5 in Visual Studio:

VoilĂ ! You've just written and run your first Bullseye program. You will see output similar to:

<img src="https://user-images.githubusercontent.com/677704/93706096-506d7800-fb23-11ea-8154-d8c8c90bada5.png" width="314px" />

For help, run dotnet run -- --help.

Also see the async quick start.

Defining dependencies

Target("make-tea", () => Console.WriteLine("Tea made."));
Target("drink-tea", DependsOn("make-tea"), () => Console.WriteLine("Ahh... lovely!"));
Target("walk-dog", () => Console.WriteLine("Walkies!"));
Target("default", DependsOn("drink-tea", "walk-dog"));

<img src="https://user-images.githubusercontent.com/677704/93706154-c96ccf80-fb23-11ea-926a-9e3836e79f06.png" width="325px" />

Enumerable inputs

Target(
    "eat-biscuits",
    ForEach("digestives", "chocolate hobnobs"),
    biscuits => Console.WriteLine($"Mmm...{biscuits}! Nom nom."));
dotnet run -- eat-biscuits

<img src="https://user-images.githubusercontent.com/677704/95656205-f7cf4080-0b0c-11eb-9f82-a4fb706ae33b.png" width="444px" />

Sample wrapper scripts

  • build.cmd

    @echo Off
    dotnet run --project targets -- %*
    
  • build.sh

    #!/usr/bin/env bash
    set -euo pipefail
    dotnet run --project targets -- "$@"
    
  • build.ps1

    $ErrorActionPreference = "Stop";
    dotnet run --project targets -- $args
    

Command line arguments

Generally, all the command line arguments passed to Program.cs should be passed along to Bullseye, as shown in the quick start above (RunTargetsAndExit(args);). This is because Bullseye effectively provides a command line interface, with options for displaying a list of targets, performing dry runs, suppressing colour, and more. For full details of the command line options, run your targets project supplying the --help (-h/-?) option:

dotnet run --project targets -- --help
./build.cmd --help
./build.sh -h
./build.ps1 -?

You can also handle custom arguments in Program.cs, but you should ensure that only valid arguments are passed along to Bullseye and that the help text contains both your custom arguments and the arguments supported by Bullseye. A good way to do this is to use a command line parsing package to define your custom arguments, and to provide translation between the package and Bullseye. For example, see the test projects for:

Non-static API

For most cases, the static API described above is sufficient. For more complex scenarios where a number of target collections are required, the non-static API may be used.

var targets1 = new Targets();
targets1.Add("foo", () => Console.Out.WriteLine("foo1"));

var targets2 = new Targets();
targets2.Add("foo", () => Console.Out.WriteLine("foo2"));

targets1.RunWithoutExiting(args);
targets2.RunWithoutExiting(args);

NO_COLOR

Bullseye supports NO_COLOR.

FAQ

Can I force a pause before exiting when debugging in Visual Studio 2017 (or earlier)?

Yes! Add the following line anywhere before calling RunTargetsAndExit/RunTargetsAndExitAsync:

AppDomain.CurrentDomain.ProcessExit += (s, e) => Console.ReadKey();

Note that the common way to do this for .NET console apps is to add a line such as the following before the end of the Program.Main method:

Console.ReadKey();

This does not work after calling RunTargetsAndExit/RunTargetsAndExit because that is the final statement that will be executed.

In Visual Studio 2019 and later, .NET console apps pause before exiting by default, so none of this is required.

Who's using Bullseye?

To name a few:

Feel free to send a pull request to add your repo or organisation to this list!


<sub>Target by Franck Juncker from the Noun Project.</sub>

Release Notes

https://github.com/adamralph/bullseye/blob/main/CHANGELOG.md

  • .NETStandard 2.0

    • No dependencies.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Bullseye:

Package Downloads
Faithlife.Build
A build automation system using C# build scripts.
Apprio.Enablement.Infrastructure
Package Description
Apprio.Azure.Infrastructure
Package Description
Xenial.Beer
Beer - Delicious dotnet build tools
LauPas.BuildExtensions
Helpers for writing build script.

GitHub repositories (35)

Showing the top 5 popular GitHub repositories that depend on Bullseye:

Repository Stars
IdentityServer/IdentityServer4
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
elastic/elasticsearch-net
Elasticsearch.Net & NEST
xunit/xunit
xUnit.net is a free, open source, community-focused unit testing tool for the .NET Framework.
AppMetrics/AppMetrics
App Metrics is an open-source and cross-platform .NET library used to record and report metrics within an application.
JasperFx/marten
.NET Transactional Document DB and Event Store on PostgreSQL

Version History

Version Downloads Last updated
4.0.0-alpha.1 140 9/19/2021
3.8.0 5,474 8/20/2021
3.8.0-rc.1 307 8/3/2021
3.8.0-beta.1 90 7/28/2021
3.8.0-alpha.2 77 7/25/2021
3.8.0-alpha.1 93 7/25/2021
3.7.1 8,350 7/12/2021
3.7.0 51,032 1/20/2021
3.7.0-alpha.1 429 1/7/2021
3.6.0 10,756 1/1/2021
3.6.0-rc.1 1,158 12/22/2020
3.6.0-beta.1 198 12/4/2020
3.5.0 43,902 9/19/2020
3.5.0-rc.1 291 9/4/2020
3.4.0 19,119 7/26/2020
3.4.0-alpha.1 329 6/24/2020
3.3.0 121,451 4/2/2020
3.3.0-beta.1 308 3/6/2020
3.2.0 8,901 2/20/2020
3.2.0-rc.1 297 2/9/2020
3.2.0-alpha.2 447 12/26/2019
3.2.0-alpha.1 261 12/23/2019
3.1.0 29,490 12/7/2019
3.1.0-rc.1 827 11/13/2019
3.1.0-alpha.1 365 10/16/2019
3.0.0 47,969 10/13/2019
3.0.0-rc.1 4,143 9/8/2019
3.0.0-beta.3 753 8/27/2019
3.0.0-beta.2 150 8/25/2019
3.0.0-beta.1 165 8/25/2019
3.0.0-alpha.1 158 8/24/2019
2.4.0 6,233 7/27/2019
2.4.0-rc.2 9,200 7/15/2019
2.4.0-rc.1 144 7/15/2019
2.4.0-beta.1 614 6/28/2019
2.4.0-alpha.1 2,140 6/1/2019
2.3.0 48,175 12/17/2018
2.3.0-rc.1 2,092 12/14/2018
2.3.0-beta.6 773 12/8/2018
2.3.0-beta.5 237 12/8/2018
2.3.0-beta.4 224 12/7/2018
2.3.0-beta.3 270 12/4/2018
2.3.0-beta.2 241 11/30/2018
2.3.0-beta.1 222 11/27/2018
2.3.0-alpha.1 291 11/2/2018
2.2.0 4,756 10/19/2018
2.2.0-rc.2 248 10/13/2018
2.2.0-rc.1 237 10/13/2018
2.2.0-beta.2 242 10/12/2018
2.2.0-beta.1 255 10/11/2018
2.1.0 6,078 10/9/2018
2.1.0-beta.1 255 10/7/2018
2.0.0 651 10/7/2018
2.0.0-rc.3 370 9/30/2018
2.0.0-rc.2 277 9/27/2018
2.0.0-rc.1 246 9/26/2018
1.3.0 962 9/20/2018
1.2.0 4,524 9/3/2018
1.2.0-rc.2 12,837 9/2/2018
1.2.0-rc.1 261 9/2/2018
1.1.0 718 8/23/2018
1.1.0-rc.2 343 8/13/2018
1.1.0-rc.1 351 8/12/2018
1.0.1 656 8/2/2018
1.0.0 861 7/27/2018
1.0.0-rc.5 498 6/28/2018
1.0.0-rc.4 358 6/26/2018
1.0.0-rc.3 313 6/26/2018
1.0.0-rc.2 307 6/24/2018
1.0.0-rc.1 1,735 5/6/2018
1.0.0-alpha0002 640 11/17/2017
1.0.0-alpha0001 656 11/17/2017