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 "browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java",
14 "java/src/org/chromium/content_shell/Shell.java",
15 "java/src/org/chromium/content_shell/ShellLayoutTestUtils.java",
16 "java/src/org/chromium/content_shell/ShellManager.java",
17 "java/src/org/chromium/content_shell/ShellMojoTestUtils.java",
21 shared_library("libcontent_shell_content_view") {
24 ":content_shell_jni_headers",
25 "//content/shell:content_shell_lib",
26 "//content/shell:pak",
27 "//components/crash/browser",
29 "//media/base/android",
32 "shell_library_loader.cc",
34 if (is_android_webview_build) {
35 ldflags = [ "-lgabi++" ]
39 android_resources("content_shell_java_resources") {
41 resource_dirs = [ "java/res" ]
42 custom_package = "org.chromium.content_shell"
45 android_library("content_shell_java") {
49 "//content/public/android:content_java",
50 "//media/base/android:media_java",
51 "//net/android:net_java",
52 "//third_party/mojo/src/mojo/public/java:system",
53 "//ui/android:ui_java",
54 ":content_shell_java_resources",
56 DEPRECATED_java_in_dir = "java/src"
59 content_shell_manifest =
60 "$target_gen_dir/content_shell_manifest/AndroidManifest.xml"
62 jinja_template("content_shell_manifest") {
64 input = "shell_apk/AndroidManifest.xml.jinja2"
65 output = content_shell_manifest
68 android_resources("content_shell_apk_resources") {
70 resource_dirs = [ "shell_apk/res" ]
72 ":content_shell_java_resources",
74 android_manifest = content_shell_manifest
77 android_library("content_shell_apk_java") {
80 ":content_shell_apk_resources",
81 ":content_shell_java",
83 "//content/public/android:content_java",
84 "//media/base/android:media_java",
85 "//net/android:net_java",
86 "//ui/android:ui_java",
88 DEPRECATED_java_in_dir = "shell_apk/src"
91 content_shell_assets_dir = "$root_build_dir/content_shell/assets"
92 copy_ex("copy_content_shell_assets") {
94 dest = content_shell_assets_dir
96 "$root_out_dir/content_shell.pak",
99 if (icu_use_data_file) {
100 sources += [ "$root_build_dir/icudtl.dat" ]
102 if (v8_use_external_startup_data) {
104 "$root_build_dir/natives_blob.bin",
105 "$root_build_dir/snapshot_blob.bin",
110 android_apk("content_shell_apk") {
111 use_chromium_linker = true
114 # "//tools/android/forwarder",
117 ":content_shell_apk_resources",
118 ":content_shell_java",
119 ":content_shell_apk_java",
120 ":libcontent_shell_content_view",
121 ":copy_content_shell_assets",
123 "//content/public/android:content_java",
124 "//media/base/android:media_java",
125 "//net/android:net_java",
127 #"//third_party/mesa:osmesa_in_lib_dir",
128 "//ui/android:ui_java",
130 apk_name = "ContentShell"
131 android_manifest = content_shell_manifest
132 native_libs = [ "libcontent_shell_content_view.so" ]
133 asset_location = content_shell_assets_dir
136 #'extra_native_libs': ['<(SHARED_LIB_DIR)/libosmesa.so'],
138 if (is_android_webview_build) {
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 android_apk("content_shell_test_apk") {
160 "//content/public/android:content_javatests",
161 "//base:base_javatests",
162 "//net/android:net_javatests",
165 ":content_shell_apk",
167 apk_name = "ContentShellTest"
168 android_manifest = "javatests/AndroidManifest.xml"
171 if (current_cpu != "x64" && current_cpu != "arm64") {
172 chromium_linker_test_manifest =
173 "$target_gen_dir/linker_test_apk/AndroidManifest.xml"
175 jinja_template("chromium_linker_test_manifest") {
177 input = "linker_test_apk/AndroidManifest.xml.jinja2"
178 output = chromium_linker_test_manifest
181 android_resources("linker_resources") {
182 resource_dirs = [ "linker_test_apk/res" ]
183 android_manifest = chromium_linker_test_manifest
186 # GYP: //content/content_tests.gypi:chromium_linker_test_apk
187 android_apk("chromium_linker_test_apk") {
190 ":content_shell_java",
191 ":copy_content_shell_assets",
195 "//content/public/android:content_java",
196 "//ui/android:ui_java",
198 android_manifest = chromium_linker_test_manifest
199 asset_location = content_shell_assets_dir
200 apk_name = "ChromiumLinkerTest"
201 DEPRECATED_java_in_dir = "linker_test_apk/src"
202 native_libs = [ "liblinker_test.so" ]
203 use_chromium_linker = true
204 enable_chromium_linker_tests = true
207 # GYP: //content/content_tests.gypi:chromium_android_linker_test
208 shared_library("linker_test") {
211 "linker_test_apk/chromium_linker_test_android.cc",
212 "linker_test_apk/chromium_linker_test_linker_tests.cc",
216 ":linker_test_jni_headers",
217 "//content/shell:content_shell_lib",
219 # Required to include "content/public/browser/android/compositor.h"
220 # in chromium_linker_test_android.cc :-(
225 # GYP: //content/content_tests.gypi:chromium_android_linker_test_jni_headers
226 generate_jni("linker_test_jni_headers") {
228 jni_package = "content/shell"
230 "linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java",