Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fixes: dotnet/sdk#21614 Fixes: #6384 Context: 84d0d9b Context: https://github.com/xamarin/xamarin-android/blob/650f289301583003aa4acb075923bcc5627b92dc/Documentation/guides/OneDotNetSingleProject.md In .NET 6, if [`/manifest/@android:versionCode`][0] is within [`AndroidManifest.xml`][1], it won't be used, as it is always overwritten by a default value: <ApplicationVersion Condition=" '$(ApplicationVersion)' == '' ">1</ApplicationVersion> The other new MSBuild properties don't appear to suffer from this problem; values within `Properties\AndroidManifest.xml` always take precedence over MSBuild properties, [as documented in the spec][2]: * `$(ApplicationDisplayVersion)` * `$(ApplicationId)` * `$(ApplicationTitle)` This is because we don't default these properties to a value when they are blank. Fix this scenario by updating the `<GenerateJavaStubs/>` task to only set `ManifestDocument.VersionCode` when `ManifestDocument.HasVersionCode` is false and the version code is set. I added a new test for this scenario. [0]: https://developer.android.com/guide/topics/manifest/manifest-element#vcode [1]: https://developer.android.com/guide/topics/manifest/manifest-intro [2]: https://github.com/xamarin/xamarin-android/blob/650f289301583003aa4acb075923bcc5627b92dc/Documentation/guides/OneDotNetSingleProject.md
- Loading branch information
1 parent
650f289
commit 556b043
Showing
3 changed files
with
45 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters