重新定位 Cakes 的工具目录
Relocate Cakes's tools directory
我们的一些项目有自己的工具目录,所以将工具添加到 .gitignore 不是一个选项
在build.ps1中,我试过修改这个:
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
对此:
$TOOLS_DIR = Join-Path $PSScriptRoot "caketools"
但是 Nuget 获取的工具,例如。 NUnit.ConsoleRunner,仍然隐式提取到工具。
我还尝试通过向 .gitignore 添加更具体的排除项来让 Cake 与我的项目工具一起使用,例如:
# Cake
tools/Cake
tools/NUnit.ConsoleRunner*
tools/nuget.exe
tools/packages*
但问题是 Cake "owns" 工具文件夹,因此擦除项目工具文件夹中已有的目录。
查看此处的文档:
https://cakebuild.net/docs/fundamentals/configuration
可以通过环境变量、命令行参数或配置文件将配置值传递给 Cake,以指示 Cake 将哪个文件夹用于工具、插件和模块文件夹。
本页详细介绍了所有可用的配置选项:
https://cakebuild.net/docs/fundamentals/default-configuration-values
默认配置值为:
; This is the default configuration file for Cake.
; This file was downloaded from https://github.com/cake-build/resources
[Nuget]
Source=https://api.nuget.org/v3/index.json
UseInProcessClient=true
LoadDependencies=false
[Paths]
Tools=./tools
Addins=./tools/Addins
Modules=./tools/Modules
[Settings]
SkipVerification=false
当保存在 cake.config 文件中时,您可以将其放在存储库的根目录中,Cake.exe 将遵守此位置。如果您使用的是引导程序,您仍然需要修改它以使用相同的位置,因为它对 cake.config 文件一无所知。
我们的一些项目有自己的工具目录,所以将工具添加到 .gitignore 不是一个选项
在build.ps1中,我试过修改这个:
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
对此:
$TOOLS_DIR = Join-Path $PSScriptRoot "caketools"
但是 Nuget 获取的工具,例如。 NUnit.ConsoleRunner,仍然隐式提取到工具。
我还尝试通过向 .gitignore 添加更具体的排除项来让 Cake 与我的项目工具一起使用,例如:
# Cake
tools/Cake
tools/NUnit.ConsoleRunner*
tools/nuget.exe
tools/packages*
但问题是 Cake "owns" 工具文件夹,因此擦除项目工具文件夹中已有的目录。
查看此处的文档:
https://cakebuild.net/docs/fundamentals/configuration
可以通过环境变量、命令行参数或配置文件将配置值传递给 Cake,以指示 Cake 将哪个文件夹用于工具、插件和模块文件夹。
本页详细介绍了所有可用的配置选项:
https://cakebuild.net/docs/fundamentals/default-configuration-values
默认配置值为:
; This is the default configuration file for Cake.
; This file was downloaded from https://github.com/cake-build/resources
[Nuget]
Source=https://api.nuget.org/v3/index.json
UseInProcessClient=true
LoadDependencies=false
[Paths]
Tools=./tools
Addins=./tools/Addins
Modules=./tools/Modules
[Settings]
SkipVerification=false
当保存在 cake.config 文件中时,您可以将其放在存储库的根目录中,Cake.exe 将遵守此位置。如果您使用的是引导程序,您仍然需要修改它以使用相同的位置,因为它对 cake.config 文件一无所知。