Bullseye is a .NET library that runs 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.
- Quick start
- Sample wrapper scripts
- Enumerable inputs
- Command-line arguments
- Non-static API
- NO_COLOR
- Who's using Bullseye?
- Next to an existing .NET solution (
.sln/.slnxfile), add a .NET console app namedTargetsβdotnet new console --name Targets1 - Change to the new directory β
cd Targets - Add a reference to Bullseye β
dotnet add package Bullseye - Add a reference to SimpleExec β
dotnet add package SimpleExec - Replace the contents of
Targets/Program.cswith: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);
- Change to the solution directory β
cd .. - Run the
Targetsproject β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.
#!/usr/bin/env bash
set -euo pipefail
dotnet run --project Targets -- "$@"@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 -- testGenerally, 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 --helpYou 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:
- AspNetCore.AsyncInitialization
- Config.SqlStreamStore
- ConfigR
- Elastic
- EssentialMVVM
- FakeItEasy
- Fluxzy
- HumanBytes
- Ibento
- IdentityModel
- IdentityServer
- Iso8601DurationHelper
- Linq.Extras
- LittleForker
- LykkeOSS
- Marten
- MinVer
- Particular
- ProxyKit
- PseudoLocalizer
- Radical Framework
- RealWorld
- SelfInitializingFakes
- SendComics
- SqlStreamStore.Locking
- SQLStreamStore
- Statik
- Tasty
- TemplatedConfiguration
- Xenial
Feel free to send a pull request to add your repository or organisation to this list!
Target by Franck Juncker from the Noun Project.