Bullseye 5.0.0-alpha.1

Bullseye

Bullseye

NuGet version

Build status CodeQL analysis Lint Spell check

AppVeyor 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 is primarily designed as a build tool for .NET projects, and is usually used together with SimpleExec, but Bullseye targets can do anything. They are not restricted to building .NET projects.

Platform support: .NET 6.0 and later.

Quick start

  • Next to an existing .NET solution (.sln file), add a .NET console app named targetsdotnet new console --name targets

  • Change to the new directory — cd targets

  • Add a reference to Bullseyedotnet add package Bullseye

  • Add a reference to SimpleExecdotnet add package SimpleExec

  • Replace the contents of targets/Program.cs with:

    using static Bullseye.Targets;
    using static SimpleExec.Command;
    
    Target("build", () => RunAsync("dotnet", "build --configuration Release --nologo --verbosity quiet"));
    Target("test", DependsOn("build"), () => RunAsync("dotnet", "test --configuration Release --no-build --nologo --verbosity quiet"));
    Target("default", DependsOn("test"));
    
    await RunTargetsAndExitAsync(args, ex => ex is SimpleExec.ExitCodeException);
    
  • Change to the solution directory — cd ..

  • Run the targets project — dotnet run --project targets.

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

For help, run dotnet run --project targets --help.

Sample wrapper scripts

  • build (Linux and macOS)

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

    @echo Off
    dotnet run --project targets -- %*
    

Enumerable inputs

For example, you may want to run your test projects one by one, so that the timing of each one and which one, if any, failed, is displayed in the Bullseye build summary:

Target(
    "test",
    DependsOn("build"),
    ForEach("./FooTests.Acceptance", "./FooTests.Performance"),
    project => RunAsync($"dotnet", $"test {project} --configuration Release --no-build --nologo --verbosity quiet"));
dotnet run -- test

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 (RunTargetsAndExitAsync(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 --help
./build.cmd --help

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"));

await targets1.RunWithoutExitingAsync(args);
await targets2.RunWithoutExitingAsync(args);

NO_COLOR

Bullseye supports NO_COLOR.

Who's using Bullseye?

To name a few:

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


Target by Franck Juncker from the Noun Project.

No packages depend on Bullseye.

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

.NET 6.0

  • No dependencies.

.NET 7.0

  • No dependencies.

Version Downloads Last updated
5.0.0 2 12/26/2024
5.0.0-rc.1 0 12/21/2023
5.0.0-alpha.2 2 12/26/2024
5.0.0-alpha.1 2 12/26/2024
4.2.1 0 01/24/2023
4.2.1-rc.1 0 12/03/2022
4.2.0 2 12/26/2024
4.2.0-beta.1 2 12/26/2024
4.1.1 1 12/26/2024
4.1.0 3 12/26/2024
4.1.0-rc.1 1 12/26/2024
4.1.0-alpha.2 2 12/26/2024
4.1.0-alpha.1 1 12/26/2024
4.0.0 3 12/26/2024
4.0.0-rc.3 3 12/26/2024
4.0.0-rc.2 2 12/26/2024
4.0.0-rc.1 1 12/26/2024
4.0.0-beta.1 2 12/26/2024
4.0.0-alpha.2 1 12/26/2024
4.0.0-alpha.1 1 12/26/2024
3.8.0 0 08/20/2021
3.8.0-rc.1 0 08/03/2021
3.8.0-beta.1 0 07/28/2021
3.8.0-alpha.2 2 12/26/2024
3.8.0-alpha.1 2 12/26/2024
3.7.1 2 12/26/2024
3.7.0 1 12/26/2024
3.7.0-alpha.1 1 12/26/2024
3.6.0 1 12/26/2024
3.6.0-rc.1 0 12/22/2020
3.6.0-beta.1 1 12/26/2024
3.5.0 2 12/26/2024
3.5.0-rc.1 1 12/26/2024
3.4.0 1 12/26/2024
3.4.0-alpha.1 1 12/26/2024
3.3.0 4 11/28/2024
3.3.0-beta.1 1 12/26/2024
3.2.0 2 12/26/2024
3.2.0-rc.1 0 02/09/2020
3.2.0-alpha.2 1 12/26/2024
3.2.0-alpha.1 1 12/26/2024
3.1.0 1 12/26/2024
3.1.0-rc.1 0 11/13/2019
3.1.0-alpha.1 2 12/26/2024
3.0.0 3 12/26/2024
3.0.0-rc.1 0 09/08/2019
3.0.0-beta.3 2 12/26/2024
3.0.0-beta.2 2 12/26/2024
3.0.0-beta.1 1 12/26/2024
3.0.0-alpha.1 2 12/26/2024
2.4.0 1 12/26/2024
2.4.0-rc.2 2 12/26/2024
2.4.0-rc.1 0 07/15/2019
2.4.0-beta.1 0 06/28/2019
2.4.0-alpha.1 1 12/26/2024
2.3.0 2 12/26/2024
2.3.0-rc.1 0 12/14/2018
2.3.0-beta.6 2 12/26/2024
2.3.0-beta.5 2 12/26/2024
2.3.0-beta.4 2 12/26/2024
2.3.0-beta.3 3 12/26/2024
2.3.0-beta.2 3 12/26/2024
2.3.0-beta.1 1 12/26/2024
2.3.0-alpha.1 2 12/26/2024
2.2.0 1 12/26/2024
2.2.0-rc.2 2 12/26/2024
2.2.0-rc.1 0 10/13/2018
2.2.0-beta.2 1 12/26/2024
2.2.0-beta.1 1 12/26/2024
2.1.0 3 12/26/2024
2.1.0-beta.1 1 12/26/2024
2.0.0 2 12/26/2024
2.0.0-rc.3 0 09/30/2018
2.0.0-rc.2 3 12/26/2024
2.0.0-rc.1 0 09/26/2018
1.3.0 1 12/26/2024
1.2.0 0 09/03/2018
1.2.0-rc.2 0 09/02/2018
1.2.0-rc.1 0 09/02/2018
1.1.0 0 08/23/2018
1.1.0-rc.2 1 12/26/2024
1.1.0-rc.1 0 08/12/2018
1.0.1 0 08/02/2018
1.0.0 1 12/26/2024
1.0.0-rc.5 2 12/26/2024
1.0.0-rc.4 2 12/26/2024
1.0.0-rc.3 0 06/26/2018
1.0.0-rc.2 1 12/26/2024
1.0.0-rc.1 0 05/06/2018
1.0.0-alpha0002 2 12/26/2024
1.0.0-alpha0001 0 11/17/2017