2021-02-08 13:30:40 +03:00
|
|
|
# script inspired by https://andrewlock.net/simplifying-the-cake-global-tool-bootstrapper-scripts-in-netcore3-with-local-tools/
|
2019-02-12 16:05:51 +03:00
|
|
|
|
|
|
|
[CmdletBinding()]
|
|
|
|
Param(
|
|
|
|
[string]$Script = "build.cake",
|
|
|
|
[string]$Target,
|
|
|
|
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
|
|
|
|
[string[]]$ScriptArgs
|
|
|
|
)
|
|
|
|
|
2021-02-08 13:30:40 +03:00
|
|
|
# Restore Cake tool
|
2024-01-13 02:03:00 +03:00
|
|
|
& dotnet tool restore
|
|
|
|
# $tools = Get-Content ".config/dotnet-tools.json" | ConvertFrom-Json
|
|
|
|
# foreach ($tool in $tools.tools.PsObject.Properties) {
|
|
|
|
# & dotnet tool install $tool.Name --version $tool.Value.version
|
|
|
|
# }
|
2019-02-12 16:05:51 +03:00
|
|
|
|
|
|
|
# Build Cake arguments
|
|
|
|
$cakeArguments = @("$Script");
|
2021-02-08 13:30:40 +03:00
|
|
|
if ($Target) { $cakeArguments += "--target=$Target" }
|
2019-02-12 16:05:51 +03:00
|
|
|
$cakeArguments += $ScriptArgs
|
|
|
|
|
2021-02-08 13:30:40 +03:00
|
|
|
& dotnet tool run dotnet-cake -- $cakeArguments
|
2023-09-29 03:30:43 +03:00
|
|
|
exit $LASTEXITCODE
|