Home

Awesome

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.

<!-- spell-checker:disable --> <!-- spell-checker:enable -->

Quick start

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

<img src="https://github.com/adamralph/bullseye/assets/677704/2f598c2f-89ab-43dc-929a-59f4504dfa28" width="1088px" alt="Bullseye quick start output"/>

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

Sample wrapper scripts

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
<img src="https://github.com/adamralph/bullseye/assets/677704/c25901c6-f30b-4632-8b62-fa3a755729fc" width="1085px" alt="Bullseye enumerable inputs output"/>

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!


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