Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Commit a478adc

Browse files
committed
Merge branch 'release/0.9.0'
2 parents dcc2d14 + 7507b99 commit a478adc

18 files changed

+275
-123
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#---------------------------------#
22
# Build Image #
33
#---------------------------------#
4-
image: Visual Studio 2017
4+
image: Visual Studio 2019
55

66
#---------------------------------#
77
# Build Script #

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# These owners will be the default owners for everything in the repo and
22
# will be requested for review when someone opens a pull request.
3-
* @pascalberger @christianbumann @x-jokay @silanosa @georgesgoetz
3+
* @cake-contrib/team-bbt @x-jokay

build.ps1

Lines changed: 87 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
##########################################################################
66

77
<#
8+
89
.SYNOPSIS
910
This is a Powershell script to bootstrap a Cake build.
11+
1012
.DESCRIPTION
1113
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
1214
and execute your Cake build script with the parameters you provide.
15+
1316
.PARAMETER Script
1417
The build script to execute.
1518
.PARAMETER Target
@@ -18,19 +21,22 @@ The build script target to run.
1821
The build configuration to use.
1922
.PARAMETER Verbosity
2023
Specifies the amount of information to be displayed.
24+
.PARAMETER ShowDescription
25+
Shows description about tasks.
26+
.PARAMETER DryRun
27+
Performs a dry run.
2128
.PARAMETER Experimental
22-
Tells Cake to use the latest Roslyn release.
23-
.PARAMETER WhatIf
24-
Performs a dry run of the build script.
25-
No tasks will be executed.
29+
Uses the nightly builds of the Roslyn script engine.
2630
.PARAMETER Mono
27-
Tells Cake to use the Mono scripting engine.
31+
Uses the Mono Compiler rather than the Roslyn script engine.
2832
.PARAMETER SkipToolPackageRestore
2933
Skips restoring of packages.
3034
.PARAMETER ScriptArgs
3135
Remaining arguments are added here.
36+
3237
.LINK
33-
http://cakebuild.net
38+
https://cakebuild.net
39+
3440
#>
3541

3642
[CmdletBinding()]
@@ -41,9 +47,10 @@ Param(
4147
[string]$Configuration = "Release",
4248
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
4349
[string]$Verbosity = "Verbose",
50+
[switch]$ShowDescription,
51+
[Alias("WhatIf", "Noop")]
52+
[switch]$DryRun,
4453
[switch]$Experimental,
45-
[Alias("DryRun","Noop")]
46-
[switch]$WhatIf,
4754
[switch]$Mono,
4855
[switch]$SkipToolPackageRestore,
4956
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
@@ -75,38 +82,31 @@ function MD5HashFile([string] $filePath)
7582
}
7683
}
7784

85+
function GetProxyEnabledWebClient
86+
{
87+
$wc = New-Object System.Net.WebClient
88+
$proxy = [System.Net.WebRequest]::GetSystemWebProxy()
89+
$proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
90+
$wc.Proxy = $proxy
91+
return $wc
92+
}
93+
7894
Write-Host "Preparing to run build script..."
7995

8096
if(!$PSScriptRoot){
8197
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
8298
}
8399

84100
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
101+
$ADDINS_DIR = Join-Path $TOOLS_DIR "Addins"
102+
$MODULES_DIR = Join-Path $TOOLS_DIR "Modules"
85103
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
86104
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
87105
$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
88106
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
89107
$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"
90-
91-
# Should we use mono?
92-
$UseMono = "";
93-
if($Mono.IsPresent) {
94-
Write-Verbose -Message "Using the Mono based scripting engine."
95-
$UseMono = "-mono"
96-
}
97-
98-
# Should we use the new Roslyn?
99-
$UseExperimental = "";
100-
if($Experimental.IsPresent -and !($Mono.IsPresent)) {
101-
Write-Verbose -Message "Using experimental version of Roslyn."
102-
$UseExperimental = "-experimental"
103-
}
104-
105-
# Is this a dry run?
106-
$UseDryRun = "";
107-
if($WhatIf.IsPresent) {
108-
$UseDryRun = "-dryrun"
109-
}
108+
$ADDINS_PACKAGES_CONFIG = Join-Path $ADDINS_DIR "packages.config"
109+
$MODULES_PACKAGES_CONFIG = Join-Path $MODULES_DIR "packages.config"
110110

111111
# Make sure tools folder exists
112112
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
@@ -116,16 +116,18 @@ if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
116116

