Bullseye 4.2.1-rc.1

This is a prerelease version of Bullseye.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Bullseye --version 4.2.1-rc.1                
NuGet\Install-Package Bullseye -Version 4.2.1-rc.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bullseye" Version="4.2.1-rc.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Bullseye --version 4.2.1-rc.1                
#r "nuget: Bullseye, 4.2.1-rc.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. 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=4.2.1-rc.1&prerelease

// Install Bullseye as a Cake Tool
#tool nuget:?package=Bullseye&version=4.2.1-rc.1&prerelease                

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 targets can do anything. They are not restricted to building .NET projects.

Platform support: .NET Standard 2.1 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 async Task Main(string[] args)
        {
            Target("default", () => System.Console.WriteLine("Hello, world!"));
            await RunTargetsAndExitAsync(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/147760642-36018691-4710-41be-bd65-5dcfac121fc5.png" width="357px" />

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/147761129-6eaced64-0a6f-4dea-bf73-57780f5d1124.png" width="374px" />

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/147761855-76d3a77a-4342-4b00-913b-a52188a65793.png" width="491px" />

Sample wrapper scripts

  • build

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

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

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.

FAQ

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

Yes! Add the following line anywhere before calling 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 RunTargetsAndExitAsync 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 repository or organisation to this list!


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

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on Bullseye:

Package Downloads
Apprio.Enablement.Infrastructure

Package Description

Faithlife.Build

A build automation system using C# build scripts.

Apprio.Azure.Infrastructure

Package Description

DevOpsTargets

A tools that are helping when deploying .NET and other applications.

Xenial.Beer

Beer - Delicious dotnet build tools

GitHub repositories (45)

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
xunit/xunit
xUnit.net is a free, open source, community-focused unit testing tool for .NET.
aaubry/YamlDotNet
YamlDotNet is a .NET library for YAML
adamhathcock/sharpcompress
SharpCompress is a fully managed C# library to deal with many compression types and formats.
AppMetrics/AppMetrics
App Metrics is an open-source and cross-platform .NET library used to record and report metrics within an application.
Version Downloads Last updated
5.0.0 188,324 1/15/2024
5.0.0-rc.1 600 12/21/2023
5.0.0-alpha.2 903 9/25/2023
5.0.0-alpha.1 1,000 6/9/2023
4.2.1 205,805 1/24/2023
4.2.1-rc.1 574 12/3/2022
4.2.0 65,384 11/9/2022
4.2.0-beta.1 394 10/30/2022
4.1.1 32,467 10/22/2022
4.1.0 1,026 10/16/2022
4.1.0-rc.1 234 10/9/2022
4.1.0-alpha.2 399 8/28/2022
4.1.0-alpha.1 4,068 3/13/2022
4.0.0 166,325 3/12/2022
4.0.0-rc.3 313 3/11/2022
4.0.0-rc.2 6,793 12/30/2021
4.0.0-rc.1 292 12/23/2021
4.0.0-beta.1 2,891 11/7/2021
4.0.0-alpha.2 269 11/6/2021
4.0.0-alpha.1 588 9/19/2021
3.8.0 939,659 8/20/2021
3.8.0-rc.1 461 8/3/2021
3.8.0-beta.1 249 7/28/2021
3.8.0-alpha.2 216 7/25/2021
3.8.0-alpha.1 228 7/25/2021
3.7.1 30,614 7/12/2021
3.7.0 638,089 1/20/2021
3.7.0-alpha.1 576 1/7/2021
3.6.0 40,380 1/1/2021
3.6.0-rc.1 1,286 12/22/2020
3.6.0-beta.1 322 12/4/2020
3.5.0 103,377 9/19/2020
3.5.0-rc.1 442 9/4/2020
3.4.0 50,249 7/26/2020
3.4.0-alpha.1 466 6/24/2020
3.3.0 248,821 4/2/2020
3.3.0-beta.1 423 3/6/2020
3.2.0 13,680 2/20/2020
3.2.0-rc.1 427 2/9/2020
3.2.0-alpha.2 611 12/26/2019
3.2.0-alpha.1 391 12/23/2019
3.1.0 83,497 12/7/2019
3.1.0-rc.1 971 11/13/2019
3.1.0-alpha.1 528 10/16/2019
3.0.0 66,061 10/13/2019
3.0.0-rc.1 4,346 9/8/2019
3.0.0-beta.3 887 8/27/2019
3.0.0-beta.2 270 8/25/2019
3.0.0-beta.1 291 8/25/2019
3.0.0-alpha.1 279 8/24/2019
2.4.0 6,801 7/27/2019
2.4.0-rc.2 16,502 7/15/2019
2.4.0-rc.1 253 7/15/2019
2.4.0-beta.1 734 6/28/2019
2.4.0-alpha.1 2,275 6/1/2019
2.3.0 67,069 12/17/2018
2.3.0-rc.1 2,234 12/14/2018
2.3.0-beta.6 897 12/8/2018
2.3.0-beta.5 365 12/8/2018
2.3.0-beta.4 343 12/7/2018
2.3.0-beta.3 403 12/4/2018
2.3.0-beta.2 369 11/30/2018
2.3.0-beta.1 352 11/27/2018
2.3.0-alpha.1 433 11/2/2018
2.2.0 5,237 10/19/2018
2.2.0-rc.2 392 10/13/2018
2.2.0-rc.1 381 10/13/2018
2.2.0-beta.2 391 10/12/2018
2.2.0-beta.1 401 10/11/2018
2.1.0 6,656 10/9/2018
2.1.0-beta.1 406 10/7/2018
2.0.0 1,089 10/7/2018
2.0.0-rc.3 519 9/30/2018
2.0.0-rc.2 433 9/27/2018
2.0.0-rc.1 398 9/26/2018
1.3.0 1,690 9/20/2018
1.2.0 5,498 9/3/2018
1.2.0-rc.2 13,972 9/2/2018
1.2.0-rc.1 418 9/2/2018
1.1.0 1,175 8/23/2018
1.1.0-rc.2 518 8/13/2018
1.1.0-rc.1 527 8/12/2018
1.0.1 1,117 8/2/2018
1.0.0 1,938 7/27/2018
1.0.0-rc.5 697 6/28/2018
1.0.0-rc.4 634 6/26/2018
1.0.0-rc.3 544 6/26/2018
1.0.0-rc.2 564 6/24/2018
1.0.0-rc.1 2,021 5/6/2018
1.0.0-alpha0002 898 11/17/2017
1.0.0-alpha0001 922 11/17/2017