diff --git a/build/pack.cake b/build/pack.cake index 342ed6dcaf..6d4e66c160 100644 --- a/build/pack.cake +++ b/build/pack.cake @@ -21,11 +21,18 @@ Task("Build") RunGitVersionOnCI(parameters); }); +Task("Validate-Version") + .IsDependentOn("Build") + .Does((parameters) => +{ + ValidateVersion(parameters); +}); + #endregion #region Pack Task("Pack-Prepare") - .IsDependentOn("Build") + .IsDependentOn("Validate-Version") .Does((parameters) => { // publish single file for all native runtimes (self contained) diff --git a/build/utils/utils.cake b/build/utils/utils.cake index cac07342a8..cb54e56f6d 100644 --- a/build/utils/utils.cake +++ b/build/utils/utils.cake @@ -84,7 +84,6 @@ public static List ExecGitCmd(this ICakeContext context, string cmd) return redirectedOutput.ToList(); } - DirectoryPath HomePath() { return IsRunningOnWindows() @@ -122,6 +121,24 @@ GitVersion GetVersion(BuildParameters parameters) return gitVersion; } +void ValidateVersion(BuildParameters parameters) +{ + var gitVersionTool = GetFiles($"artifacts/**/bin/{parameters.CoreFxVersion31}/GitVersion.dll").FirstOrDefault(); + IEnumerable output; + var fullFxResult = StartProcess( + "dotnet", + new ProcessSettings { + Arguments = $"\"{gitVersionTool}\" -version", + RedirectStandardOutput = true, + }, + out output + ); + + var outputStr = string.Concat(output); + + Assert.Equal(parameters.Version.SemVersion, outputStr); +} + void RunGitVersionOnCI(BuildParameters parameters) { // set the CI build version number with GitVersion @@ -129,7 +146,6 @@ void RunGitVersionOnCI(BuildParameters parameters) { var settings = new GitVersionSettings { - UpdateAssemblyInfo = true, LogFilePath = "console", OutputType = GitVersionOutput.BuildServer }; diff --git a/src/GitVersionCore/Extensions/AssemblyInfo.cs b/src/GitVersionCore/Extensions/AssemblyInfo.cs index 967d567a6a..7c1dbae9b9 100644 --- a/src/GitVersionCore/Extensions/AssemblyInfo.cs +++ b/src/GitVersionCore/Extensions/AssemblyInfo.cs @@ -1,13 +1,6 @@ -using System.Reflection; using System.Runtime.CompilerServices; -[assembly: AssemblyTitle("GitVersionCore")] -[assembly: AssemblyProduct("GitVersion")] -[assembly: AssemblyVersion("4.0.0.0")] -[assembly: AssemblyFileVersion("4.0.0.0")] [assembly: InternalsVisibleTo("GitVersionTask.Tests")] [assembly: InternalsVisibleTo("GitVersion")] [assembly: InternalsVisibleTo("GitVersionCore.Tests")] [assembly: InternalsVisibleTo("GitVersionExe.Tests")] - -[assembly: AssemblyInformationalVersion("4.0.0+Branch.master.Sha.e715eb5dd515037d90a257f527e62442cae8c1c5")] diff --git a/src/GitVersionCore/GitVersionCore.csproj b/src/GitVersionCore/GitVersionCore.csproj index 2a11d071b1..825087dcad 100644 --- a/src/GitVersionCore/GitVersionCore.csproj +++ b/src/GitVersionCore/GitVersionCore.csproj @@ -3,7 +3,6 @@ netstandard2.0 GitVersion - false bin\$(Configuration)\GitVersionCore.xml 1591 diff --git a/src/GitVersionExe/AssemblyInfo.cs b/src/GitVersionExe/AssemblyInfo.cs index c441c4413c..32cf4f2a22 100644 --- a/src/GitVersionExe/AssemblyInfo.cs +++ b/src/GitVersionExe/AssemblyInfo.cs @@ -1,12 +1,5 @@ -using System.Reflection; using System.Runtime.CompilerServices; -[assembly: AssemblyTitle("GitVersion")] -[assembly: AssemblyProduct("GitVersion")] -[assembly: AssemblyVersion("4.0.0.0")] -[assembly: AssemblyFileVersion("4.0.0.0")] [assembly: InternalsVisibleTo("GitVersionTask.Tests")] [assembly: InternalsVisibleTo("AcceptanceTests")] [assembly: InternalsVisibleTo("GitVersionExe.Tests")] - -[assembly: AssemblyInformationalVersion("4.0.0+Branch.master.Sha.e715eb5dd515037d90a257f527e62442cae8c1c5")] diff --git a/src/GitVersionExe/GitVersionExe.csproj b/src/GitVersionExe/GitVersionExe.csproj index cec50b009a..9cb1cc0f62 100644 --- a/src/GitVersionExe/GitVersionExe.csproj +++ b/src/GitVersionExe/GitVersionExe.csproj @@ -5,7 +5,6 @@ GitVersion GitVersion netcoreapp2.1;netcoreapp3.1 - false AnyCPU MIT bin\$(Configuration)\GitVersion.xml