Skip to content

Commit 7e29767

Browse files
committed
Merge branch 'release/0.3.1'
2 parents 0dde3e0 + 66b37c8 commit 7e29767

33 files changed

+430
-318
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ This addin for Cake allows you to work with Azure DevOps or Azure DevOps Server.
1616
| | Develop | Master |
1717
|:--:|:--:|:--:|
1818
|AppVeyor Windows|[![Build status](https://ci.appveyor.com/api/projects/status/c0akmejs4b136s0o/branch/develop?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-tfs/branch/develop)|[![Build status](https://ci.appveyor.com/api/projects/status/c0akmejs4b136s0o/branch/master?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-tfs/branch/master)|
19-
|Azure DevOps Windows|[![Build Status](https://dev.azure.com/cake-contrib/Cake.Tfs/_apis/build/status/cake-contrib.Cake.Tfs?branchName=develop&jobName=Windows)](https://dev.azure.com/cake-contrib/Cake.Tfs/_build/latest?definitionId=9?branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.Tfs/_apis/build/status/cake-contrib.Cake.Tfs?branchName=master&jobName=Windows)](https://dev.azure.com/cake-contrib/Cake.Tfs/_build/latest?definitionId=9?branchName=master)|
19+
|Azure DevOps Windows|[![Build Status](https://dev.azure.com/cake-contrib/Cake.Tfs/_apis/build/status/cake-contrib.Cake.Tfs?branchName=develop&jobName=Windows)](https://dev.azure.com/cake-contrib/Cake.Tfs/_build/latest?definitionId=9&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.Tfs/_apis/build/status/cake-contrib.Cake.Tfs?branchName=master&jobName=Windows)](https://dev.azure.com/cake-contrib/Cake.Tfs/_build/latest?definitionId=9&branchName=master)|
20+
|Azure DevOps Ubuntu|[![Build Status](https://dev.azure.com/cake-contrib/Cake.Tfs/_apis/build/status/cake-contrib.Cake.Tfs?branchName=develop&jobName=Ubuntu)](https://dev.azure.com/cake-contrib/Cake.Tfs/_build/latest?definitionId=9&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.Tfs/_apis/build/status/cake-contrib.Cake.Tfs?branchName=master&jobName=Ubuntu)](https://dev.azure.com/cake-contrib/Cake.Tfs/_build/latest?definitionId=9&branchName=master)|
2021

2122
## Code Coverage
2223

azure-pipelines.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,15 @@ jobs:
1212
pool:
1313
vmImage: 'vs2017-win2016'
1414
steps:
15-
- powershell: ./build.ps1
15+
- powershell: |
16+
$ENV:CAKE_SKIP_GITVERSION=([string]::IsNullOrEmpty($ENV:SYSTEM_PULLREQUEST_PULLREQUESTID) -eq $False).ToString()
17+
.\build.ps1
18+
exit $LASTEXITCODE
19+
displayName: 'Cake Build'
20+
- job: Ubuntu
21+
pool:
22+
vmImage: 'ubuntu-16.04'
23+
steps:
24+
- bash: |
25+
./build.sh
1626
displayName: 'Cake Build'

build.sh

100644100755
Lines changed: 50 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,97 @@
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.
14-
SCRIPT="setup.cake"
1520
TARGET="Default"
1621
CONFIGURATION="Release"
1722
VERBOSITY="verbose"
1823
DRYRUN=
19-
SHOW_VERSION=false
2024
SCRIPT_ARGUMENTS=()
2125

2226
# Parse arguments.
2327
for i in "$@"; do
2428
case $1 in
25-
-s|--script) SCRIPT="$2"; shift ;;
2629
-t|--target) TARGET="$2"; shift ;;
2730
-c|--configuration) CONFIGURATION="$2"; shift ;;
2831
-v|--verbosity) VERBOSITY="$2"; shift ;;
2932
-d|--dryrun) DRYRUN="-dryrun" ;;
30-
--version) SHOW_VERSION=true ;;
3133
--) shift; SCRIPT_ARGUMENTS+=("$@"); break ;;
3234
*) SCRIPT_ARGUMENTS+=("$1") ;;
3335
esac
3436
shift
3537
done
3638

3739
# Make sure the tools folder exist.
38-
if [ ! -d $TOOLS_DIR ]; then
39-
mkdir $TOOLS_DIR
40+
if [ ! -d "$TOOLS_DIR" ]; then
41+
mkdir "$TOOLS_DIR"
4042
fi
4143

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
44+
###########################################################################
45+
# INSTALL .NET CORE CLI
46+
###########################################################################
47+
48+
echo "Installing .NET CLI..."
49+
if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then
50+
mkdir "$SCRIPT_DIR/.dotnet"
5051
fi
52+
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh
53+
sudo bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version 2.1.400 --install-dir .dotnet --no-path
54+
export PATH="$SCRIPT_DIR/.dotnet":$PATH
55+
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
56+
export DOTNET_CLI_TELEMETRY_OPTOUT=1
57+
export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0
58+
"$SCRIPT_DIR/.dotnet/dotnet" --info
59+
60+
###########################################################################
61+
# INSTALL NUGET
62+
###########################################################################
5163

