Update V8 to version 4.7.20.
[chromium-blink-merge.git] / content / shell / android / BUILD.gn
blobb722f0b63e9285c215d8f80c721c5130fec81f51
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"
12   sources = [
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",
17   ]
20 shared_library("libcontent_shell_content_view") {
21   testonly = true
22   deps = [
23     ":content_shell_jni_headers",
24     "//build/config/sanitizers:deps",
25     "//content/shell:content_shell_lib",
26     "//content/shell:pak",
27     "//components/crash/browser",
28     "//skia",
29     "//media/base/android",
30   ]
31   sources = [
32     "shell_library_loader.cc",
33   ]
36 android_resources("content_shell_java_resources") {
37   testonly = true
38   resource_dirs = [ "java/res" ]
39   custom_package = "org.chromium.content_shell"
42 android_library("content_shell_java") {
43   testonly = true
44   deps = [
45     "//base:base_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",
52   ]
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") {
60   testonly = true
61   input = "shell_apk/AndroidManifest.xml.jinja2"
62   output = content_shell_manifest
65 android_resources("content_shell_apk_resources") {
66   testonly = true
67   resource_dirs = [ "shell_apk/res" ]
68   deps = [
69     ":content_shell_java_resources",
70     ":content_shell_manifest",
71   ]
72   android_manifest = content_shell_manifest
75 android_library("content_shell_apk_java") {
76   testonly = true
77   deps = [
78     ":content_shell_apk_resources",
79     ":content_shell_java",
80     "//base:base_java",
81     "//content/public/android:content_java",
82     "//media/base/android:media_java",
83     "//net/android:net_java",
84     "//ui/android:ui_java",
85   ]
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") {
91   clear_dir = true
92   dest = content_shell_assets_dir
93   sources = [
94     "$root_out_dir/content_shell.pak",
95   ]
96   deps = [
97     "//content/shell:pak",
98   ]
100   if (icu_use_data_file) {
101     sources += [ "$root_build_dir/icudtl.dat" ]
102     deps += [ "//third_party/icu:icudata" ]
103   }
104   if (v8_use_external_startup_data) {
105     sources += [
106       "$root_build_dir/natives_blob.bin",
107       "$root_build_dir/snapshot_blob.bin",
108     ]
109     deps += [ "//v8" ]
110   }
113 android_apk("content_shell_apk") {
114   use_chromium_linker = true
115   testonly = true
116   data_deps = [
117     # "//tools/android/forwarder",
118   ]
119   deps = [
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",
126     "//base:base_java",
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",
133   ]
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
139   # TODO(GYP)
140   #'extra_native_libs': ['<(SHARED_LIB_DIR)/libosmesa.so'],
143 android_library("content_shell_test_java") {
144   testonly = true
145   deps = [
146     ":content_shell_java",
147     ":content_shell_apk_java",
148     "//base:base_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",
153   ]
154   DEPRECATED_java_in_dir = "javatests/src"
157 instrumentation_test_apk("content_shell_test_apk") {
158   deps = [
159     "//content/public/android:content_javatests",
160     "//base:base_javatests",
161     "//net/android:net_javatests",
162   ]
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") {
175     testonly = true
176     input = "linker_test_apk/AndroidManifest.xml.jinja2"
177     output = chromium_linker_test_manifest
178   }
180   android_resources("linker_resources") {
181     testonly = true
182     resource_dirs = [ "linker_test_apk/res" ]
183     android_manifest = chromium_linker_test_manifest
184     deps = [
185       ":chromium_linker_test_manifest",
186     ]
187   }
189   # GYP: //content/content_tests.gypi:chromium_linker_test_apk
190   android_apk("chromium_linker_test_apk") {
191     testonly = true
192     deps = [
193       ":chromium_linker_test_manifest",
194       ":content_shell_java",
195       ":copy_content_shell_assets",
196       ":linker_resources",
197       ":linker_test",
198       "//base:base_java",
199       "//content/public/android:content_java",
200       "//ui/android:ui_java",
201     ]
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
209   }
211   # GYP: //content/content_tests.gypi:chromium_android_linker_test
212   shared_library("linker_test") {
213     testonly = true
214     sources = [
215       "linker_test_apk/chromium_linker_test_android.cc",
216       "linker_test_apk/chromium_linker_test_linker_tests.cc",
217     ]
219     deps = [
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 :-(
226       "//skia",
227       "//third_party/re2",
228     ]
229   }
231   # GYP: //content/content_tests.gypi:chromium_android_linker_test_jni_headers
232   generate_jni("linker_test_jni_headers") {
233     testonly = true
234     jni_package = "content/shell"
235     sources = [
236       "linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java",
237     ]
238   }