From fff81808b53d8f1268e420bc1e526048656898ba Mon Sep 17 00:00:00 2001 From: jthelin Date: Sat, 22 Sep 2018 14:32:58 -0700 Subject: [PATCH] GitVersion - Use GitVersion to stamp version numbers into assemblies. https://github.com/GitTools/GitVersion Use GitVersioning variables to set NuGet package version properties. Use Mainline versioning policy in GitVersion v4.0+. - Bump next version to 1.2.x for easier reference. Only run `GitVersionTask` during Windows builds. Failure more on Linux: ``` 2018-12-04T18:02:22.6601166Z "/home/vsts/work/1/s/ServerHost.sln" (default target) (1) -> 2018-12-04T18:02:22.6601998Z "/home/vsts/work/1/s/ServerHost/ServerHost.csproj" (default target) (2) -> 2018-12-04T18:02:22.6602670Z (WriteVersionInfoToBuildLog target) -> 2018-12-04T18:02:22.6604817Z /home/vsts/.nuget/packages/gitversiontask/4.0.1-beta1-50/build/functionality/GitVersionBuild.targets(6,5): error MSB4175: The task factory "UtilPack.NuGet.MSBuild.NuGetTaskRunnerFactory" could not be loaded from the assembly "/home/vsts/.nuget/packages/utilpack.nuget.msbuild/2.9.1/build/net46/UtilPack.NuGet.MSBuild.dll". Could not load type of field 'UtilPack.NuGet.BoundRestoreCommandUser:_clientPolicyContext' (8) due to: Could not resolve type with token 0100006c from typeref (expected class 'NuGet.Packaging.Signing.ClientPolicyContext' in assembly 'NuGet.Packaging, Version=4.9.0.6, Culture=neutral, PublicKeyToken=31bf3856ad364e35') assembly:NuGet.Packaging, Version=4.9.0.6, Culture=neutral, PublicKeyToken=31bf3856ad364e35 type:NuGet.Packaging.Signing.ClientPolicyContext member:(null) [/home/vsts/work/1/s/ServerHost/ServerHost.csproj] ``` --- GitVersion.yml | 8 ++++++++ ServerHost.sln | 1 + ServerHost/ServerHost.csproj | 10 ++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 GitVersion.yml diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..39da81b --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,8 @@ +assembly-versioning-scheme: Major +mode: Mainline +increment: Patch +next-version: 1.2.0 +branches: + master: + tag: alpha + prevent-increment-of-merged-branch-version: true diff --git a/ServerHost.sln b/ServerHost.sln index 5e23f1c..a89b2c2 100644 --- a/ServerHost.sln +++ b/ServerHost.sln @@ -19,6 +19,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{64DBC33D Build.cmd = Build.cmd Build.sh = Build.sh Clean.cmd = Clean.cmd + GitVersion.yml = GitVersion.yml nuget-restore.cmd = nuget-restore.cmd Test.cmd = Test.cmd Test.runsettings = Test.runsettings diff --git a/ServerHost/ServerHost.csproj b/ServerHost/ServerHost.csproj index 1b19800..71846c1 100644 --- a/ServerHost/ServerHost.csproj +++ b/ServerHost/ServerHost.csproj @@ -11,7 +11,7 @@ true - 1.1.18 + $(NuGetVersion) Jorgen Thelin Copyright © Jorgen Thelin 2015-2018 ServerHost - A .NET Server Hosting utility library, including in-process server host testing. @@ -21,7 +21,7 @@ DotNet Server Host Testing AppDomain git https://github.com/jthelin/ServerHost.git - 1.1.0.0 + $(AssemblySemVer) @@ -51,6 +51,12 @@ + + + all + + + all