[netcore] Smarter version numbering of nupkg (mono/mono#14011)
authorJo Shields <joshield@microsoft.com>
Thu, 25 Apr 2019 19:42:56 +0000 (15:42 -0400)
committerGitHub <noreply@github.com>
Thu, 25 Apr 2019 19:42:56 +0000 (15:42 -0400)
The version number in version.h only shows e.g. "6.3.0", and we
want full version numbers ideally, to match what our Mac pkg files
show. This logic calculates that version number.

Commit migrated from https://github.com/mono/mono/commit/3521df4cf476ce459cdacd815f64876d8b3e5a94

src/mono/netcore/Makefile

index 07ec5f9..38ed4c8 100644 (file)
@@ -40,6 +40,10 @@ ASPNETCORE_URL := https://dotnetcli.blob.core.windows.net/dotnet/aspnetcore/Runt
 FEED_BASE_URL := https://dotnetfeed.blob.core.windows.net/dotnet-core
 TEST_ASSETS_URL = $(FEED_BASE_URL)/corefx-tests/$(NETCORETESTS_VERSION)/OSX.x64/netcoreapp/corefx-test-assets.xml
 
+# used to calculate exact version number for generating nupkg
+BLAME = $(shell git blame ../configure.ac | grep AC_INIT | cut -f1 -d' ')
+VERSTUB = .$(shell git rev-list --count $(BLAME)..HEAD)
+
 $(NETCORESDK_FILE):
        curl $(NETCORE_URL) --output $(NETCORESDK_FILE)
        rm -rf shared/Microsoft.NETCore.App
@@ -98,7 +102,7 @@ link-mono:
 prepare: $(ASPNETCORESDK_FILE) $(NETCORESDK_FILE) update-corefx update-roslyn link-mono
 
 nupkg:
-       nuget pack runtime.nuspec -properties VERSION=$(VERSION)\;RID=$(RID)\;PLATFORM_AOT_SUFFIX=$(PLATFORM_AOT_SUFFIX)\;COREARCH=$(COREARCH)
+       nuget pack runtime.nuspec -properties VERSION=$(VERSION)$(VERSTUB)\;RID=$(RID)\;PLATFORM_AOT_SUFFIX=$(PLATFORM_AOT_SUFFIX)\;COREARCH=$(COREARCH)
 
 clean:
        rm -rf sdk shared host dotnet tests obj corefx roslyn LICENSE.txt ThirdPartyNotices.txt $(NETCORESDK_FILE) $(ASPNETCORESDK_FILE)