cake-build / cake-build/cake

Request for Task.Tool("nuget:?package=etc")

Open
#1,269 3 comments 0 reactions 0 assignees View on GitHub
Response from Cake team required
Dominant language
C#
Stars
4.2k
Forks
778
Avg merge
1h 15m
Merged PRs (30d)
19

Description

Right now I have to choose between `#tool nuget:?package=SomePackageName` which runs for all tasks, even `Clean`, and `NuGetInstall("SomePackageName", new NuGetInstallSettings { OutputDirectory = buildToolsDir, ExcludeVersion = true });` inside the `Does` block which only runs when needed.

What if there was a Task builder method so we could specify `.Tool("nuget:?package=SomePackageName")` right on the Task declaration? That feels much cleaner to me, especially on a build server than may not even need to download the tool for the target it's running.

For efficiency, the tool reference could probably still be collected and updated in the same batch as the `#tool` directives; it wouldn't even be a separate call like `NuGetInstall` currently is.

I'm willing to PR if you think this is a good addition.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the Task declaration API and the existing #tool and NuGetInstall paths. Determine how task-local tool references can be collected with #tool directives while remaining conditional on the selected task. Done means a Task builder can express the requested tool and the behavior is covered by the relevant existing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.