Open jnm2 opened 8 years ago
@jnm2 Feels like something that could be added as an focused PoC extension method, but would need to give some thought on implications of this. @cake-build/team thoughts?
I'd love to see this feature implemented. As you said, that can be quite a time-saver in a CI.
@Roemer while this isn't baked in yet, it is possible to implement on your own.
Have a look here:
https://github.com/cake-contrib/Cake.Recipe/blob/develop/Cake.Recipe/Content/tools.cake#L21
with an example of it's use here:
Hope that helps!
Right now I have to choose between
#tool nuget:?package=SomePackageName
which runs for all tasks, evenClean
, andNuGetInstall("SomePackageName", new NuGetInstallSettings { OutputDirectory = buildToolsDir, ExcludeVersion = true });
inside theDoes
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 likeNuGetInstall
currently is.I'm willing to PR if you think this is a good addition.