5264
# Download NuGet if it does not exist.
53-
if [ ! -f $NUGET_EXE ]; then
65+
if [ ! -f "$NUGET_EXE" ]; then
5466
echo "Downloading NuGet..."
55-
curl -Lsfo $NUGET_EXE https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
67+
curl -Lsfo "$NUGET_EXE" $NUGET_URL
5668
if [ $? -ne 0 ]; then
57-
echo "An error occured while downloading nuget.exe."
69+
echo "An error occurred while downloading nuget.exe."
5870
exit 1
5971
fi
6072
fi
6173

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
74+
###########################################################################
75+
# INSTALL CAKE
76+
###########################################################################
77+
78+
if [ ! -f "$CAKE_EXE" ]; then
79+
mono "$NUGET_EXE" install Cake -Version $CAKE_VERSION -OutputDirectory "$TOOLS_DIR"
80+
if [ $? -ne 0 ]; then
81+
echo "An error occurred while installing Cake."
82+
exit 1
83+
fi
6884
fi
69-
popd >/dev/null
7085

7186
# Make sure that Cake has been installed.
72-
if [ ! -f $CAKE_EXE ]; then
87+
if [ ! -f "$CAKE_EXE" ]; then
7388
echo "Could not find Cake.exe at '$CAKE_EXE'."
7489
exit 1
7590
fi
7691

92+
###########################################################################
93+
# RUN BUILD SCRIPT
94+
###########################################################################
95+
7796
# 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
97+
exec mono "$CAKE_EXE" setup.cake --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}"

nuspec/nuget/Cake.Tfs.nuspec

Lines changed: 0 additions & 27 deletions
This file was deleted.

setup.cake

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease
1+
#load nuget:?package=Cake.Recipe&version=1.0.0
22

33
Environment.SetVariableNames();
44

@@ -10,15 +10,17 @@ BuildParameters.SetParameters(
1010
repositoryOwner: "cake-contrib",
1111
repositoryName: "Cake.Tfs",
1212
appVeyorAccountName: "cakecontrib",
13-
shouldDeployGraphDocumentation: false);
13+
shouldRunGitVersion: true,
14+
shouldDeployGraphDocumentation: false,
15+
shouldRunDotNetCorePack: true);
1416

1517
BuildParameters.PrintParameters(Context);
1618

1719
ToolSettings.SetToolSettings(
1820
context: Context,
1921
dupFinderExcludePattern: new string[] { BuildParameters.RootDirectoryPath + "/src/Cake.Tfs.Tests/**/*.cs" },
20-
testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[*.Tests]* -[*]Costura.AssemblyLoader -[*]ProcessedByFody ",
22+
testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[*.Tests]* -[Shouldly]*",
2123
testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*",
2224
testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs");
2325

24-
Build.Run();
26+
Build.RunDotNetCore();

src/Cake.Tfs.Tests.ruleset

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<RuleSet Name="Ruleset for Cake.Tfs test cases" Description="Rules valid for Cake.Tfs test cases" ToolsVersion="14.0">
33
<Include Path="Cake.Tfs.ruleset" Action="Default" />
44
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
5+
<Rule Id="SA0001" Action="None" />
56
<Rule Id="SA1118" Action="None" />
7+
<Rule Id="SA1600" Action="None" />
68
<Rule Id="SA1652" Action="None" />
79
</Rules>
810
</RuleSet>

src/Cake.Tfs.Tests/Authentication/AuthenticationProviderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace Cake.Tfs.Tests.Authentication
22
{
3+
using Cake.Tfs.Authentication;
34
using Shouldly;
4-
using Tfs.Authentication;
55
using Xunit;
66

77
public sealed class AuthenticationProviderTests

src/Cake.Tfs.Tests/Authentication/TfsAadCredentialsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace Cake.Tfs.Tests.Authentication
22
{
3+
using Cake.Tfs.Authentication;
34
using Shouldly;
4-
using Tfs.Authentication;
55
using Xunit;
66

77
public sealed class TfsAadCredentialsTests

src/Cake.Tfs.Tests/Authentication/TfsBasicCredentialsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace Cake.Tfs.Tests.Authentication
22
{
3+
using Cake.Tfs.Authentication;
34
using Shouldly;
4-
using Tfs.Authentication;
55
using Xunit;
66

77
public sealed class TfsBasicCredentialsTests

src/Cake.Tfs.Tests/Authentication/TfsNtlmCredentialsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace Cake.Tfs.Tests.Authentication
22
{
3+
using Cake.Tfs.Authentication;
34
using Shouldly;
4-
using Tfs.Authentication;
55
using Xunit;
66

77
public sealed class TfsNtlmCredentialsTests

src/Cake.Tfs.Tests/Authentication/TfsOAuthCredentialsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace Cake.Tfs.Tests.Authentication
22
{
3+
using Cake.Tfs.Authentication;
34
using Shouldly;
4-
using Tfs.Authentication;
55
using Xunit;
66

77
public sealed class TfsOAuthCredentialsTests

src/Cake.Tfs.Tests/Cake.Tfs.Tests.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>net461</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
55
<IsPackable>false</IsPackable>
66
<Product>Cake.Tfs</Product>
77
<Copyright>Copyright © Pascal Berger</Copyright>
@@ -14,12 +14,13 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
17+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
1818
<PackageReference Include="Cake.Core" Version="0.33.0" />
1919
<PackageReference Include="Cake.Testing" Version="0.33.0" />
20-
<PackageReference Include="Moq" Version="4.10.1" />
20+
<PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="16.143.2" />
21+
<PackageReference Include="Moq" Version="4.12.0" />
2122
<PackageReference Include="Shouldly" Version="3.0.2" />
22-
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
23+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
2324
<PackageReference Include="xunit" Version="2.4.1" />
2425
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
2526
</ItemGroup>

0 commit comments

Comments
 (0)