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 "//build/config/sanitizers:deps",
25 "//content/shell:content_shell_lib",
26 "//content/shell:pak",
27 "//components/crash/browser",
29 "//media/base/android",
32 "shell_library_loader.cc",
36 android_resources("content_shell_java_resources") {
38 resource_dirs = [ "java/res" ]
39 custom_package = "org.chromium.content_shell"
42 android_library("content_shell_java") {
46 "//content/public/android:content_java",
47 "//media/base/android:media_java",
48 "//net/android:net_java",
49 "//third_party/mojo/src/mojo/public/java:system",
50 "//ui/android:ui_java",
51 ":content_shell_java_resources",
53 DEPRECATED_java_in_dir = "java/src"
56 content_shell_manifest =
57 "$target_gen_dir/content_shell_manifest/AndroidManifest.xml"
59 jinja_template("content_shell_manifest") {
61 input = "shell_apk/AndroidManifest.xml.jinja2"
62 output = content_shell_manifest
65 android_resources("content_shell_apk_resources") {
67 resource_dirs = [ "shell_apk/res" ]
69 ":content_shell_java_resources",
70 ":content_shell_manifest",
72 android_manifest = content_shell_manifest
75 android_library("content_shell_apk_java") {
78 ":content_shell_apk_resources",
79 ":content_shell_java",
81 "//content/public/android:content_java",
82 "//media/base/android:media_java",
83 "//net/android:net_java",
84 "//ui/android:ui_java",
86 DEPRECATED_java_in_dir = "shell_apk/src"
89 content_shell_assets_dir = "$root_build_dir/content_shell/assets"
90 copy_ex("copy_content_shell_assets") {
92 dest = content_shell_assets_dir
94 "$root_out_dir/content_shell.pak",
97 "//content/shell:pak",
100 if (icu_use_data_file) {
101 sources += [ "$root_build_dir/icudtl.dat" ]
102 deps += [ "//third_party/icu:icudata" ]
104 if (v8_use_external_startup_data) {
106 "$root_build_dir/natives_blob.bin",
107 "$root_build_dir/snapshot_blob.bin",
113 android_apk("content_shell_apk") {
114 use_chromium_linker = true
117 # "//tools/android/forwarder",
120 ":content_shell_apk_java",
121 ":content_shell_apk_resources",
122 ":content_shell_java",
123 ":content_shell_manifest",
124 ":copy_content_shell_assets",
125 ":libcontent_shell_content_view",
127 "//content/public/android:content_java",
128 "//media/base/android:media_java",
129 "//net/android:net_java",
131 #"//third_party/mesa:osmesa_in_lib_dir",
132 "//ui/android:ui_java",
134 apk_name = "ContentShell"
135 android_manifest = content_shell_manifest
136 native_libs = [ "libcontent_shell_content_view.so" ]
137 asset_location = content_shell_assets_dir
140 #'extra_native_libs': ['<(SHARED_LIB_DIR)/libosmesa.so'],
143 android_library("content_shell_test_java") {
146 ":content_shell_java",
147 ":content_shell_apk_java",
149 "//base:base_java_test_support",
150 "//content/public/test/android:content_java_test_support",
151 "//content/shell/android:content_shell_java",
152 "//content/public/android:content_java",
154 DEPRECATED_java_in_dir = "javatests/src"
157 instrumentation_test_apk("content_shell_test_apk") {
159 "//content/public/android:content_javatests",
160 "//base:base_javatests",
161 "//net/android:net_javatests",
163 data_deps = [ ":content_shell_apk" ]
164 apk_under_test = ":content_shell_apk"
165 apk_name = "ContentShellTest"
166 android_manifest = "javatests/AndroidManifest.xml"
167 isolate_file = "../../content_shell_test_apk.isolate"
170 if (current_cpu != "x64") {
171 chromium_linker_test_manifest =
172 "$target_gen_dir/linker_test_apk/AndroidManifest.xml"
174 jinja_template("chromium_linker_test_manifest") {
176 input = "linker_test_apk/AndroidManifest.xml.jinja2"
177 output = chromium_linker_test_manifest
180 android_resources("linker_resources") {
182 resource_dirs = [ "linker_test_apk/res" ]
183 android_manifest = chromium_linker_test_manifest
185 ":chromium_linker_test_manifest",
189 # GYP: //content/content_tests.gypi:chromium_linker_test_apk
190 android_apk("chromium_linker_test_apk") {
193 ":chromium_linker_test_manifest",
194 ":content_shell_java",
195 ":copy_content_shell_assets",
199 "//content/public/android:content_java",
200 "//ui/android:ui_java",
202 android_manifest = chromium_linker_test_manifest
203 asset_location = content_shell_assets_dir
204 apk_name = "ChromiumLinkerTest"
205 DEPRECATED_java_in_dir = "linker_test_apk/src"
206 native_libs = [ "liblinker_test.so" ]
207 use_chromium_linker = true
208 enable_chromium_linker_tests = true
211 # GYP: //content/content_tests.gypi:chromium_android_linker_test
212 shared_library("linker_test") {
215 "linker_test_apk/chromium_linker_test_android.cc",
216 "linker_test_apk/chromium_linker_test_linker_tests.cc",
220 ":linker_test_jni_headers",
221 "//build/config/sanitizers:deps",
222 "//content/shell:content_shell_lib",
224 # Required to include "content/public/browser/android/compositor.h"
225 # in chromium_linker_test_android.cc :-(
231 # GYP: //content/content_tests.gypi:chromium_android_linker_test_jni_headers
232 generate_jni("linker_test_jni_headers") {
234 jni_package = "content/shell"
236 "linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java",