-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[One .NET] select defaults for App Bundles (#6087)
Fixes: #6059 Context: https://android-developers.googleblog.com/2020/11/new-android-app-bundle-and-target-api.html Context: https://blogs.windows.com/windowsexperience/2021/06/24/building-a-new-open-microsoft-store-on-windows-11/ Context: https://developer.amazon.com/blogs/appstore/post/50b1ca0f-bbec-48ec-9eea-3c395efb8f9f/amazon-appstore-to-support-android-app-bundle The Google Play Store requires Android App Bundles (`.aab` files) for all new apps as of August 2021, and for all apps in November 2021. Meanwhile, Microsoft has announced that Windows 11 will support running Android apps and installing them via the Amazon Appstore, which currently only supports `.apk` file uploads. While a Xamarin.Android user could build their app twice, changing the [`$(AndroidPackageFormat)`][0] between each build, we feel it would be "better" -- faster, more convenient -- if a single `SignAndroidPackage` target invocation could produce *both* `.aab` and `.apk` outputs. [`bundletool.jar`][1] has the ability to create a universal `.apk` from the `.aab` file. Introduce support for a new `$(AndroidPackageFormats)` (plural) MSBuild property, which is a `;`-delimited sequence of `$(AndroidPackageFormat)` values to produce as build outputs. For example, if `$(AndroidPackageFormats)`=`aab;apk`, then *both* `.aab` and `.apk` outputs will be produced. <PropertyGroup> <AndroidPackageFormats>aab;apk</AndroidPackageFormats> </PropertyGroup> The `.apk` output will be generated from the `.aab` file, ensuring consistency. In .NET 6 Debug configuration builds, `$(AndroidPackageFormats)` will default to `.apk`, as this behaves better with Fast Deployment and developer productivity. In .NET 6 Release configuration builds, `$(AndroidPackageFormats)` will default to `aab;apk`, i.e. both `.aab` and `.apk` files will be produced by default. In Legacy Xamarin.Android, `$(AndroidPackageFormats)` will not be set, and `$(AndroidPackageFormat)` will continue to default to `.apk`, meaning that only `.apk` files will be produced (this week…). [0]: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/building-apps/build-properties#androidpackageformat [1]: https://developer.android.com/studio/command-line/bundletool
- Loading branch information
1 parent
25c5cb5
commit f9f879c
Showing
27 changed files
with
253 additions
and
86 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
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
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
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
Oops, something went wrong.