Avi Drissman | 4a6ec7e | 2022-09-08 20:26:46 | [diff] [blame] | 1 | # Copyright 2019 The Chromium Authors |
Clark DuVall | ebd41cb | 2019-12-19 23:14:16 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | import("//build/config/android/rules.gni") |
| 6 | import("//build/config/locales.gni") |
Sam Maier | fb196b2 | 2022-09-06 17:48:51 | [diff] [blame] | 7 | import("//components/crash/android/silent_java_assert_reporting.gni") |
Andrew Grieve | fad06ed | 2023-04-21 02:55:10 | [diff] [blame] | 8 | import("//device/vr/buildflags/buildflags.gni") |
Clark DuVall | ebd41cb | 2019-12-19 23:14:16 | [diff] [blame] | 9 | |
| 10 | template("system_webview_bundle") { |
Andrew Grieve | cdcd217b | 2023-03-14 13:45:30 | [diff] [blame] | 11 | _is_trichrome = defined(invoker.is_trichrome) && invoker.is_trichrome |
Sky Malice | 8e9ca1b | 2023-07-12 21:16:07 | [diff] [blame] | 12 | |
Andrew Grieve | 5d9b90f | 2023-03-16 21:09:47 | [diff] [blame] | 13 | assert(_is_trichrome == defined(invoker.static_library_provider)) |
Andrew Grieve | cdcd217b | 2023-03-14 13:45:30 | [diff] [blame] | 14 | |
Clark DuVall | ebd41cb | 2019-12-19 23:14:16 | [diff] [blame] | 15 | android_app_bundle(target_name) { |
| 16 | command_line_flags_file = "webview-command-line" |
Andrew Grieve | a8c26a1 | 2023-04-28 19:22:24 | [diff] [blame] | 17 | if (!is_java_debug) { |
| 18 | proguard_enabled = true |
| 19 | repackage_classes = "WV" |
| 20 | } |
Alex Mitra | 1ffbbb6 | 2024-10-22 19:00:08 | [diff] [blame] | 21 | |
| 22 | # TODO(crbug.com/41486995): Set this back to true once split translations |
| 23 | # are working again. |
| 24 | enable_language_splits = false |
Andrew Grieve | cdcd217b | 2023-03-14 13:45:30 | [diff] [blame] | 25 | if (_is_trichrome) { |
| 26 | min_sdk_version = 29 |
Andrew Grieve | cdcd217b | 2023-03-14 13:45:30 | [diff] [blame] | 27 | } |
Trevor Perrier | c8f7da5b | 2022-02-08 17:29:46 | [diff] [blame] | 28 | system_image_locale_allowlist = platform_pak_locales |
Christopher Grant | 83e35a4 | 2020-01-06 16:06:08 | [diff] [blame] | 29 | is_multi_abi = |
| 30 | android_64bit_target_cpu && (!defined(invoker.include_64_bit_webview) || |
| 31 | invoker.include_64_bit_webview) && |
| 32 | (!defined(invoker.include_32_bit_webview) || |
| 33 | invoker.include_32_bit_webview) |
Clark DuVall | ebd41cb | 2019-12-19 23:14:16 | [diff] [blame] | 34 | |
| 35 | if (!defined(proguard_android_sdk_dep)) { |
| 36 | proguard_android_sdk_dep = webview_framework_dep |
| 37 | } |
| 38 | |
Sam Maier | fb196b2 | 2022-09-06 17:48:51 | [diff] [blame] | 39 | if (enable_silent_java_assert_reporting) { |
| 40 | custom_assertion_handler = crash_reporting_assertion_handler |
| 41 | } |
| 42 | |
Fergal Daly | ebb8059 | 2022-03-24 03:30:48 | [diff] [blame] | 43 | # For this to be respected, it must also be set on the base module target. |
| 44 | strip_unused_resources = is_official_build |
| 45 | |
Clark DuVall | ebd41cb | 2019-12-19 23:14:16 | [diff] [blame] | 46 | forward_variables_from(invoker, "*") |
| 47 | } |
| 48 | } |