Skip to content

Commit

Permalink
Merge branch 'release/0.27.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorkstromm committed Apr 19, 2018
2 parents b267900 + 829bca6 commit 41a6071
Show file tree
Hide file tree
Showing 77 changed files with 2,136 additions and 218 deletions.
27 changes: 10 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,25 @@ os:
- osx
- linux

# .NET CLI require Ubuntu 14.04
# Ubuntu 14.04
sudo: required
dist: trusty
addons:
apt:
sources:
- sourceline: 'deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main'
key_url: 'https://packages.microsoft.com/keys/microsoft.asc'
packages:
- gettext
- libcurl4-openssl-dev
- libicu-dev
- libssl-dev
- libunwind8
- dotnet-dev-1.1.4

# .NET CLI require OSX 10.10
osx_image: xcode8.3
# OS X 10.12
osx_image: xcode9.2

mono:
- 4.4.2

dotnet: 1.0.4
dotnet: 2.1.4

before_install:
- git fetch --unshallow # Travis always does a shallow clone, but GitVersion needs the full history including branches and tags
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin

script:
- ./build.sh --verbosity diagnostic
- ./build.sh --target Travis --verbosity diagnostic

cache:
directories:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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 | [![MyGet Build Status](https://www.myget.org/BuildSource/Badge/cake-myget-build-service?identifier=53513546-050e-45de-9500-f161c99df6e2)](https://www.myget.org/) |   |
| Bitbucket Pipelines | Linux | [![Build Status](https://cakebitbucketpipelinesshield.azurewebsites.net/status/cakebuild/cake-integration-tests/develop)](https://cakebitbucketpipelinesshield.azurewebsites.net/url/cakebuild/cake-integration-tests/develop) | [![Build Status](https://cakebitbucketpipelinesshield.azurewebsites.net/status/cakebuild/cake-integration-tests/IntegrationTests_develop)](https://cakebitbucketpipelinesshield.azurewebsites.net/url/cakebuild/cake-integration-tests/IntegrationTests_develop) |
| GitLabs | Linux | [![build status](https://gitlab.com/cake-build/cake/badges/develop/build.svg)](https://gitlab.com/cake-build/cake/builds) |   |
| GitLab | Linux | [![build status](https://gitlab.com/cake-build/cake/badges/develop/build.svg)](https://gitlab.com/cake-build/cake/builds) |   |

## Code Coverage

Expand Down
28 changes: 28 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
### New in 0.27.0 (Released 2018/04/19)

* 2078 Support expand environment variables in script pre-processor directives
* 2047 Specify version during Nuget Updating
* 2005 Add entries for Setup/Teardown in report
* 1908 Octopus Deploy tool does not support list-deployments call for octo.exe
* 2116 Loading Newtonsoft.Json in Cake.CoreCLR throws during assembly loading
* 2084 Cake does not load dependencies in correct order
* 2082 Investigate NuGet local V3 cache
* 2081 Possibility to override default nuget sources
* 2079 Default sources not loaded if nuget_source is empty
* 2119 DotNetCore Publish misses Force / Self contained / Sources settings
* 2113 Error when loading tools without internet connection
* 2106 Remove NUnit3Settings.ErrorOutputFile property
* 2092 Unable to set 'no-build' and 'no-restore' when executing DotNetCoreRun
* 2051 Add support for msbuild.exe /restore option
* 2039 XUnit2Runner doesn't respect ParallelismOption.None
* 2036 Don't output usage when an error occured.
* 2031 Simplify setting FileVersion and InformationalVersion
* 2029 Investigate in-process NuGet dependency resolution
* 2014 In-process NuGet don’t support multiple feeds through config
* 2003 Add possibility for AssemblyMetadata collection in CreateAssemblyInfo
* 1887 DotNetCoreRestoreSettings: support option --force
* 1557 Add support for MSBuild /consoleloggerparameters
* 2062 Fixed typo 'need to'
* 2035 Fix typo in README
* 1213 NuGetPushSettings.Source: incorrect documentation

### New in 0.26.1 (Released 2018/03/03)

* 2063 Cake running on Mono can't load netstandard 2.0 assembly
Expand Down
4 changes: 1 addition & 3 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ Task("Restore-NuGet-Packages")
Verbosity = DotNetCoreVerbosity.Minimal,
Sources = new [] {
"https://www.myget.org/F/xunit/api/v3/index.json",
"https://dotnet.myget.org/F/dotnet-core/api/v3/index.json",
"https://dotnet.myget.org/F/cli-deps/api/v3/index.json",
"https://api.nuget.org/v3/index.json",
"https://api.nuget.org/v3/index.json"
},
MSBuildSettings = msBuildSettings
});
Expand Down
7 changes: 5 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ Param(
[string[]]$ScriptArgs
)

$CakeVersion = "0.25.0"
$CakeVersion = "0.26.1"
$DotNetChannel = "Current";
$DotNetVersion = "2.1.4";
$DotNetVersion = "2.1.101";
$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1";
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"

# Temporarily skip verification of addins.
$ENV:CAKE_SETTINGS_SKIPVERIFICATION='true'

# Make sure tools folder exists
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
$ToolPath = Join-Path $PSScriptRoot "tools"
Expand Down
7 changes: 5 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
TOOLS_DIR=$SCRIPT_DIR/tools
NUGET_EXE=$TOOLS_DIR/nuget.exe
NUGET_URL=https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
CAKE_VERSION=0.25.0
CAKE_VERSION=0.26.1
CAKE_EXE=$TOOLS_DIR/Cake.$CAKE_VERSION/Cake.exe

# Temporarily skip verification of addins.
export CAKE_SETTINGS_SKIPVERIFICATION='true'

# Define default arguments.
TARGET="Travis"
CONFIGURATION="Release"
Expand Down Expand Up @@ -47,7 +50,7 @@ if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then
mkdir "$SCRIPT_DIR/.dotnet"
fi
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh
sudo bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version 2.1.4 --install-dir .dotnet --no-path
sudo bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version 2.1.101 --install-dir .dotnet --no-path
export PATH="$SCRIPT_DIR/.dotnet":$PATH
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Common.Tests/Fixtures/Build/BitriseFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void IsRunningOnBitrise()

public BitriseProvider CreateBitriseService()
{
return new BitriseProvider(Environment);
return new BitriseProvider(Environment, ProcessRunner);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public OctopusDeployPusherFixture()
"MyPackage.1.0.0.zip",
"MyOtherPackage.1.0.1.nupkg"
};

Server = "http://octopus";
ApiKey = "API-12345";
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using Cake.Common.Tools.OctopusDeploy;
using Cake.Core.IO;
using Cake.Testing.Fixtures;

namespace Cake.Common.Tests.Fixtures.Tools
{
internal sealed class OctopusDeploymentQueryierFixture : ToolFixture<OctopusDeploymentQuerySettings>
{
internal string Server { get; set; }

internal string ApiKey { get; set; }

public OctopusDeploymentQueryierFixture()
: base("Octo.exe")
{
Server = "http://octopus";
ApiKey = "API-12345";
}

public DeploymentQueryResultParser Parser { get; set; } = new DeploymentQueryResultParser();

protected override void RunTool()
{
var tool = new OctopusDeployDeploymentQuerier(FileSystem, Environment, ProcessRunner, Tools);
var results = tool.QueryOctopusDeployments(Server, ApiKey, Settings);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,23 @@ public void Should_Add_CustomAttributes_If_Set()
Assert.Contains("using Test.NameSpace;", result);
Assert.Contains("[assembly: TestAttribute(\"TestValue\")]", result);
}

[Fact]
public void Should_Add_MetadataAttributes_If_Set()
{
// Given
var fixture = new AssemblyInfoFixture();
fixture.Settings.MetaDataAttributes = new Collection<AssemblyInfoMetadataAttribute> { new AssemblyInfoMetadataAttribute { Key = "Key1", Value = "TestValue1" }, new AssemblyInfoMetadataAttribute { Key = "Key2", Value = "TestValue2" }, new AssemblyInfoMetadataAttribute { Key = "Key1", Value = "TestValue3" } };

// When
var result = fixture.CreateAndReturnContent();

// Then
Assert.Contains("using System.Reflection;", result);
Assert.Contains("[assembly: AssemblyMetadata(\"Key1\", \"TestValue3\")]", result);
Assert.Contains("[assembly: AssemblyMetadata(\"Key2\", \"TestValue2\")]", result);
Assert.DoesNotContain("[assembly: AssemblyMetadata(\"Key1\", \"TestValue1\")]", result);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,24 @@ public void Should_Add_CustomAttributes_If_Set()
Assert.Contains("using Test.NameSpace;", result);
Assert.Contains("[assembly: TestAttribute(\"TestValue\")]", result);
}

[Fact]
public void Should_Add_MetadataAttributes_If_Set()
{
// Given
var fixture = new AssemblyInfoFixture();
fixture.Settings.AddMetadataAttribute("Key1", "TestValue1");
fixture.Settings.AddMetadataAttribute("Key2", "TestValue2");
fixture.Settings.AddMetadataAttribute("Key1", "TestValue3");

// When
var result = fixture.CreateAndReturnContent();

// Then
Assert.Contains("using System.Reflection;", result);
Assert.Contains("[assembly: AssemblyMetadata(\"Key1\", \"TestValue3\")]", result);
Assert.Contains("[assembly: AssemblyMetadata(\"Key2\", \"TestValue2\")]", result);
Assert.DoesNotContain("[assembly: AssemblyMetadata(\"Key1\", \"TestValue1\")]", result);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,103 @@ public void Should_Return_The_Same_Configuration()
}
}

public sealed class TheSetFileVersionMethod
{
private const string FileVersion = "1.0.0-test";

[Fact]
public void Should_Set_FileVersion()
{
// Given
var settings = new DotNetCoreMSBuildSettings();
const string key = "FileVersion";

// When
settings.SetFileVersion(FileVersion);

// Then
Assert.True(settings.Properties.ContainsKey(key));
Assert.Equal(FileVersion, settings.Properties[key].FirstOrDefault());
}

[Fact]
public void Should_Return_The_Same_Configuration()
{
// Given
var settings = new DotNetCoreMSBuildSettings();

// When
var result = settings.SetFileVersion(FileVersion);

// Then
Assert.Equal(settings, result);
}
}

public sealed class TheSetInformationalVersionMethod
{
private const string InformationalVersion = "1.0.0-test";

[Fact]
public void Should_Set_InformationalVersion()
{
// Given
var settings = new DotNetCoreMSBuildSettings();
const string key = "InformationalVersion";

// When
settings.SetInformationalVersion(InformationalVersion);

// Then
Assert.True(settings.Properties.ContainsKey(key));
Assert.Equal(InformationalVersion, settings.Properties[key].FirstOrDefault());
}

[Fact]
public void Should_Return_The_Same_Configuration()
{
// Given
var settings = new DotNetCoreMSBuildSettings();

// When
var result = settings.SetInformationalVersion(InformationalVersion);

// Then
Assert.Equal(settings, result);
}
}

public sealed class TheSuppressVersionRecommendedFormatWarningMethod
{
[Fact]
public void Should_Set_NoWarn7035()
{
// Given
var settings = new DotNetCoreMSBuildSettings();
const string key = "nowarn";

// When
settings.SuppressVersionRecommendedFormatWarning();

// Then
Assert.True(settings.Properties.ContainsKey(key));
Assert.Equal("7035", settings.Properties[key].FirstOrDefault());
}

[Fact]
public void Should_Return_The_Same_Configuration()
{
// Given
var settings = new DotNetCoreMSBuildSettings();

// When
var result = settings.SuppressVersionRecommendedFormatWarning();

// Then
Assert.Equal(settings, result);
}
}

public sealed class TheSetVersionPrefixMethod
{
private const string VersionPrefix = "1.0.0";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,15 @@ public void Should_Add_Settings()
fixture.Settings.OutputDirectory = "./artifacts/";
fixture.Settings.VersionSuffix = "rc1";
fixture.Settings.Verbosity = DotNetCoreVerbosity.Minimal;
fixture.Settings.Force = true;
fixture.Settings.SelfContained = true;
fixture.Settings.Sources = new[] { "https://api.nuget.org/v3/index.json" };

// When
var result = fixture.Run();

// Then
Assert.Equal("publish --output \"/Working/artifacts\" --runtime runtime1 --framework dnxcore50 --configuration Release --version-suffix rc1 --no-dependencies --no-restore --verbosity Minimal", result.Args);
Assert.Equal("publish --output \"/Working/artifacts\" --runtime runtime1 --framework dnxcore50 --configuration Release --version-suffix rc1 --no-dependencies --no-restore --force --self-contained --source \"https://api.nuget.org/v3/index.json\" --verbosity Minimal", result.Args);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public void Should_Add_Settings()
fixture.Settings.PackagesDirectory = "./packages/";
fixture.Settings.Runtime = "runtime1";
fixture.Settings.NoDependencies = true;
fixture.Settings.Force = true;
fixture.Settings.Verbosity = DotNetCoreVerbosity.Minimal;

// When
Expand All @@ -127,7 +128,7 @@ public void Should_Add_Settings()
" --source \"https://www.example.com/source1\"" +
" --source \"https://www.example.com/source2\"" +
" --configfile \"/Working/NuGet.config\"" +
" --no-cache --disable-parallel --ignore-failed-sources --no-dependencies" +
" --no-cache --disable-parallel --ignore-failed-sources --no-dependencies --force" +
" --verbosity Minimal", result.Args);
}

Expand Down
Loading

0 comments on commit 41a6071

Please sign in to comment.