You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need a common way of registering and resolving tools/addins in Cake. There are some addins that require this functionality, and it would be nice to actually have a proper tool resolution strategy in place that we can use outside of tools.
Should allow a user to globally set a tool path from the script.
Should be able to register tools by their file name.
Should be able to resolve tools by their file name.
The IPackageInstaller implementations should be able to:
Register paths to downloaded tools.
This would allow us to version tools correctly.
Proposition (API)
// Not super happy about this name.publicinterfaceIToolService{voidRegister(FilePathpath);
FilePath Resolve(stringtool);}publicinterfaceICakeContext{IToolServiceTools{get;}}
Proposition (implementation)
Someone who wants to override this behavior could easily use
the default implementation and only provide a new IToolResolutionStrategy.
Of course we need to have a mechanism to register services before
the Cake container has been fully built but that's a problem for
another issue.
// Register a tool.
context.Tools.Register("C:/Temp/xunit-console.exe");// Later in the xUnit tool wrapper, we resolve it like this.varpath= context.Tools.Resolve("xunit-console.exe");
The text was updated successfully, but these errors were encountered:
Would it be possible at the same time the support of "Tools" which don't need to provide ".exe" Files? We have for example another NuGet Package which includes MsBuild Loggers we would like to use. If that would be supported, we could do something like the following in order to resolve the path to the logger.
var path = context.Tools.Resolve("MsBuildXmlLogger.dll");
@stffabi Thanks for your feedback! Add an issue about that you want tools to be able to consist of *.dll as well and we can continue the discussion there.
We need a common way of registering and resolving tools/addins in Cake. There are some addins that require this functionality, and it would be nice to actually have a proper tool resolution strategy in place that we can use outside of tools.
IPackageInstaller
implementations should be able to:This would allow us to version tools correctly.
Proposition (API)
Proposition (implementation)
Someone who wants to override this behavior could easily use
the default implementation and only provide a new
IToolResolutionStrategy
.Of course we need to have a mechanism to register services before
the Cake container has been fully built but that's a problem for
another issue.
Usage
The text was updated successfully, but these errors were encountered: