diff options
Diffstat (limited to 'chromium/chrome/android/chrome_bundle_tmpl.gni')
-rw-r--r-- | chromium/chrome/android/chrome_bundle_tmpl.gni | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/chromium/chrome/android/chrome_bundle_tmpl.gni b/chromium/chrome/android/chrome_bundle_tmpl.gni new file mode 100644 index 00000000000..763239b1cea --- /dev/null +++ b/chromium/chrome/android/chrome_bundle_tmpl.gni @@ -0,0 +1,81 @@ +# Copyright 2019 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//base/android/linker/config.gni") +import("//build/config/android/config.gni") +import("//build/util/version.gni") +import("//chrome/android/modules/chrome_feature_module_tmpl.gni") + +# Instantiates a Chrome-specific app bundle. +# +# Supports most attributes of chrome_feature_module and android_app_bundle, +# plus: +# module_descs: List of descriptors for modules that are part of this bundle. +# See //chrome/android/modules/chrome_feature_modules.gni for the format of +# a module descriptor. +template("chrome_bundle") { + _bundle_target_name = target_name + _package_id = 126 # == 0x7e. + _extra_modules = [] + foreach(_module_desc, invoker.module_descs) { + assert(_package_id > 2, "Too many modules, ran out of package IDs!") + chrome_feature_module( + "${_bundle_target_name}__${_module_desc.name}_bundle_module") { + forward_variables_from(invoker, + [ + "base_module_target", + "include_32_bit_webview", + "is_64_bit_browser", + "is_monochrome_or_trichrome", + "manifest_package", + "min_sdk_version", + "version_code", + ]) + module_desc = _module_desc + version_name = chrome_version_name + uncompress_shared_libraries = + invoker.is_monochrome_or_trichrome || chromium_linker_supported + + # Each module needs a unique resource package ID so that we don't have ID + # collisions between feature modules. + package_id = _package_id + } + _module_desc.module_target = + ":${_bundle_target_name}__${_module_desc.name}_bundle_module" + _extra_modules += [ _module_desc ] + _package_id -= 1 + } + + android_app_bundle(target_name) { + forward_variables_from(invoker, + [ + "base_module_target", + "bundle_name", + "compress_shared_libraries", + "keystore_name", + "keystore_password", + "keystore_path", + "min_sdk_version", + "proguard_android_sdk_dep", + "proguard_jar_path", + "sign_bundle", + "static_library_provider", + "verify_proguard_flags", + ]) + command_line_flags_file = "chrome-command-line" + proguard_enabled = !is_java_debug + enable_language_splits = true + extra_modules = _extra_modules + system_image_locale_whitelist = locales - android_chrome_omitted_locales + + # NOTE: Only sign bundle for official builds since this is very slow. + if (enable_chrome_android_internal && use_signing_keys && + is_official_build) { + sign_bundle = true + keystore_path = chrome_keystore_path + keystore_name = chrome_keystore_name + keystore_password = chrome_keystore_password + } + } +} |