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",
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",
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 if (icu_use_data_file) {
97 sources += [ "$root_build_dir/icudtl.dat" ]
99 if (v8_use_external_startup_data) {
101 "$root_build_dir/natives_blob.bin",
102 "$root_build_dir/snapshot_blob.bin",
107 android_apk("content_shell_apk") {
108 use_chromium_linker = true
111 # "//tools/android/forwarder",
114 ":content_shell_apk_resources",
115 ":content_shell_java",
116 ":content_shell_apk_java",
117 ":libcontent_shell_content_view",
118 ":copy_content_shell_assets",
120 "//content/public/android:content_java",
121 "//media/base/android:media_java",
122 "//net/android:net_java",
124 #"//third_party/mesa:osmesa_in_lib_dir",
125 "//ui/android:ui_java",
127 apk_name = "ContentShell"
128 android_manifest = content_shell_manifest
129 native_libs = [ "libcontent_shell_content_view.so" ]
130 asset_location = content_shell_assets_dir
133 #'extra_native_libs': ['<(SHARED_LIB_DIR)/libosmesa.so'],
136 android_library("content_shell_test_java") {
139 ":content_shell_java",
140 ":content_shell_apk_java",
142 "//base:base_java_test_support",
143 "//content/public/test/android:content_java_test_support",
144 "//content/shell/android:content_shell_java",
145 "//content/public/android:content_java",
147 DEPRECATED_java_in_dir = "javatests/src"
150 android_apk("content_shell_test_apk") {
153 "//content/public/android:content_javatests",
154 "//base:base_javatests",
155 "//net/android:net_javatests",
158 ":content_shell_apk",
160 apk_name = "ContentShellTest"
161 android_manifest = "javatests/AndroidManifest.xml"
164 if (current_cpu != "x64" && current_cpu != "arm64") {
165 chromium_linker_test_manifest =
166 "$target_gen_dir/linker_test_apk/AndroidManifest.xml"
168 jinja_template("chromium_linker_test_manifest") {
170 input = "linker_test_apk/AndroidManifest.xml.jinja2"
171 output = chromium_linker_test_manifest
174 android_resources("linker_resources") {
175 resource_dirs = [ "linker_test_apk/res" ]
176 android_manifest = chromium_linker_test_manifest
179 # GYP: //content/content_tests.gypi:chromium_linker_test_apk
180 android_apk("chromium_linker_test_apk") {
183 ":content_shell_java",
184 ":copy_content_shell_assets",
188 "//content/public/android:content_java",
189 "//ui/android:ui_java",
191 android_manifest = chromium_linker_test_manifest
192 asset_location = content_shell_assets_dir
193 apk_name = "ChromiumLinkerTest"
194 DEPRECATED_java_in_dir = "linker_test_apk/src"
195 native_libs = [ "liblinker_test.so" ]
196 use_chromium_linker = true
197 enable_chromium_linker_tests = true
200 # GYP: //content/content_tests.gypi:chromium_android_linker_test
201 shared_library("linker_test") {
204 "linker_test_apk/chromium_linker_test_android.cc",
205 "linker_test_apk/chromium_linker_test_linker_tests.cc",
209 ":linker_test_jni_headers",
210 "//content/shell:content_shell_lib",
212 # Required to include "content/public/browser/android/compositor.h"
213 # in chromium_linker_test_android.cc :-(
218 # GYP: //content/content_tests.gypi:chromium_android_linker_test_jni_headers
219 generate_jni("linker_test_jni_headers") {
221 jni_package = "content/shell"
223 "linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java",