Skip to content

Commit

Permalink
Swap MSBuild processes for Cake
Browse files Browse the repository at this point in the history
This brings this project inline with other repo. build setups within the organization.

Part of this changeover is the use of GitVersion.
  • Loading branch information
billbogaiv committed Sep 18, 2018
1 parent fea37f5 commit 0a4fd75
Show file tree
Hide file tree
Showing 12 changed files with 460 additions and 192 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,5 @@ FakesAssemblies/

# Visual Studio 6 workspace options file
*.opt

tools/
2 changes: 2 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mode: Mainline
increment: Patch
19 changes: 18 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
environment:
IGNORE_NORMALISATION_GIT_HEAD_MOVE: 1

image: Visual Studio 2017

cache:
- packages -> **\packages.config

install:
- choco install gitversion.portable -pre -y

before_build:
- ps: C:\ProgramData\chocolatey\bin\gfv.exe $env:APPVEYOR_BUILD_FOLDER /l console /output buildserver /updateAssemblyInfo /nofetch

build_script:
- ./build.cmd /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- ps: ./build.ps1

test: off

skip_tags: true

artifacts:
- path: ./msbuild.log
- path: ./artifacts/*.nupkg
Expand All @@ -17,3 +28,9 @@ deploy:
name: NuGet
on:
branch: master

- provider: Environment
name: GitHub
github_tag_name: v$(GitVersion_NuGetVersionV2)
on:
branch: master
77 changes: 77 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#tool "nuget:?package=xunit.runner.console"

var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var solution = "./Filter.sln";
var publishDirectory = Directory("./artifacts");

Task("Clean")
.Does(() =>
{
CleanDirectory(publishDirectory);
});

Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
NuGetRestore(solution);
});

Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
MSBuild(solution, settings =>
settings.SetConfiguration(configuration)
.WithProperty("TreatWarningsAsErrors", "False")
.SetVerbosity(Verbosity.Minimal)
.AddFileLogger());
});

Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
XUnit2("./tests/**/bin/" + configuration + "/*.Tests.dll", new XUnit2Settings());
});

Task("Publish")
.IsDependentOn("Test")
.Does(() =>
{
NuGetPack("./src/Filter/Filter.csproj", new NuGetPackSettings
{
OutputDirectory = publishDirectory,
Version = EnvironmentVariable("GitVersion_NuGetVersionV2"),
Properties = new Dictionary<string, string>
{
{ "Configuration", configuration }
}
});

NuGetPack("./src/Range.Web.Http/Range.Web.Http.csproj", new NuGetPackSettings
{
OutputDirectory = publishDirectory,
Version = EnvironmentVariable("GitVersion_NuGetVersionV2"),
Properties = new Dictionary<string, string>
{
{ "Configuration", configuration }
}
});

NuGetPack("./src/Filter.Nest/Filter.Nest.csproj", new NuGetPackSettings
{
OutputDirectory = publishDirectory,
Version = EnvironmentVariable("GitVersion_NuGetVersionV2"),
Properties = new Dictionary<string, string>
{
{ "Configuration", configuration }
}
});
});

Task("Default")
.IsDependentOn("Publish");

RunTarget(target);
45 changes: 0 additions & 45 deletions build.cmd

This file was deleted.

Loading

0 comments on commit 0a4fd75

Please sign in to comment.