mirror of
https://github.com/ppy/osu.git
synced 2024-11-14 15:57:24 +08:00
38 lines
1021 B
Bash
38 lines
1021 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
##########################################################################
|
||
|
# This is a customized Cake bootstrapper script for Shell.
|
||
|
##########################################################################
|
||
|
|
||
|
echo "Preparing to run build script..."
|
||
|
|
||
|
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||
|
TOOLS_DIR=$SCRIPT_DIR/tools
|
||
|
CAKE_BINARY_PATH=$TOOLS_DIR/"cake.coreclr"
|
||
|
|
||
|
SCRIPT="build.cake"
|
||
|
CAKE_CSPROJ=$TOOLS_DIR/"cakebuild.csproj"
|
||
|
|
||
|
# 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
|
||
|
|
||
|
# Install the required tools locally.
|
||
|
echo "Restoring cake tools..."
|
||
|
dotnet restore $CAKE_CSPROJ --packages $TOOLS_DIR > /dev/null 2>&1
|
||
|
|
||
|
# Search for the CakeBuild binary.
|
||
|
CAKE_BINARY=$(find $CAKE_BINARY_PATH -name "Cake.dll")
|
||
|
|
||
|
# Start Cake
|
||
|
echo "Running build script..."
|
||
|
|
||
|
dotnet "$CAKE_BINARY" $SCRIPT "${CAKE_ARGUMENTS[@]}"
|