forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
system_webview_apk_tmpl.gni
152 lines (132 loc) · 5.38 KB
/
system_webview_apk_tmpl.gni
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# 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("//android_webview/variables.gni")
import("//base/android/proguard/proguard.gni")
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//build/config/locales.gni")
import("//build/util/version.gni")
import("//chrome/android/trichrome.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
declare_args() {
# Android package name to use when compiling the system_webview_apk and
# trichrome_webview_apk targets. This should be used if the Android build
# on which you are going to install WebView is configured to load a
# different package name than the default used in AOSP.
system_webview_package_name = "com.android.webview"
}
template("system_webview_apk_tmpl") {
android_apk(target_name) {
forward_variables_from(invoker, "*")
deps += [
"//android_webview:locale_pak_assets",
"//android_webview:pak_file_assets",
"//android_webview/apk:apk_java",
"//android_webview/apk:webview_license_provider_java",
"//android_webview/glue",
"//android_webview/support_library:support_lib_glue_java",
"//base:base_java",
]
target_sdk_version = android_sdk_version
locale_config_java_packages = [ webview_locale_config_java_package ]
if (!defined(alternative_android_sdk_dep)) {
alternative_android_sdk_dep = webview_framework_dep
}
_use_trichrome_library =
defined(use_trichrome_library) && use_trichrome_library
if (!_use_trichrome_library || !trichrome_shared_assets) {
deps += [ "//android_webview:monochrome_webview_assets" ]
}
if (!_use_trichrome_library) {
shared_libraries = [ "//android_webview:libwebviewchromium" ]
deps += [
"//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline",
]
loadable_modules = [ "$root_out_dir/libcrashpad_handler_trampoline.so" ]
if (build_apk_secondary_abi && android_64bit_target_cpu) {
secondary_abi_shared_libraries = [ "//android_webview:libwebviewchromium($android_secondary_abi_toolchain)" ]
_trampoline = "//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline($android_secondary_abi_toolchain)"
deps += [ _trampoline ]
_secondary_out_dir = get_label_info(_trampoline, "root_out_dir")
secondary_abi_loadable_modules =
[ "$_secondary_out_dir/libcrashpad_handler_trampoline.so" ]
}
shared_resources = true
} else {
uncompress_shared_libraries = true
app_as_shared_lib = true
# Include placeholder libraries to ensure we are treated as the desired
# architecture.
if (android_64bit_target_cpu) {
shared_libraries = [ "//android_webview:monochrome" ]
deps += [
"//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline",
]
loadable_modules = [ "$root_out_dir/libcrashpad_handler_trampoline.so" ]
if (build_apk_secondary_abi) {
secondary_native_lib_placeholders = [ "libdummy.so" ]
if (use_v8_context_snapshot) {
deps += [ "//tools/v8_context_snapshot:v8_context_snapshot_assets" ]
} else {
deps += [ "//v8:v8_external_startup_data_assets" ]
}
}
} 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
# Match drawables, but not mipmaps.
resource_blacklist_regex = "drawable[^/]*-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) {
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 if (android_channel == "dev") {
version_code = webview_dev_version_code
} else if (android_channel == "beta") {
version_code = webview_beta_version_code
} else {
version_code = webview_stable_version_code
}
}
if (!defined(version_name)) {
version_name = chrome_version_name
}
}
}