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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
|
# Copyright 2019 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/system_webview_apk_tmpl.gni")
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//build/config/python.gni")
import("//third_party/icu/config.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
import("//weblayer/variables.gni")
android_assets("weblayer_shell_assets") {
testonly = true
sources = [ "$root_out_dir/weblayer_shell.pak" ]
disable_compression = true
deps = [ "//weblayer/shell:shell_pak" ]
}
android_resources("weblayer_shell_resources") {
sources = [
"shell_apk/res/layout/bottom_controls.xml",
"shell_apk/res/layout/shell_browser_controls.xml",
"shell_apk/res/menu/app_menu.xml",
"shell_apk/res/values/strings.xml",
"shell_apk/res/values/styles.xml",
]
custom_package = "org.chromium.weblayer.shell"
}
android_library("weblayer_shell_java") {
testonly = true
deps = [
":weblayer_shell_resources",
"//base:base_java",
"//third_party/android_deps:android_support_v4_java",
"//third_party/android_deps:android_support_v7_appcompat_java",
"//weblayer/public/java",
]
sources = [
"shell_apk/src/org/chromium/weblayer/shell/InstrumentationActivity.java",
"shell_apk/src/org/chromium/weblayer/shell/TelemetryActivity.java",
"shell_apk/src/org/chromium/weblayer/shell/WebLayerShellActivity.java",
]
}
template("weblayer_shell_apk_helper") {
_weblayer_shell_manifest =
"$target_gen_dir/manifest_$target_name/AndroidManifest.xml"
_manifest_target = target_name + "_manifest"
jinja_template(_manifest_target) {
input = "shell_apk/AndroidManifest.xml"
output = _weblayer_shell_manifest
if (defined(invoker.weblayer_package)) {
variables = [ "weblayer_package=" + invoker.weblayer_package ]
}
}
android_apk(target_name + "_apk") {
testonly = true
deps = [
":$_manifest_target",
":weblayer_shell_assets",
":weblayer_shell_java",
]
apk_name = invoker.apk_name
android_manifest = _weblayer_shell_manifest
min_sdk_version = 21
target_sdk_version = 28
android_manifest_dep = ":$_manifest_target"
command_line_flags_file = "weblayer-command-line"
# Add a native lib so the ABI is compatible with the implementation APK.
native_lib_placeholders = [ "libdummy.so" ]
}
}
weblayer_shell_apk_helper("weblayer_shell") {
weblayer_package = "org.chromium.weblayer.support"
apk_name = "WebLayerShell"
}
weblayer_shell_apk_helper("weblayer_shell_system_webview") {
apk_name = "WebLayerShellSystemWebView"
}
generate_wrapper("run_weblayer_shell") {
testonly = true
wrapper_script = "$root_out_dir/bin/run_weblayer_shell"
executable = "//weblayer/tools/run_weblayer_shell.py"
executable_args = [
"--shell-apk-path",
"@WrappedPath(apks/WebLayerShell.apk)",
"--support-apk-path",
"@WrappedPath(apks/WebLayerSupport.apk)",
]
deps = [
":weblayer_shell_apk",
":weblayer_support_apk",
]
}
if (public_android_sdk) {
generate_wrapper("run_weblayer_shell_trichrome") {
testonly = true
wrapper_script = "$root_out_dir/bin/run_weblayer_shell_trichrome"
executable = "//weblayer/tools/run_weblayer_shell.py"
executable_args = [
"--shell-apk-path",
"@WrappedPath(apks/WebLayerShellSystemWebView.apk)",
"--support-apk-path",
"@WrappedPath(apks/TrichromeLibrary.apk)",
"--support-apk-path",
"@WrappedPath(apks/TrichromeWebView.apk)",
"--switch-webview-to",
system_webview_package_name,
]
deps = [
":weblayer_shell_system_webview_apk",
"//android_webview:trichrome_webview_apk",
"//chrome/android:trichrome_library_apk",
]
}
generate_wrapper("run_weblayer_shell_webview") {
testonly = true
wrapper_script = "$root_out_dir/bin/run_weblayer_shell_webview"
executable = "//weblayer/tools/run_weblayer_shell.py"
executable_args = [
"--shell-apk-path",
"@WrappedPath(apks/WebLayerShellSystemWebView.apk)",
"--support-apk-path",
"@WrappedPath(apks/SystemWebView.apk)",
"--switch-webview-to",
system_webview_package_name,
]
deps = [
":weblayer_shell_system_webview_apk",
"//android_webview:system_webview_apk",
]
}
}
weblayer_support_manifest =
"$target_gen_dir/weblayer_support_manifest/AndroidManifest.xml"
jinja_template("weblayer_support_manifest") {
input = "support_apk/AndroidManifest.xml"
output = weblayer_support_manifest
}
android_apk("weblayer_support_apk") {
testonly = true
# Test runner does not support having "additional apks" that are incremental.
never_incremental = true
deps = [
":weblayer_support_manifest",
"//android_webview:locale_pak_assets",
"//android_webview:pak_file_assets",
"//android_webview:weblayer_webview_assets",
"//base:base_java",
"//weblayer:locale_pak_assets",
"//weblayer/browser/java",
"//weblayer/browser/java:test_java",
]
# Transitive dependencies
deps += [
"//components/safe_browsing/android:safe_browsing_java",
"//components/viz/service:service_java",
"//media/base/android:media_java",
"//media/capture/video/android:capture_java",
"//mojo/public/java:system_java",
"//net/android:net_java",
]
# default upstream safebrowsing related classes
deps += [ "//weblayer/browser/java:gms_bridge_upstream_impl_java" ]
apk_name = "WebLayerSupport"
android_manifest = weblayer_support_manifest
min_sdk_version = 21
target_sdk_version = 28
android_manifest_dep = ":weblayer_support_manifest"
shared_resources = true
version_name = chrome_version_name
version_code = webview_stable_version_code
product_config_java_packages = [ weblayer_product_config_java_package ]
native_lib_version_rule = "//build/util:chrome_version_json"
_native_lib_file =
rebase_path("$root_gen_dir/CHROME_VERSION.json", root_build_dir)
native_lib_version_arg = "@FileArg($_native_lib_file:full-quoted)"
shared_libraries = [ "//weblayer:libweblayer_test" ]
}
python_library("weblayer_shell_wpt") {
testonly = true
pydeps_file = "//testing/scripts/run_android_wpt.pydeps"
data_deps = [
":weblayer_shell_apk",
":weblayer_support_apk",
"//build/android:test_runner_py",
"//chrome/test/chromedriver:chromedriver($host_toolchain)",
"//third_party/blink/tools:wpt_tests_android_isolate",
]
}
|