117117
# Make sure that packages.config exist.
118118
if (!(Test-Path $PACKAGES_CONFIG)) {
119-
Write-Verbose -Message "Downloading packages.config..."
120-
try { (New-Object System.Net.WebClient).DownloadFile("http://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch {
119+
Write-Verbose -Message "Downloading packages.config..."
120+
try {
121+
$wc = GetProxyEnabledWebClient
122+
$wc.DownloadFile("https://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch {
121123
Throw "Could not download packages.config."
122124
}
123125
}
124126

125127
# Try find NuGet.exe in path if not exists
126128
if (!(Test-Path $NUGET_EXE)) {
127129
Write-Verbose -Message "Trying to find nuget.exe in PATH..."
128-
$existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_) }
130+
$existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_ -PathType Container) }
129131
$NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1
130132
if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) {
131133
Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)."
@@ -137,7 +139,8 @@ if (!(Test-Path $NUGET_EXE)) {
137139
if (!(Test-Path $NUGET_EXE)) {
138140
Write-Verbose -Message "Downloading NuGet.exe..."
139141
try {
140-
(New-Object System.Net.WebClient).DownloadFile($NUGET_URL, $NUGET_EXE)
142+
$wc = GetProxyEnabledWebClient
143+
$wc.DownloadFile($NUGET_URL, $NUGET_EXE)
141144
} catch {
142145
Throw "Could not download NuGet.exe."
143146
}
@@ -160,16 +163,51 @@ if(-Not $SkipToolPackageRestore.IsPresent) {
160163
}
161164

162165
Write-Verbose -Message "Restoring tools from NuGet..."
163-
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -PreRelease -OutputDirectory `"$TOOLS_DIR`" -Source https://www.myget.org/F/cake/api/v3/index.json"
166+
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""
164167

165168
if ($LASTEXITCODE -ne 0) {
166-
Throw "An error occured while restoring NuGet tools."
169+
Throw "An error occurred while restoring NuGet tools."
167170
}
168171
else
169172
{
170173
$md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII"
171174
}
172175
Write-Verbose -Message ($NuGetOutput | out-string)
176+
177+
Pop-Location
178+
}
179+
180+
# Restore addins from NuGet
181+
if (Test-Path $ADDINS_PACKAGES_CONFIG) {
182+
Push-Location
183+
Set-Location $ADDINS_DIR
184+
185+
Write-Verbose -Message "Restoring addins from NuGet..."
186+
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$ADDINS_DIR`""
187+
188+
if ($LASTEXITCODE -ne 0) {
189+
Throw "An error occurred while restoring NuGet addins."
190+
}
191+
192+
Write-Verbose -Message ($NuGetOutput | out-string)
193+
194+
Pop-Location
195+
}
196+
197+
# Restore modules from NuGet
198+
if (Test-Path $MODULES_PACKAGES_CONFIG) {
199+
Push-Location
200+
Set-Location $MODULES_DIR
201+
202+
Write-Verbose -Message "Restoring modules from NuGet..."
203+
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$MODULES_DIR`""
204+
205+
if ($LASTEXITCODE -ne 0) {
206+
Throw "An error occurred while restoring NuGet modules."
207+
}
208+
209+
Write-Verbose -Message ($NuGetOutput | out-string)
210+
173211
Pop-Location
174212
}
175213

@@ -178,7 +216,20 @@ if (!(Test-Path $CAKE_EXE)) {
178216
Throw "Could not find Cake.exe at $CAKE_EXE"
179217
}
180218

219+
220+
221+
# Build Cake arguments
222+
$cakeArguments = @("$Script");
223+
if ($Target) { $cakeArguments += "-target=$Target" }
224+
if ($Configuration) { $cakeArguments += "-configuration=$Configuration" }
225+
if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" }
226+
if ($ShowDescription) { $cakeArguments += "-showdescription" }
227+
if ($DryRun) { $cakeArguments += "-dryrun" }
228+
if ($Experimental) { $cakeArguments += "-experimental" }
229+
if ($Mono) { $cakeArguments += "-mono" }
230+
$cakeArguments += $ScriptArgs
231+
181232
# Start Cake
182233
Write-Host "Running build script..."
183-
Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs"
184-
exit $LASTEXITCODE
234+
&$CAKE_EXE $cakeArguments
235+
exit $LASTEXITCODE

build.sh

Lines changed: 55 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,103 @@
11
#!/usr/bin/env bash
2-
###############################################################
3-
# This is the Cake bootstrapper script that is responsible for
4-
# downloading Cake and all specified tools from NuGet.
5-
###############################################################
2+
##########################################################################
3+
# This is the Cake bootstrapper script for Linux and OS X.
4+
# This file was downloaded from https://github.com/cake-build/resources
5+
# Feel free to change this file to fit your needs.
6+
##########################################################################
67

78
# Define directories.
89
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
910
TOOLS_DIR=$SCRIPT_DIR/tools
1011
NUGET_EXE=$TOOLS_DIR/nuget.exe
11-
CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe
12+
NUGET_URL=https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
13+
CAKE_VERSION=0.32.1
14+
CAKE_EXE=$TOOLS_DIR/Cake.$CAKE_VERSION/Cake.exe
15+
16+
# Temporarily skip verification of addins.
17+
export CAKE_SETTINGS_SKIPVERIFICATION='true'
1218

1319
# Define default arguments.
1420
SCRIPT="recipe.cake"
1521
TARGET="Default"
1622
CONFIGURATION="Release"
1723
VERBOSITY="verbose"
1824
DRYRUN=
19-
SHOW_VERSION=false
2025
SCRIPT_ARGUMENTS=()
2126

2227
# Parse arguments.
2328
for i in "$@"; do
2429
case $1 in
25-
-s|--script) SCRIPT="$2"; shift ;;
2630
-t|--target) TARGET="$2"; shift ;;
2731
-c|--configuration) CONFIGURATION="$2"; shift ;;
2832
-v|--verbosity) VERBOSITY="$2"; shift ;;
2933
-d|--dryrun) DRYRUN="-dryrun" ;;
30-
--version) SHOW_VERSION=true ;;
3134
--) shift; SCRIPT_ARGUMENTS+=("$@"); break ;;
3235
*) SCRIPT_ARGUMENTS+=("$1") ;;
3336
esac
3437
shift
3538
done
3639

