Skip to content

Commit

Permalink
Merge branch 'release/0.15.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
gep13 committed Jul 26, 2016
2 parents 295cea6 + da604a1 commit 02a4a87
Show file tree
Hide file tree
Showing 1,127 changed files with 5,869 additions and 1,588 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ tools/nuget.exe
tools/gitreleasemanager/
tools/GitVersion.CommandLine/
tools/Addins/
tools/packages.config.md5sum

# mstest test results
TestResults
Expand Down
4 changes: 2 additions & 2 deletions GitReleaseManager.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
issue-labels-include:
- Bug
- Breaking change
- Feature
- Bug
- Improvement
- Documentation
- Breaking change
issue-labels-exclude:
- Build
issue-labels-alias:
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Cake (C# Make) is a build automation system with a C# DSL to do things like comp
| Visual Studio Team Services | Windows | ![VSTS Build Status](https://img.shields.io/vso/build/cake-build/af63183c-ac1f-4dbb-93bc-4fa862ea5809/1.svg) |
| MyGet Build Services | Windows | [![cake-myget-build-service MyGet Build Status](https://www.myget.org/BuildSource/Badge/cake-myget-build-service?identifier=53513546-050e-45de-9500-f161c99df6e2)](https://www.myget.org/) |

## Table of contents
## Table of Contents

1. [Documentation](https://github.com/cake-build/cake#documentation)
2. [Example](https://github.com/cake-build/cake#example)
Expand All @@ -34,7 +34,7 @@ You can read the latest documentation at [http://cakebuild.net/](http://cakebuil

## Example

This example dowloads the Cake bootstrapper and executes a simple build script.
This example downloads the Cake bootstrapper and executes a simple build script.
The bootstrapper is used to bootstrap Cake in a simple way and is not in
required in any way to execute build scripts. If you prefer to invoke the Cake
executable yourself, [take a look at the command line usage](http://cakebuild.net/docs/cli/usage).
Expand Down Expand Up @@ -108,6 +108,7 @@ So you’re thinking about contributing to Cake? Great! It’s **really** apprec
Make sure you've read the [contribution guidelines](http://cakebuild.net/contribute/contribution-guidelines/) before sending that epic pull request.

* Fork the repository.
* Create a branch to work in.
* Make your feature addition or bug fix.
* Don't forget the unit tests.
* Send a pull request.
Expand Down
36 changes: 36 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
### New on 0.15.0 (Released 2016/07/26)

* Add support for adding messages to the AppVeyor build log
* Add environment variable support for Process & Tool
* Add ITeardownContext to Teardown method
* Add OutputPath to ProjectParserResult
* Extend SolutionParserResult with solution folders information
* Add Atlassian Bitbucket Pipelines build system support
* Set ICakeRuntime.TargetFramework to constant
* Do not set /m parameter for MSBuild by default
* AppVeyor.UploadTestResults failing silently
* GetFullName in TypeExtensions.cs not handling arrays correctly
* Allow paths with spaces for OutputDirectory on DotNetCore Aliases
* The GetFiles overload with a predicate doesn't work properly
* Added ability to call SetParameter method on TeamCity Provider
* CakeExecuteScript tool resolution fails if script in parent path
* UploadArtifact support via the AppVeyor provider is incomplete
* Added raw version string property in ReleaseNotes class
* Marked Quiet property on DotNetCoreRestoreSettings as obsolete
* Added -oldstyle support for OpenCover tool
* Added -nofetch support for GitVersion tool
* Add an explicit NuGet source for NuGetPush
* Add parsing of references and project references to the project file parser
* Add configuration for default NuGet source
* Add MD5 checking of packages.config to bootstrappper
* Support results file for MSTest runner
* Support NUnit output format for XUnit2 runner
* NUnit runner: Handle specific non-zero exit codes
* Added examples for Fixie
* Corrected spelling mistake in README.md
* Improved documentation for ProcessSettings Timeout property
* Added documentation for multiple arguments for ToolSettings
* Corrected documentation for GitReleaseManager
* Corrected code example for DotNetCorePackSettings
* Add example documentation to aliases

### New on 0.14.0 (Released 2016/07/11)

* Remove obsoleted XmlPoke Aliases
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ branches:
# Build cache
cache:
- src\packages -> src\**\packages.config
- tools -> build.cake
- tools -> build.cake, tools\packages.config
8 changes: 8 additions & 0 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Cake Bitbucket Pipeline
image: devlead/pipeline-mono

pipelines:
default:
- step:
script:
- ./build.sh
158 changes: 139 additions & 19 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
##########################################################################
# 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.
##########################################################################

<#
.SYNOPSIS
This is a Powershell script to bootstrap a Cake build.
.DESCRIPTION
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
and execute your Cake build script with the parameters you provide.
.PARAMETER Script
The build script to execute.
.PARAMETER Target
The build script target to run.
.PARAMETER Configuration
The build configuration to use.
.PARAMETER Verbosity
Specifies the amount of information to be displayed.
.PARAMETER Experimental
Tells Cake to use the latest Roslyn release.
.PARAMETER WhatIf
Performs a dry run of the build script.
No tasks will be executed.
.PARAMETER Mono
Tells Cake to use the Mono scripting engine.
.PARAMETER SkipToolPackageRestore
Skips restoring of packages.
.PARAMETER ScriptArgs
Remaining arguments are added here.
.LINK
http://cakebuild.net
#>

[CmdletBinding()]
Param(
[string]$Script = "build.cake",
[string]$Target = "Default",
Expand All @@ -6,22 +47,63 @@ Param(
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
[string]$Verbosity = "Verbose",
[switch]$Experimental,
[Alias("DryRun","Noop")]
[switch]$WhatIf,
[switch]$Mono,
[switch]$SkipToolPackageRestore,
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
[string[]]$ScriptArgs
)

$PSScriptRoot = split-path -parent $MyInvocation.MyCommand.Definition;
[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null
function MD5HashFile([string] $filePath)
{
if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf))
{
return $null
}

[System.IO.Stream] $file = $null;
[System.Security.Cryptography.MD5] $md5 = $null;
try
{
$md5 = [System.Security.Cryptography.MD5]::Create()
$file = [System.IO.File]::OpenRead($filePath)
return [System.BitConverter]::ToString($md5.ComputeHash($file))
}
finally
{
if ($file -ne $null)
{
$file.Dispose()
}
}
}

Write-Host "Preparing to run build script..."

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

$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"

# Should we use experimental build of Roslyn?
# Should we use mono?
$UseMono = "";
if($Mono.IsPresent) {
Write-Verbose -Message "Using the Mono based scripting engine."
$UseMono = "-mono"
}

# Should we use the new Roslyn?
$UseExperimental = "";
if($Experimental.IsPresent) {
if($Experimental.IsPresent -and !($Mono.IsPresent)) {
Write-Verbose -Message "Using experimental version of Roslyn."
$UseExperimental = "-experimental"
}

Expand All @@ -31,39 +113,77 @@ if($WhatIf.IsPresent) {
$UseDryRun = "-dryrun"
}

# Should we use mono?
$UseMono = "";
if($Mono.IsPresent) {
$UseMono = "-mono"
# Make sure tools folder exists
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
Write-Verbose -Message "Creating tools directory..."
New-Item -Path $TOOLS_DIR -Type directory | out-null
}

# Try download NuGet.exe if do not exist.
# Make sure that packages.config exist.
if (!(Test-Path $PACKAGES_CONFIG)) {
Write-Verbose -Message "Downloading packages.config..."
try { (New-Object System.Net.WebClient).DownloadFile("http://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch {
Throw "Could not download packages.config."
}
}

# Try find NuGet.exe in path if not exists
if (!(Test-Path $NUGET_EXE)) {
(New-Object System.Net.WebClient).DownloadFile($NUGET_URL, $NUGET_EXE)
Write-Verbose -Message "Trying to find nuget.exe in PATH..."
$existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_) }
$NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1
if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) {
Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)."
$NUGET_EXE = $NUGET_EXE_IN_PATH.FullName
}
}

# Make sure NuGet exists where we expect it.
# Try download NuGet.exe if not exists
if (!(Test-Path $NUGET_EXE)) {
Throw "Could not find NuGet.exe"
Write-Verbose -Message "Downloading NuGet.exe..."
try {
(New-Object System.Net.WebClient).DownloadFile($NUGET_URL, $NUGET_EXE)
} catch {
Throw "Could not download NuGet.exe."
}
}

# Save nuget.exe path to environment to be available to child processed
$ENV:NUGET_EXE = $NUGET_EXE

# Restore tools from NuGet?
if(-Not $SkipToolPackageRestore.IsPresent)
{
if(-Not $SkipToolPackageRestore.IsPresent) {
Push-Location
Set-Location $TOOLS_DIR
Invoke-Expression "$NUGET_EXE install -ExcludeVersion"
Pop-Location

# Check for changes in packages.config and remove installed tools if true.
[string] $md5Hash = MD5HashFile($PACKAGES_CONFIG)
if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or
($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) {
Write-Verbose -Message "Missing or changed package.config hash..."
Remove-Item * -Recurse -Exclude packages.config,nuget.exe
}

Write-Verbose -Message "Restoring tools from NuGet..."
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""

if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
Throw "An error occured while restoring NuGet tools."
}
else
{
$md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII"
}
Write-Verbose -Message ($NuGetOutput | Out-String)
Pop-Location
}

# Make sure that Cake has been installed.
if (!(Test-Path $CAKE_EXE)) {
Throw "Could not find Cake.exe"
Throw "Could not find Cake.exe at $CAKE_EXE"
}

# Start Cake
Invoke-Expression "$CAKE_EXE `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs"
exit $LASTEXITCODE
Write-Host "Running build script..."
Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs"
exit $LASTEXITCODE
Loading

0 comments on commit 02a4a87

Please sign in to comment.