| # Copyright 2015 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/proguard/proguard.gni") |
| import("//build/config/android/chrome_version.gni") |
| import("//build/config/android/config.gni") |
| import("//build/config/android/rules.gni") |
| import("//build/config/locales.gni") |
| import("//chrome/android/chrome_public_apk_tmpl.gni") |
| |
| template("system_webview_apk_tmpl") { |
| android_apk(target_name) { |
| forward_variables_from(invoker, "*") |
| |
| deps += [ |
| "//android_webview:assets", |
| "//android_webview/apk:webview_license_activity_java", |
| "//android_webview/apk:webview_license_provider_java", |
| "//android_webview/glue", |
| "//android_webview/support_library:support_lib_glue_java", |
| "//base:base_java", |
| ] |
| |
| if (!defined(alternative_android_sdk_dep)) { |
| alternative_android_sdk_dep = webview_framework_dep |
| } |
| |
| shared_resources = true |
| |
| _use_trichrome_library = |
| defined(use_trichrome_library) && use_trichrome_library |
| |
| if (!_use_trichrome_library) { |
| shared_libraries = [ "//android_webview:libwebviewchromium" ] |
| if (build_apk_secondary_abi && android_64bit_target_cpu) { |
| secondary_abi_shared_libraries = [ "//android_webview:libwebviewchromium($android_secondary_abi_toolchain)" ] |
| } |
| } else { |
| # Include placeholder libraries to ensure we are treated as the desired |
| # architecture. |
| if (android_64bit_target_cpu) { |
| if (android_64bit_browser) { |
| native_lib_placeholders = [ "libdummy.so" ] |
| if (build_apk_secondary_abi) { |
| secondary_abi_shared_libraries = [ |
| "//android_webview:monochrome($android_secondary_abi_toolchain)", |
| ] |
| } |
| } else { |
| shared_libraries = [ "//android_webview:monochrome" ] |
| if (build_apk_secondary_abi) { |
| secondary_native_lib_placeholders = [ "libdummy.so" ] |
| } |
| } |
| } else { |
| native_lib_placeholders = [ "libdummy.so" ] |
| } |
| } |
| |
| if (!_use_trichrome_library || android_64bit_target_cpu) { |
| # 32-bit TrichromeWebView doesn't have a native library, so only do this |
| # for other configs. |
| native_lib_version_rule = "//build/util:chrome_version_json" |
| _native_lib_file = |
| rebase_path("$root_gen_dir/CHROME_VERSION.json", root_out_dir) |
| native_lib_version_arg = "@FileArg($_native_lib_file:full-quoted)" |
| } |
| |
| aapt_locale_whitelist = locales |
| |
| resource_blacklist_regex = "[/-]xxxhdpi[/-]" |
| |
| # Exception rationale in https://crbug.com/691733. |
| resource_blacklist_exceptions = [ |
| "*shadow*", # Combination of gradient & transparency cause pixelation. |
| "*.9.*", # Most nine-patches contain shadows. |
| ] |
| |
| # Used as an additional apk in test scripts. |
| never_incremental = true |
| |
| if (is_java_debug) { |
| enable_multidex = true |
| } else { |
| proguard_enabled = true |
| if (!defined(proguard_configs)) { |
| proguard_configs = [] |
| } |
| proguard_configs += [ |
| "//android_webview/apk/java/proguard.flags", |
| "//base/android/proguard/chromium_apk.flags", |
| "//base/android/proguard/chromium_code.flags", |
| ] |
| if (enable_proguard_obfuscation) { |
| proguard_configs += |
| [ "//base/android/proguard/enable_obfuscation.flags" ] |
| } else { |
| proguard_configs += |
| [ "//base/android/proguard/disable_all_obfuscation.flags" ] |
| } |
| png_to_webp = true |
| } |
| command_line_flags_file = "webview-command-line" |
| |
| if (!defined(version_code)) { |
| if (_use_trichrome_library) { |
| version_code = trichrome_version_code |
| } else { |
| version_code = webview_version_code |
| } |
| } |
| if (!defined(version_name)) { |
| version_name = chrome_version_name |
| } |
| } |
| } |