Open augustoproiete opened 3 years ago
Implementation question:
./.cake/tools/
or ./.cake/
? I know the request says ./.cake/
, but I feel like putting the tools under ./.cake/tools/
might be a better long-term option.
If no one has picked this up by the weekend, I'll likely play around with it - just wanted to bring that up for discussion before any work began on the issue. Never mind, I didn't realize you had self-assigned the issue.
Hey @joshuacookdev,
TL;DR; I think ./.cake/tools/
is a good idea and probably where we'd want to get to, but let's do that as a separate issue to make it easier to review, test, & merge this one.
Long version:
At the moment, if you have (for example) a Cake script like the following:
#addin "nuget:?package=Cake.ExcelDnaPack&version=1.0.1"
#module "nuget:?package=Cake.BuildSystems.Module&version=3.0.3"
#tool "nuget:?package=7-Zip.CommandLine"
#load "nuget:?package=Cake.Recipe&version=2.2.1"
You'll end up with with a folder structure like this:
As you can see, Cake #addin
s and #module
s get their own folder, but #tool
s and #recipe
s don't, and their packages are extracted to the root of the configured tools
folder.
I think it would make sense to have #tool
s and #recipe
s in their own folders, but that might have a bigger impact and require a more thorough testing, and probably make this PR harder to review and merge.
I suggest we keep the scope of this one small, just renaming the default tools
folder to .cake
and we create two separate issues to be implemented after this one is merged:
#tool
s to .cake/tools
instead of .cake
#recipe
s to .cake/recipes
instead of .cake
As we all know, Cake uses a folder for downloading and extracting NuGet packages (and other things), and by default it uses a
./tools
folder.There a couple of (small) issues I've seen because of that:
Adding Cake to existing projects (any language/platform)
./tools
is a common enough name that some projects use for other purposes (even internal to the project) and when introducing Cake to existing projects that already define a./tools
folder, one needs to be careful to ensure Cake won't touch that folder and will use a different folder instead, which is not as straightforward as changing thecake.config
as sometimes that means adapting bootstrappers that don't honor what's set in thecake.config
.Adding Cake to new projects (.NET-specific) When starting a new project, it's common for devs to use the default
VisualStudio.gitignore
on GitHub. The good news is that this .gitignore already brings a couple of lines specific to Cake. The bad news is that they are commented out, because having a./tools
by default would be too broad of a rule.If Cake started using a
.cake
folder (or similar), it would avoid the issues above as it's unlikely users would have a.cake
folder for a different purpose other than using Cake, and it would be specific enough to be included in theVisualStudio.gitignore
template.