forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathbuild.ps1
24 lines (20 loc) · 767 Bytes
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# script inspired by https://andrewlock.net/simplifying-the-cake-global-tool-bootstrapper-scripts-in-netcore3-with-local-tools/
[CmdletBinding()]
Param(
[string]$Script = "build.cake",
[string]$Target,
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
[string[]]$ScriptArgs
)
# Restore Cake tool
& 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
# }
# Build Cake arguments
$cakeArguments = @("$Script");
if ($Target) { $cakeArguments += "--target=$Target" }
$cakeArguments += $ScriptArgs
& dotnet tool run dotnet-cake -- $cakeArguments
exit $LASTEXITCODE