From baa7ebaefa5bda865969f256ebb5a0ee8a39bad8 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Tue, 20 Aug 2024 14:25:27 -0400 Subject: [PATCH] [build] Update package metadata (#9230) Looking at the package explorer for recent .NET 9 preview 7 builds I noticed that other packages do not include sha metadata in the version element. Compare the following by clicking "View Metadata source": * https://nuget.info/packages/Microsoft.Android.Runtime.35.android-arm/35.0.0-preview.7.41 > 35.0.0-preview.7.41+sha.a9d10b4 * https://nuget.info/packages/Microsoft.NETCore.App.Runtime.Mono.android-arm/9.0.0-preview.7.24405.7 > 9.0.0-preview.7.24405.7 * https://nuget.info/packages/Microsoft.Maui.Sdk/9.0.0-preview.7.24407.4 > 9.0.0-preview.7.24407.4 I believe the sha metadata was added when we were initially figuring out a package versioning schema that would produce unique package versions; however, our usage of commit distance in both preview and stable versions should address this concern. The sha metadata inclusion in the version element but not the `.nupkg` name also causes conflicts with the latest version of the [arcade publishing tooling][0] which expects these to be in sync. The short hash in the metadata has been replaced by a `repository` element which will contain the repo url and full commit hash: The icon and other package metadata have been updated to better match other .NET packages. [0]: https://github.com/dotnet/arcade/blob/b4f4d40741f161e2c0d96c19c51a4013850ef65f/src/Microsoft.DotNet.Build.Tasks.Feed/src/PushToBuildStorage.cs --- Documentation/guides/OneDotNet.md | 20 +----------------- .../create-packs/Directory.Build.props | 2 ++ .../create-packs/Directory.Build.targets | 2 +- build-tools/create-packs/Icon.png | Bin 0 -> 2140 bytes build-tools/create-packs/License.targets | 6 +++++- .../Directory.Build.targets | 2 +- 6 files changed, 10 insertions(+), 22 deletions(-) create mode 100644 build-tools/create-packs/Icon.png diff --git a/Documentation/guides/OneDotNet.md b/Documentation/guides/OneDotNet.md index acdd9fbecfe..50f7e47dbe6 100644 --- a/Documentation/guides/OneDotNet.md +++ b/Documentation/guides/OneDotNet.md @@ -299,7 +299,7 @@ see the [net6-samples][net6-samples] repo. ## Package Versioning Scheme -This is the package version scheme: `OS-Major.OS-Minor.InternalRelease[-prereleaseX]+sha.1b2c3d4`. +This is the package version scheme: `OS-Major.OS-Minor.InternalRelease[-prereleaseX].CommitDistance`. * Major: The highest stable API level, such as 30. On Apple platforms, this is the major OS version. * Minor: Always 0 for Android. On Apple platforms, this is the minor OS version. @@ -327,24 +327,6 @@ This is the package version scheme: `OS-Major.OS-Minor.InternalRelease[-prerelea referencing `*-android-r.beta.*` * It's still possible to sign up for all `android-r` builds, by referencing `*-ci.android-r.*` -* Build metadata: Required Hash - * This is `sha.` + the short commit hash. - * Use the short hash because the long hash is quite long and - cumbersome. This leaves the complete version open for duplication, - but this is extremely unlikely. - * Example: `30.0.100+sha.1a2b3c` - * Example (CI build): `30.0.100-ci.master.1234+sha.1a2b3c` - * Since the build metadata is required for all builds, we're able to - recognize incomplete version numbers and determine if a particular - version string refers to a stable version or not. - * Example: `30.0.100`: incomplete version - * Example: `30.0.100+sha.1a2b3c`: stable - * Example: `30.0.100-ci.d17-0.1234+sha.1a2b3c`: CI build - * Example: `30.0.100-android-r.beta.1+sha.1a2b3c`: official - preview - * Technically it's possible to remove the prerelease part, but - we’d still be able to figure out it’s not a stable version by - using the commit hash. [0]: https://github.com/dotnet/installer#installers-and-binaries diff --git a/build-tools/create-packs/Directory.Build.props b/build-tools/create-packs/Directory.Build.props index 30698c4505f..e349836272d 100644 --- a/build-tools/create-packs/Directory.Build.props +++ b/build-tools/create-packs/Directory.Build.props @@ -4,6 +4,8 @@ netstandard2.0 DotnetPlatform + true + true $(BootstrapOutputDirectory)nuget-unsigned\ false false diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets index 9062956cbae..92e78a046bb 100644 --- a/build-tools/create-packs/Directory.Build.targets +++ b/build-tools/create-packs/Directory.Build.targets @@ -39,7 +39,7 @@ - $(AndroidPackVersionLong)+sha.$(XAVersionHash) + $(AndroidPackVersionLong) diff --git a/build-tools/create-packs/Icon.png b/build-tools/create-packs/Icon.png new file mode 100644 index 0000000000000000000000000000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qflxs-Xlp(?+z^mfcBjCASoPc0Eo+$1Ukv);wnZsCeH&`cr6V+- zlv98Q2P&n*!Bn0NQC5WS;Rxq;oYdzbZwp4})3$-jUb&QY)+bmNVpr+``XIZdFn@{R z-y&lERCUNMmld3Uk>W<<`>Kw>#6lx$oBxuCIFtk;kF{VWJb!KMr(kW0zjXo2SiFoH kLN8~t3iGWE|8=58=$f)MBl>~e*<^I~9RFa}4c} Microsoft © Microsoft Corporation. All rights reserved. - https://github.com/dotnet/android + https://github.com/dotnet/android + https://dot.net + microsoft,dotnetframework $(XamarinAndroidSourcePath)external\monodroid\tools\scripts\License.txt $(XamarinAndroidSourcePath)LICENSE.TXT LICENSE.TXT + Icon.png _GetLicense;$(BeforePack) @@ -19,6 +22,7 @@ <_PackageFiles Include="$(IntermediateOutputPath)$(PackageLicenseFile)" PackagePath="\" /> <_PackageFiles Include="$(XAInstallPrefix)THIRD-PARTY-NOTICES.TXT" PackagePath="\" /> + <_PackageFiles Include="$(MSBuildThisFileDirectory)Icon.png" PackagePath="\" /> diff --git a/src/Microsoft.Android.Templates/Directory.Build.targets b/src/Microsoft.Android.Templates/Directory.Build.targets index 9a0c7d5ff18..cb4a645c869 100644 --- a/src/Microsoft.Android.Templates/Directory.Build.targets +++ b/src/Microsoft.Android.Templates/Directory.Build.targets @@ -9,7 +9,7 @@ - $(AndroidPackVersionLong)+sha.$(XAVersionHash) + $(AndroidPackVersionLong) $(TemplatePackVersion)