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 |
Andrew Grieve | 77f78d9 | 2025-02-19 23:33:30 | [diff] [blame^] | 29 | if (android_64bit_target_cpu) { |
| 30 | _include_32_bit_webview = !defined(invoker.include_32_bit_webview) || |
| 31 | invoker.include_32_bit_webview |
| 32 | _include_64_bit_webview = !defined(invoker.include_64_bit_webview) || |
| 33 | invoker.include_64_bit_webview |
| 34 | is_multi_abi = _include_32_bit_webview && _include_64_bit_webview |
| 35 | not_needed([ "_include_64_bit_webview" ]) |
| 36 | if (!defined(android_app_secondary_abi)) { |
| 37 | assert(!is_multi_abi) |
| 38 | } |
| 39 | } |
Clark DuVall | ebd41cb | 2019-12-19 23:14:16 | [diff] [blame] | 40 | |
| 41 | if (!defined(proguard_android_sdk_dep)) { |
| 42 | proguard_android_sdk_dep = webview_framework_dep |
| 43 | } |
| 44 | |
Sam Maier | fb196b2 | 2022-09-06 17:48:51 | [diff] [blame] | 45 | if (enable_silent_java_assert_reporting) { |
| 46 | custom_assertion_handler = crash_reporting_assertion_handler |
| 47 | } |
| 48 | |
Fergal Daly | ebb8059 | 2022-03-24 03:30:48 | [diff] [blame] | 49 | # For this to be respected, it must also be set on the base module target. |
| 50 | strip_unused_resources = is_official_build |
| 51 | |
Clark DuVall | ebd41cb | 2019-12-19 23:14:16 | [diff] [blame] | 52 | forward_variables_from(invoker, "*") |
| 53 | } |
| 54 | } |