Skip to content

Commit 8f10bfc

Browse files
committed
Remove GitVersion extension methods for normalized AssemblyVersion and FileVersion
1 parent 1885fa0 commit 8f10bfc

File tree

4 files changed

+11
-23
lines changed

4 files changed

+11
-23
lines changed

GitVersion.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
assembly-versioning-scheme: MajorMinor
21
mode: ContinuousDelivery
32

3+
assembly-versioning-scheme: MajorMinor
4+
assembly-file-versioning-scheme: MajorMinorPatch
5+
46
branches:
57
master:
68
tag: ''

build/Build.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,15 @@ partial class Build : NukeBuild
133133
.SetProjectFile(Solution)
134134
.EnableNoRestore()
135135
.SetConfiguration(Configuration)
136-
.SetAssemblyVersion(GitVersion.GetNormalizedAssemblyVersion())
137-
.SetFileVersion(GitVersion.GetNormalizedFileVersion())
136+
.SetAssemblyVersion(GitVersion.AssemblySemVer)
137+
.SetFileVersion(GitVersion.AssemblySemFileVer)
138138
.SetInformationalVersion(GitVersion.InformationalVersion));
139139

140140
DotNetPublish(_ => _
141141
.EnableNoRestore()
142142
.SetConfiguration(Configuration)
143-
.SetAssemblyVersion(GitVersion.GetNormalizedAssemblyVersion())
144-
.SetFileVersion(GitVersion.GetNormalizedFileVersion())
143+
.SetAssemblyVersion(GitVersion.AssemblySemVer)
144+
.SetFileVersion(GitVersion.AssemblySemFileVer)
145145
.SetInformationalVersion(GitVersion.InformationalVersion)
146146
.CombineWith(
147147
from project in new[] { GlobalToolProject, MSBuildTaskRunnerProject }

source/Nuke.Common/Tools/GitVersion/GitVersionTasks.cs

-14
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,4 @@ protected override JsonProperty CreateProperty([NotNull] MemberInfo member, Memb
4848
}
4949
}
5050
}
51-
52-
[PublicAPI]
53-
public static class GitVersionExtensions
54-
{
55-
public static string GetNormalizedAssemblyVersion(this GitVersion gitVersion)
56-
{
57-
return $"{gitVersion.Major}.{gitVersion.Minor}.0";
58-
}
59-
60-
public static string GetNormalizedFileVersion(this GitVersion gitVersion)
61-
{
62-
return gitVersion.MajorMinorPatch;
63-
}
64-
}
6551
}

source/Nuke.GlobalTool/templates/Build.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,16 @@ class Build : NukeBuild
7878
.SetTargetPath(Solution) // MSBUILD
7979
.SetTargets("Rebuild") // MSBUILD
8080
.SetConfiguration(Configuration) // MSBUILD
81-
.SetAssemblyVersion(GitVersion.GetNormalizedAssemblyVersion()) // MSBUILD && GITVERSION
82-
.SetFileVersion(GitVersion.GetNormalizedFileVersion()) // MSBUILD && GITVERSION
81+
.SetAssemblyVersion(GitVersion.AssemblySemVer) // MSBUILD && GITVERSION
82+
.SetFileVersion(GitVersion.AssemblySemFileVer) // MSBUILD && GITVERSION
8383
.SetInformationalVersion(GitVersion.InformationalVersion) // MSBUILD && GITVERSION
8484
.SetMaxCpuCount(Environment.ProcessorCount) // MSBUILD
8585
.SetNodeReuse(IsLocalBuild)); // MSBUILD
8686
DotNetBuild(_ => _ // DOTNET
8787
.SetProjectFile(Solution) // DOTNET
8888
.SetConfiguration(Configuration) // DOTNET
89-
.SetAssemblyVersion(GitVersion.GetNormalizedAssemblyVersion()) // DOTNET && GITVERSION
90-
.SetFileVersion(GitVersion.GetNormalizedFileVersion()) // DOTNET && GITVERSION
89+
.SetAssemblyVersion(GitVersion.AssemblySemVer) // DOTNET && GITVERSION
90+
.SetFileVersion(GitVersion.AssemblySemFileVer) // DOTNET && GITVERSION
9191
.SetInformationalVersion(GitVersion.InformationalVersion) // DOTNET && GITVERSION
9292
.EnableNoRestore()); // DOTNET
9393
});

0 commit comments

Comments
 (0)