diff --git a/build.ps1 b/build.ps1 old mode 100644 new mode 100755 index c6a0bf6d4a..8eb37f2de6 --- a/build.ps1 +++ b/build.ps1 @@ -1,82 +1,4 @@ -########################################################################## -# This is a customized Cake bootstrapper script for PowerShell. -########################################################################## - -<# - -.SYNOPSIS -This is a Powershell script to bootstrap a Cake build. - -.DESCRIPTION -This Powershell script restores NuGet tools (including Cake) -and execute your Cake build script with the parameters you provide. - -.PARAMETER Script -The build script to execute. -.PARAMETER Target -The build script target to run. -.PARAMETER Configuration -The build configuration to use. -.PARAMETER Verbosity -Specifies the amount of information to be displayed. -.PARAMETER ShowDescription -Shows description about tasks. -.PARAMETER DryRun -Performs a dry run. -.PARAMETER ScriptArgs -Remaining arguments are added here. - -.LINK -https://cakebuild.net - -#> - -[CmdletBinding()] -Param( - [string]$Script = "build.cake", - [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 -) - -Write-Host "Preparing to run build script..." - -# Determine the script root for resolving other paths. -if(!$PSScriptRoot) { - $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent -} - -# Resolve the paths for resources used for debugging. -$BUILD_DIR = Join-Path $PSScriptRoot "build" -$TOOLS_DIR = Join-Path $BUILD_DIR "tools" -$CAKE_CSPROJ = Join-Path $BUILD_DIR "cakebuild.csproj" - -# Install the required tools locally. -Write-Host "Restoring cake tools..." -Invoke-Expression "dotnet restore `"$CAKE_CSPROJ`" --packages `"$TOOLS_DIR`"" | Out-Null - -# Find the Cake executable -$CAKE_EXECUTABLE = (Get-ChildItem -Path "$TOOLS_DIR/cake.coreclr/" -Filter Cake.dll -Recurse).FullName - -# Build Cake arguments -$cakeArguments = @("$Script"); -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 - -# Start Cake -Write-Host "Running build script..." -Push-Location -Path $BUILD_DIR -Invoke-Expression "dotnet `"$CAKE_EXECUTABLE`" $cakeArguments" -Pop-Location -exit $LASTEXITCODE +dotnet tool install Cake.Tool --global --version 0.35.0 +dotnet cake ./build/build.cake --bootstrap +dotnet cake ./build/build.cake +exit $LASTEXITCODE \ No newline at end of file diff --git a/build.sh b/build.sh index 8f1ef5b455..d20a9c12fa 100755 --- a/build.sh +++ b/build.sh @@ -1,38 +1,3 @@ -#!/usr/bin/env bash - -########################################################################## -# This is a customized Cake bootstrapper script for Shell. -########################################################################## - -echo "Preparing to run build script..." - -cd build -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=$SCRIPT_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[@]}" +dotnet tool install Cake.Tool --global --version 0.35.0 +dotnet cake ./build/build.cake --bootstrap +dotnet cake ./build/build.cake \ No newline at end of file