Skip to content

Commit

Permalink
Minify the buildscript and update to cake.0.30.0
Browse files Browse the repository at this point in the history
Also remove the dependency on Cake.CoreCLR
cake.tool does not use the packages.config.
  • Loading branch information
miterosan committed Oct 4, 2018
1 parent e47be64 commit 0724b47
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 23 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

### Cake ###
tools/*
!tools/packages.config
!tools/cake.csproj
!tools/cakebuild.csproj

# Build results
bin/[Dd]ebug/
Expand Down
17 changes: 9 additions & 8 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -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.
##########################################################################

<#
Expand All @@ -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
Expand Down Expand Up @@ -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");
Expand All @@ -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
Expand Down
9 changes: 0 additions & 9 deletions tools/cake.csproj

This file was deleted.

11 changes: 11 additions & 0 deletions tools/cakebuild.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<PackAsTool>true</PackAsTool>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cake" Version="0.30.0" />
<DotnetCliToolReference Include="Cake.Tool" Version="0.30.0" />
</ItemGroup>
</Project>
4 changes: 0 additions & 4 deletions tools/packages.config

This file was deleted.

0 comments on commit 0724b47

Please sign in to comment.