3740
# Make sure the tools folder exist.
38-
if [ ! -d $TOOLS_DIR ]; then
39-
mkdir $TOOLS_DIR
41+
if [ ! -d "$TOOLS_DIR" ]; then
42+
mkdir "$TOOLS_DIR"
4043
fi
4144

42-
# Make sure that packages.config exist.
43-
if [ ! -f $TOOLS_DIR/packages.config ]; then
44-
echo "Downloading packages.config..."
45-
curl -Lsfo $TOOLS_DIR/packages.config http://cakebuild.net/bootstrapper/packages
46-
if [ $? -ne 0 ]; then
47-
echo "An error occured while downloading packages.config."
48-
exit 1
49-
fi
45+
# Print Mono version.
46+
echo "Mono version:"
47+
mono --version
48+
echo ""
49+
50+
###########################################################################
51+
# INSTALL .NET CORE CLI
52+
###########################################################################
53+
54+
echo "Installing .NET CLI..."
55+
if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then
56+
mkdir "$SCRIPT_DIR/.dotnet"
5057
fi
58+
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh
59+
sudo bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version 2.1.400 --install-dir .dotnet --no-path
60+
export PATH="$SCRIPT_DIR/.dotnet":$PATH
61+
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
62+
export DOTNET_CLI_TELEMETRY_OPTOUT=1
63+
export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0
64+
"$SCRIPT_DIR/.dotnet/dotnet" --info
65+
66+
###########################################################################
67+
# INSTALL NUGET
68+
###########################################################################
5169

5270
# Download NuGet if it does not exist.
53-
if [ ! -f $NUGET_EXE ]; then
71+
if [ ! -f "$NUGET_EXE" ]; then
5472
echo "Downloading NuGet..."
55-
curl -Lsfo $NUGET_EXE https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
73+
curl -Lsfo "$NUGET_EXE" $NUGET_URL
5674
if [ $? -ne 0 ]; then
57-
echo "An error occured while downloading nuget.exe."
75+
echo "An error occurred while downloading nuget.exe."
5876
exit 1
5977
fi
6078
fi
6179

62-
# Restore tools from NuGet.
63-
pushd $TOOLS_DIR >/dev/null
64-
mono $NUGET_EXE install -ExcludeVersion -PreRelease -Source https://www.myget.org/F/cake/api/v3/index.json
65-
if [ $? -ne 0 ]; then
66-
echo "Could not restore NuGet packages."
67-
exit 1
80+
###########################################################################
81+
# INSTALL CAKE
82+
###########################################################################
83+
84+
if [ ! -f "$CAKE_EXE" ]; then
85+
mono "$NUGET_EXE" install Cake -Version $CAKE_VERSION -OutputDirectory "$TOOLS_DIR"
86+
if [ $? -ne 0 ]; then
87+
echo "An error occurred while installing Cake."
88+
exit 1
89+
fi
6890
fi
69-
popd >/dev/null
7091

7192
# Make sure that Cake has been installed.
72-
if [ ! -f $CAKE_EXE ]; then
93+
if [ ! -f "$CAKE_EXE" ]; then
7394
echo "Could not find Cake.exe at '$CAKE_EXE'."
7495
exit 1
7596
fi
7697

98+
###########################################################################
99+
# RUN BUILD SCRIPT
100+
###########################################################################
101+
77102
# Start Cake
78-
if $SHOW_VERSION; then
79-
exec mono $CAKE_EXE -version
80-
else
81-
exec mono $CAKE_EXE $SCRIPT -verbosity=$VERBOSITY -configuration=$CONFIGURATION -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}"
82-
fi
103+
exec mono "$CAKE_EXE" $SCRIPT --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}"

nuspec/nuget/Cake.Issues.Reporting.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
2222
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.Reporting.git"/>
2323
<copyright>Copyright © BBT Software AG and contributors</copyright>
2424
<tags>Cake Script Cake-Issues CodeAnalysis Linting Issues Reporting</tags>
25-
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Reporting/releases/tag/0.8.0</releaseNotes>
25+
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Reporting/releases/tag/0.9.0</releaseNotes>
2626
</metadata>
2727
<files>
2828
<file src="..\..\..\..\nuspec\nuget\icon.png" target="" />

0 commit comments

Comments
 (0)