Skip to content

Commit e179aeb

Browse files
committed
Merge branch 'release/1.0.0'
2 parents 53cc83a + ae2c512 commit e179aeb

File tree

11 files changed

+127
-56
lines changed

11 files changed

+127
-56
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ branches:
2727
# Build Cache #
2828
#---------------------------------#
2929
cache:
30-
- tools -> setup.cake
30+
- tools -> recipe.cake

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These owners will be the default owners for everything in the repo and
2+
# will be requested for review when someone opens a pull request.
3+
* @cake-contrib/team-bbt @jokay

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Project specific
1+
# Project specific
22

33
BuildArtifacts/
44

@@ -304,4 +304,6 @@ __pycache__/
304304
# By default, sensitive information, such as encrypted password
305305
# should be stored in the .pubxml.user file.
306306

307-
# End of https://www.gitignore.io/api/cake,visualstudio
307+
# End of https://www.gitignore.io/api/cake,visualstudio
308+
309+
.dotnet

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ This addin for the Cake Build Automation System allows you to run [markdownlint]
2828

2929
- [Documentation](https://cake-contrib.github.io/Cake.Markdownlint)
3030

31-
## Chat Room
31+
## Discussion
3232

33-
Come join in the conversation about this addin in our Gitter Chat Room.
33+
For questions and to discuss ideas & feature requests, use the [GitHub discussions on the Cake GitHub repository](https://github.com/cake-build/cake/discussions), under the [Extension Q&A](https://github.com/cake-build/cake/discussions/categories/extension-q-a) category.
3434

35-
[![Join the chat at https://gitter.im/cake-contrib/Lobby](https://badges.gitter.im/cake-contrib/Lobby.svg)](https://gitter.im/cake-contrib/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
35+
[![Join in the discussion on the Cake repository](https://img.shields.io/badge/GitHub-Discussions-green?logo=github)](https://github.com/cake-build/cake/discussions)
3636

3737
## Contributing
3838

azure-pipelines.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ trigger:
66

77
pr:
88
- develop
9+
- release/*
10+
- hotfix/*
911

1012
jobs:
1113
- job: Windows
@@ -34,5 +36,17 @@ jobs:
3436
vmImage: 'ubuntu-16.04'
3537
steps:
3638
- bash: |
37-
./build.sh --verbosity Diagnostic
38-
displayName: 'Cake Build'
39+
mono --version
40+
displayName: 'Show Mono version'
41+
# Use Mono 6.6.0 until Cake.Recipe is compatible with Cake 0.37.0 which fixes this issue
42+
- bash: |
43+
sudo apt-get remove mono-complete mono-devel mono-gac mono-runtime-common monodoc-manual \
44+
&& sudo apt-get autoremove \
45+
&& echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial/snapshots/6.6.0.161 main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list \
46+
&& sudo apt-get update \
47+
&& sudo apt-get install -y --no-install-recommends mono-complete \
48+
&& mono --version
49+
displayName: 'Downgrade Mono to 6.6.0'
50+
- bash: |
51+
./build.sh --verbosity diagnostic
52+
displayName: 'Cake Build'

build.ps1

Lines changed: 86 additions & 35 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,32 +21,36 @@ 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
3338
https://cakebuild.net
39+
3440
#>
3541

3642
[CmdletBinding()]
3743
Param(
38-
[string]$Script = "setup.cake",
44+
[string]$Script = "recipe.cake",
3945
[string]$Target = "Default",
4046
[ValidateSet("Release", "Debug")]
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"
234+
&$CAKE_EXE $cakeArguments
184235
exit $LASTEXITCODE

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ CAKE_EXE=$TOOLS_DIR/Cake.$CAKE_VERSION/Cake.exe
1717
export CAKE_SETTINGS_SKIPVERIFICATION='true'
1818

1919
# Define default arguments.
20+
SCRIPT="recipe.cake"
2021
TARGET="Default"
2122
CONFIGURATION="Release"
2223
VERBOSITY="verbose"
@@ -99,4 +100,4 @@ fi
99100
###########################################################################
100101

101102
# Start Cake
102-
exec mono "$CAKE_EXE" setup.cake --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}"
103+
exec mono "$CAKE_EXE" $SCRIPT --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}"

nuspec/nuget/Cake.Markdownlint.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
This addin for Cake allows you to lint Markdown files using markdownlint.
1212
</description>
1313
<license type="expression">MIT</license>
14-
<projectUrl>http://cake-contrib.github.io/Cake.Markdownlint/</projectUrl>
14+
<projectUrl>https://cakebuild.net/extensions/cake-markdownlint/</projectUrl>
1515
<iconUrl>https://cdn.jsdelivr.net/gh/cake-contrib/graphics@a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png</iconUrl>
1616
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1717
<repository type="git" url="https://github.com/cake-contrib/Cake.Markdownlint.git"/>
1818
<copyright>Copyright © BBT Software AG and contributors</copyright>
1919
<tags>Cake Script Linting Markdown Markdownlint</tags>
20-
<releaseNotes>https://github.com/cake-contrib/Cake.Markdownlint/releases/tag/0.3.0</releaseNotes>
20+
<releaseNotes>https://github.com/cake-contrib/Cake.Markdownlint/releases/tag/1.0.0</releaseNotes>
2121
</metadata>
2222
<files>
2323
<file src="netstandard2.0\Cake.Markdownlint.dll" target="lib\netstandard2.0" />

setup.cake renamed to recipe.cake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Environment.SetVariableNames();
44

55
BuildParameters.SetParameters(
6-
context: Context,
6+
context: Context,
77
buildSystem: BuildSystem,
88
sourceDirectoryPath: "./src",
99
title: "Cake.Markdownlint",
@@ -18,7 +18,7 @@ BuildParameters.PrintParameters(Context);
1818
ToolSettings.SetToolSettings(
1919
context: Context,
2020
dupFinderExcludePattern: new string[] { BuildParameters.RootDirectoryPath + "/src/Cake.Markdownlint.Tests/*.cs" },
21-
testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* -[Shouldly]*",
21+
testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* -[Shouldly]* -[DiffEngine]* -[EmptyFiles]*",
2222
testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*",
2323
testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs");
2424

src/Cake.Markdownlint.Tests/Cake.Markdownlint.Tests.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.1</TargetFramework>
55
<IsPackable>false</IsPackable>
66
<Product>Cake.Markdownlint</Product>
77
<Copyright>Copyright © BBT Software AG and contributors</Copyright>
@@ -15,13 +15,13 @@
1515
</PropertyGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
19-
<PackageReference Include="Cake.Core" Version="0.33.0" />
20-
<PackageReference Include="Cake.Testing" Version="0.33.0" />
21-
<PackageReference Include="Shouldly" Version="3.0.2" />
18+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
19+
<PackageReference Include="Cake.Core" Version="1.0.0" />
20+
<PackageReference Include="Cake.Testing" Version="1.0.0" />
21+
<PackageReference Include="Shouldly" Version="4.0.3" />
2222
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
2323
<PackageReference Include="xunit" Version="2.4.1" />
24-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
24+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
2525
</ItemGroup>
2626

2727
<ItemGroup>

0 commit comments

Comments
 (0)