Bullseye is a .NET library, developed by humans, for running a target dependency graph.
Bullseye is typically used 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. Bullseye is useful for any program which performs a series of operations.
Platform support: .NET 8.0 and later.
.sln/.slnx file), add a .NET console app named Targets β dotnet new console --name Targets1cd Targetsdotnet add package Bullseyedotnet add package SimpleExecTargets/Program.cs with:
using static Bullseye.Targets;
using static SimpleExec.Command;
Target("build", () => RunAsync("dotnet", "build --configuration Release"));
Target("test", dependsOn: ["build"], () => RunAsync("dotnet", "test --configuration Release --no-build"));
Target("default", dependsOn: ["test"]);
await RunTargetsAndExitAsync(args, ex => ex is SimpleExec.ExitCodeException);
cd ..Targets project β dotnet run --project Targets.VoilΓ ! You just wrote and ran your first Bullseye build program.
For help, run dotnet run --project Targets -- --help.
1. You could use a file-based C# program instead, but, at the time of writing, IDE support for file-based C# programs is not complete, so if you want full debugging, Intellisense, etc., it's a better to use a .NET console app.
build (Linux and macOS)#!/usr/bin/env bash
set -euo pipefail
dotnet run --project Targets -- "$@"
build.cmd (Windows)@echo Off
dotnet run --project Targets -- %*
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"));
dotnet run --project Targets -- test
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 (CLI), 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:
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);
Bullseye supports NO_COLOR.
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.
C#
96.6%
Batchfile
1.8%
Makefile
1.6%
Bullseye is a .NET library, developed by humans, for running a target dependency graph.
Bullseye is typically used 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. Bullseye is useful for any program which performs a series of operations.
Platform support: .NET 8.0 and later.
.sln/.slnx file), add a .NET console app named Targets β dotnet new console --name Targets1cd Targetsdotnet add package Bullseyedotnet add package SimpleExecTargets/Program.cs with:
using static Bullseye.Targets;
using static SimpleExec.Command;
Target("build", () => RunAsync("dotnet", "build --configuration Release"));
Target("test", dependsOn: ["build"], () => RunAsync("dotnet", "test --configuration Release --no-build"));
Target("default", dependsOn: ["test"]);
await RunTargetsAndExitAsync(args, ex => ex is SimpleExec.ExitCodeException);
cd ..Targets project β dotnet run --project Targets.VoilΓ ! You just wrote and ran your first Bullseye build program.
For help, run dotnet run --project Targets -- --help.
1. You could use a file-based C# program instead, but, at the time of writing, IDE support for file-based C# programs is not complete, so if you want full debugging, Intellisense, etc., it's a better to use a .NET console app.
build (Linux and macOS)#!/usr/bin/env bash
set -euo pipefail
dotnet run --project Targets -- "$@"
build.cmd (Windows)@echo Off
dotnet run --project Targets -- %*
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"));
dotnet run --project Targets -- test
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 (CLI), 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:
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);
Bullseye supports NO_COLOR.
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.
C#
96.6%
Batchfile
1.8%
Makefile
1.6%