1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:47:27 +08:00

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.
This commit is contained in:
miterosan 2018-10-04 18:57:14 +02:00
parent e47be64f91
commit 0724b47334
5 changed files with 21 additions and 23 deletions

3
.gitignore vendored
View File

@ -12,8 +12,7 @@
### Cake ### ### Cake ###
tools/* tools/*
!tools/packages.config !tools/cakebuild.csproj
!tools/cake.csproj
# Build results # Build results
bin/[Dd]ebug/ bin/[Dd]ebug/

View File

@ -1,7 +1,5 @@
########################################################################## ##########################################################################
# This is the Cake bootstrapper script for PowerShell. # This is a customized 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.
########################################################################## ##########################################################################
<# <#
@ -10,7 +8,7 @@
This is a Powershell script to bootstrap a Cake build. This is a Powershell script to bootstrap a Cake build.
.DESCRIPTION .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. and execute your Cake build script with the parameters you provide.
.PARAMETER Script .PARAMETER Script
@ -49,17 +47,21 @@ Param(
Write-Host "Preparing to run build script..." Write-Host "Preparing to run build script..."
# Determine the script root for resolving other paths.
if(!$PSScriptRoot){ if(!$PSScriptRoot){
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
} }
# Resolve the paths for resources used for debugging.
$TOOLS_DIR = Join-Path $PSScriptRoot "tools" $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 # 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 # Build Cake arguments
$cakeArguments = @("$Script"); $cakeArguments = @("$Script");
@ -69,7 +71,6 @@ if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" }
if ($ShowDescription) { $cakeArguments += "-showdescription" } if ($ShowDescription) { $cakeArguments += "-showdescription" }
if ($DryRun) { $cakeArguments += "-dryrun" } if ($DryRun) { $cakeArguments += "-dryrun" }
if ($Experimental) { $cakeArguments += "-experimental" } if ($Experimental) { $cakeArguments += "-experimental" }
if ($Mono) { $cakeArguments += "-mono" }
$cakeArguments += $ScriptArgs $cakeArguments += $ScriptArgs
# Start Cake # Start Cake

View File

@ -1,9 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cake.CoreCLR" Version="0.29.0" />
</ItemGroup>
</Project>

11
tools/cakebuild.csproj Normal file
View File

@ -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>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cake.CoreClr" version="0.29.0" />
</packages>