mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 18:23:04 +08:00
Fix build scripts not passing arguments to cake
This commit is contained in:
parent
3c5dc6da4a
commit
715fb88316
25
build.ps1
25
build.ps1
@ -1,4 +1,27 @@
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[string]$Target,
|
||||
[string]$Configuration,
|
||||
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
|
||||
[string]$Verbosity,
|
||||
[switch]$ShowDescription,
|
||||
[Alias("WhatIf", "Noop")]
|
||||
[switch]$DryRun,
|
||||
[Parameter(Position = 0, Mandatory = $false, ValueFromRemainingArguments = $true)]
|
||||
[string[]]$ScriptArgs
|
||||
)
|
||||
|
||||
# Build Cake arguments
|
||||
$cakeArguments = "";
|
||||
if ($Target) { $cakeArguments += "-target=$Target" }
|
||||
if ($Configuration) { $cakeArguments += "-configuration=$Configuration" }
|
||||
if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" }
|
||||
if ($ShowDescription) { $cakeArguments += "-showdescription" }
|
||||
if ($DryRun) { $cakeArguments += "-dryrun" }
|
||||
if ($Experimental) { $cakeArguments += "-experimental" }
|
||||
$cakeArguments += $ScriptArgs
|
||||
|
||||
dotnet tool install Cake.Tool --global --version 0.35.0
|
||||
dotnet cake ./build/build.cake --bootstrap
|
||||
dotnet cake ./build/build.cake
|
||||
dotnet cake ./build/build.cake $cakeArguments
|
||||
exit $LASTEXITCODE
|
16
build.sh
16
build.sh
@ -1,3 +1,17 @@
|
||||
echo "Installing Cake.Tool..."
|
||||
dotnet tool install Cake.Tool --global --version 0.35.0
|
||||
|
||||
# Parse arguments.
|
||||
CAKE_ARGUMENTS=()
|
||||
for i in "$@"; do
|
||||
case $1 in
|
||||
-s|--script) SCRIPT="$2"; shift ;;
|
||||
--) shift; CAKE_ARGUMENTS+=("$@"); break ;;
|
||||
*) CAKE_ARGUMENTS+=("$1") ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
echo "Running build script..."
|
||||
dotnet cake ./build/build.cake --bootstrap
|
||||
dotnet cake ./build/build.cake
|
||||
dotnet cake ./build/build.cake "${CAKE_ARGUMENTS[@]}"
|
Loading…
Reference in New Issue
Block a user