android: Support building Android App Bundles for Chrome.
This CL adds new GN rules and two example targets to
generate App Bundles for Chromium. For now, the bundles
do not use any split dimensions, or feature modules, but
these will appear in future CLs.
Note that:
- Signing the bundles is optional, and controlled by the
'sign_bundle' boolean target variable. This is because
signing requires 'jarsigner' which is very slow. Since
the signing is only required to upload to the Play Store,
it is currently only performed for official builds in
the chrome_public_bundle target.
- It is possible to generate an .apks archive from a
bundle at build time. This is only useful for local
installation / testing, but could also be performed
outside of the build on demand (e.g. with a python
script like bundle_operations.py, which would reflect
apk_operations.py, but for bundles).
For now, this requires setting the GN variable
'generate_apks' to true in the target declaration,
and will automatically declare another target with
an _apks suffix (e.g. foo_bundle -> foo_bundle_apks).
- The bundles and the .apks archive are signed with the
same key as the one used to sign regular APKs. A
future CL might introduce a way to specify a different
signing key for bundles, in order to match Play Store
uploader keys used by the project (if needed).
The new targets defined here are:
chrome_public_bundle
($OUT/gen/chrome/android/chrome_public_bundle.aab)
chrome_public_bundle_apks
($OUT/gen/chrome/android/chrome_public_bundle.apks)
chrome_modern_public_bundle
($OUT/gen/chrome/android/chrome_modern_public_bundle.aab)
monochrome_public_bundle
($OUT/gen/chrome/android/monochrome_public_bundle.aab)
The bundles cannot be installed, only the .apks archive can.
To install the .apks on a local device, use the following:
build/android/gyp/bundletool.py install-apks \
--apks=out/Release/gen/chrome/android/chrome_public_bundle.apks \
--adb=$(which adb)
More details:
- apkbuilder.py: Add a new --format=bundle-module option that
is used to generate an App Bundle module zip archive, instead
of an APK.
- create_app_bundle.py: New script to generate a bundle from
a list of bundle module archives, and some configuration
options.
- app_bundle_to_apks.py: New script used to generate a bundle
into an .apks archive (which contains a set of split APKs,
which can be installed with the bundletool install-apks
command described above).
Only use this for local testing, not for distribution.
- New android_app_bundle GN template to define a bundle
target from one or more android_apk targets.
BUG=820459
R=benmason@chromium.org, agrieve@chromium.org, yfriedman@chromium.org
Change-Id: I5be05742fe389853644a970bda4f8267a9f90ae7
Reviewed-on: https://chromium-review.googlesource.com/1125932
Commit-Queue: David Turner <digit@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#572755}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7122b4b42baa41f338c896f874b46ebc5f6f13c3
3 files changed