1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48

android_webview / system_webview_bundle.gni [blame]

# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/android/rules.gni")
import("//build/config/locales.gni")
import("//components/crash/android/silent_java_assert_reporting.gni")
import("//device/vr/buildflags/buildflags.gni")

template("system_webview_bundle") {
  _is_trichrome = defined(invoker.is_trichrome) && invoker.is_trichrome

  assert(_is_trichrome == defined(invoker.static_library_provider))

  android_app_bundle(target_name) {
    command_line_flags_file = "webview-command-line"
    if (!is_java_debug) {
      proguard_enabled = true
      repackage_classes = "WV"
    }

    # TODO(crbug.com/41486995): Set this back to true once split translations
    # are working again.
    enable_language_splits = false
    if (_is_trichrome) {
      min_sdk_version = 29
    }
    system_image_locale_allowlist = platform_pak_locales
    is_multi_abi =
        android_64bit_target_cpu && (!defined(invoker.include_64_bit_webview) ||
                                     invoker.include_64_bit_webview) &&
        (!defined(invoker.include_32_bit_webview) ||
         invoker.include_32_bit_webview)

    if (!defined(proguard_android_sdk_dep)) {
      proguard_android_sdk_dep = webview_framework_dep
    }

    if (enable_silent_java_assert_reporting) {
      custom_assertion_handler = crash_reporting_assertion_handler
    }

    # For this to be respected, it must also be set on the base module target.
    strip_unused_resources = is_official_build

    forward_variables_from(invoker, "*")
  }
}