From 0724b47334e2e51558b23fbcb3f65cbee13e5243 Mon Sep 17 00:00:00 2001 From: miterosan Date: Thu, 4 Oct 2018 18:57:14 +0200 Subject: [PATCH] Minify the buildscript and update to cake.0.30.0 Also remove the dependency on Cake.CoreCLR cake.tool does not use the packages.config. --- .gitignore | 3 +-- build.ps1 | 17 +++++++++-------- tools/cake.csproj | 9 --------- tools/cakebuild.csproj | 11 +++++++++++ tools/packages.config | 4 ---- 5 files changed, 21 insertions(+), 23 deletions(-) delete mode 100644 tools/cake.csproj create mode 100644 tools/cakebuild.csproj delete mode 100644 tools/packages.config diff --git a/.gitignore b/.gitignore index c75c19f9f5..8f011deabe 100644 --- a/.gitignore +++ b/.gitignore @@ -12,8 +12,7 @@ ### Cake ### tools/* -!tools/packages.config -!tools/cake.csproj +!tools/cakebuild.csproj # Build results bin/[Dd]ebug/ diff --git a/build.ps1 b/build.ps1 index e923331793..64303e67d5 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,7 +1,5 @@ ########################################################################## -# This is the Cake bootstrapper script for PowerShell. -# This file was downloaded from https://github.com/cake-build/resources -# Feel free to change this file to fit your needs. +# This is a customized Cake bootstrapper script for PowerShell. ########################################################################## <# @@ -10,7 +8,7 @@ This is a Powershell script to bootstrap a Cake build. .DESCRIPTION -This Powershell script will download NuGet if missing, restore NuGet tools (including Cake) +This Powershell script restores NuGet tools (including Cake) and execute your Cake build script with the parameters you provide. .PARAMETER Script @@ -49,17 +47,21 @@ Param( 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. $TOOLS_DIR = Join-Path $PSScriptRoot "tools" -$CAKE_CSPROJ = Join-Path $TOOLS_DIR "cake.csproj" +$CAKE_CSPROJ = Join-Path $TOOLS_DIR "cakebootstrap.csproj" -Invoke-Expression "dotnet restore `"$CAKE_CSPROJ`" --packages `"$TOOLS_DIR`"" +# 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/cake.coreclr/ -Filter Cake.dll -Recurse).FullName +$CAKE_EXECUTABLE = (Get-ChildItem -Path ./tools/cake.tool/ -Filter Cake.dll -Recurse).FullName # Build Cake arguments $cakeArguments = @("$Script"); @@ -69,7 +71,6 @@ if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" } if ($ShowDescription) { $cakeArguments += "-showdescription" } if ($DryRun) { $cakeArguments += "-dryrun" } if ($Experimental) { $cakeArguments += "-experimental" } -if ($Mono) { $cakeArguments += "-mono" } $cakeArguments += $ScriptArgs # Start Cake diff --git a/tools/cake.csproj b/tools/cake.csproj deleted file mode 100644 index 06692627d2..0000000000 --- a/tools/cake.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - Exe - netcoreapp2.0 - - - - - \ No newline at end of file diff --git a/tools/cakebuild.csproj b/tools/cakebuild.csproj new file mode 100644 index 0000000000..eaa25ccb24 --- /dev/null +++ b/tools/cakebuild.csproj @@ -0,0 +1,11 @@ + + + Exe + true + netcoreapp2.0 + + + + + + \ No newline at end of file diff --git a/tools/packages.config b/tools/packages.config deleted file mode 100644 index e37e9304d5..0000000000 --- a/tools/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - -