1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/android/config.gni")
6 import("//build/config/android/rules.gni")
7 import("//build/module_args/v8.gni")
8 import("//third_party/icu/config.gni")
10 generate_jni("content_shell_jni_headers") {
11 jni_package = "content/shell"
13 "java/src/org/chromium/content_shell/Shell.java",
14 "java/src/org/chromium/content_shell/ShellLayoutTestUtils.java",
15 "java/src/org/chromium/content_shell/ShellManager.java",
16 "java/src/org/chromium/content_shell/ShellMojoTestUtils.java",
20 shared_library("libcontent_shell_content_view") {
23 ":content_shell_jni_headers",
24 "//content/shell:content_shell_lib",
25 "//content/shell:pak",
26 "//components/crash/browser",
28 "//media/base/android",
31 "shell_library_loader.cc",
35 android_resources("content_shell_java_resources") {
37 resource_dirs = [ "java/res" ]
38 custom_package = "org.chromium.content_shell"
41 android_library("content_shell_java") {
45 "//content/public/android:content_java",
46 "//media/base/android:media_java",
47 "//net/android:net_java",
48 "//third_party/mojo/src/mojo/public/java:system",
49 "//ui/android:ui_java",
50 ":content_shell_java_resources",
52 DEPRECATED_java_in_dir = "java/src"
55 content_shell_manifest =
56 "$target_gen_dir/content_shell_manifest/AndroidManifest.xml"
58 jinja_template("content_shell_manifest") {
60 input = "shell_apk/AndroidManifest.xml.jinja2"
61 output = content_shell_manifest
64 android_resources("content_shell_apk_resources") {
66 resource_dirs = [ "shell_apk/res" ]
68 ":content_shell_java_resources",
69 ":content_shell_manifest",
71 android_manifest = content_shell_manifest
74 android_library("content_shell_apk_java") {
77 ":content_shell_apk_resources",
78 ":content_shell_java",
80 "//content/public/android:content_java",
81 "//media/base/android:media_java",
82 "//net/android:net_java",
83 "//ui/android:ui_java",
85 DEPRECATED_java_in_dir = "shell_apk/src"
88 content_shell_assets_dir = "$root_build_dir/content_shell/assets"
89 copy_ex("copy_content_shell_assets") {
91 dest = content_shell_assets_dir
93 "$root_out_dir/content_shell.pak",
96 "//content/shell:pak",
99 if (icu_use_data_file) {
100 sources += [ "$root_build_dir/icudtl.dat" ]
101 deps += [ "//third_party/icu:icudata" ]
103 if (v8_use_external_startup_data) {
105 "$root_build_dir/natives_blob.bin",
106 "$root_build_dir/snapshot_blob.bin",
112 android_apk("content_shell_apk") {
113 use_chromium_linker = true
116 # "//tools/android/forwarder",
119 ":content_shell_apk_java",
120 ":content_shell_apk_resources",
121 ":content_shell_java",
122 ":content_shell_manifest",
123 ":copy_content_shell_assets",
124 ":libcontent_shell_content_view",
126 "//content/public/android:content_java",
127 "//media/base/android:media_java",
128 "//net/android:net_java",
130 #"//third_party/mesa:osmesa_in_lib_dir",
131 "//ui/android:ui_java",
133 apk_name = "ContentShell"
134 android_manifest = content_shell_manifest
135 native_libs = [ "libcontent_shell_content_view.so" ]
136 asset_location = content_shell_assets_dir
139 #'extra_native_libs': ['<(SHARED_LIB_DIR)/libosmesa.so'],
142 android_library("content_shell_test_java") {
145 ":content_shell_java",
146 ":content_shell_apk_java",
148 "//base:base_java_test_support",
149 "//content/public/test/android:content_java_test_support",
150 "//content/shell/android:content_shell_java",
151 "//content/public/android:content_java",
153 DEPRECATED_java_in_dir = "javatests/src"
156 instrumentation_test_apk("content_shell_test_apk") {
158 "//content/public/android:content_javatests",
159 "//base:base_javatests",
160 "//net/android:net_javatests",
162 data_deps = [ ":content_shell_apk" ]
163 apk_under_test = ":content_shell_apk"
164 apk_name = "ContentShellTest"
165 android_manifest = "javatests/AndroidManifest.xml"
166 isolate_file = "../../content_shell_test_apk.isolate"
169 if (current_cpu != "x64" && current_cpu != "arm64") {
170 chromium_linker_test_manifest =
171 "$target_gen_dir/linker_test_apk/AndroidManifest.xml"
173 jinja_template("chromium_linker_test_manifest") {
175 input = "linker_test_apk/AndroidManifest.xml.jinja2"
176 output = chromium_linker_test_manifest
179 android_resources("linker_resources") {
181 resource_dirs = [ "linker_test_apk/res" ]
182 android_manifest = chromium_linker_test_manifest
184 ":chromium_linker_test_manifest",
188 # GYP: //content/content_tests.gypi:chromium_linker_test_apk
189 android_apk("chromium_linker_test_apk") {
192 ":chromium_linker_test_manifest",
193 ":content_shell_java",
194 ":copy_content_shell_assets",
198 "//content/public/android:content_java",
199 "//ui/android:ui_java",
201 android_manifest = chromium_linker_test_manifest
202 asset_location = content_shell_assets_dir
203 apk_name = "ChromiumLinkerTest"
204 DEPRECATED_java_in_dir = "linker_test_apk/src"
205 native_libs = [ "liblinker_test.so" ]
206 use_chromium_linker = true
207 enable_chromium_linker_tests = true
210 # GYP: //content/content_tests.gypi:chromium_android_linker_test
211 shared_library("linker_test") {
214 "linker_test_apk/chromium_linker_test_android.cc",
215 "linker_test_apk/chromium_linker_test_linker_tests.cc",
219 ":linker_test_jni_headers",
220 "//content/shell:content_shell_lib",
222 # Required to include "content/public/browser/android/compositor.h"
223 # in chromium_linker_test_android.cc :-(
228 # GYP: //content/content_tests.gypi:chromium_android_linker_test_jni_headers
229 generate_jni("linker_test_jni_headers") {
231 jni_package = "content/shell"
233 "linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java",