OWNERs file for external estimates provider
[chromium-blink-merge.git] / content / shell / android / BUILD.gn
blob68b2232bc206188f005fc1ecbbcfa52d6205bf53
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     "//content/shell:content_shell_lib",
25     "//content/shell:pak",
26     "//components/crash/browser",
27     "//skia",
28     "//media/base/android",
29   ]
30   sources = [
31     "shell_library_loader.cc",
32   ]
35 android_resources("content_shell_java_resources") {
36   testonly = true
37   resource_dirs = [ "java/res" ]
38   custom_package = "org.chromium.content_shell"
41 android_library("content_shell_java") {
42   testonly = true
43   deps = [
44     "//base:base_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",
51   ]
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") {
59   testonly = true
60   input = "shell_apk/AndroidManifest.xml.jinja2"
61   output = content_shell_manifest
64 android_resources("content_shell_apk_resources") {
65   testonly = true
66   resource_dirs = [ "shell_apk/res" ]
67   deps = [
68     ":content_shell_java_resources",
69     ":content_shell_manifest",
70   ]
71   android_manifest = content_shell_manifest
74 android_library("content_shell_apk_java") {
75   testonly = true
76   deps = [
77     ":content_shell_apk_resources",
78     ":content_shell_java",
79     "//base:base_java",
80     "//content/public/android:content_java",
81     "//media/base/android:media_java",
82     "//net/android:net_java",
83     "//ui/android:ui_java",
84   ]
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") {
90   clear_dir = true
91   dest = content_shell_assets_dir
92   sources = [
93     "$root_out_dir/content_shell.pak",
94   ]
95   deps = [
96     "//content/shell:pak",
97   ]
99   if (icu_use_data_file) {
100     sources += [ "$root_build_dir/icudtl.dat" ]
101     deps += [ "//third_party/icu:icudata" ]
102   }
103   if (v8_use_external_startup_data) {
104     sources += [
105       "$root_build_dir/natives_blob.bin",
106       "$root_build_dir/snapshot_blob.bin",
107     ]
108     deps += [ "//v8" ]
109   }
112 android_apk("content_shell_apk") {
113   use_chromium_linker = true
114   testonly = true
115   data_deps = [
116     # "//tools/android/forwarder",
117   ]
118   deps = [
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",
125     "//base:base_java",
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",
132   ]
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
138   # TODO(GYP)
139   #'extra_native_libs': ['<(SHARED_LIB_DIR)/libosmesa.so'],
142 android_library("content_shell_test_java") {
143   testonly = true
144   deps = [
145     ":content_shell_java",
146     ":content_shell_apk_java",
147     "//base:base_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",
152   ]
153   DEPRECATED_java_in_dir = "javatests/src"
156 instrumentation_test_apk("content_shell_test_apk") {
157   deps = [
158     "//content/public/android:content_javatests",
159     "//base:base_javatests",
160     "//net/android:net_javatests",
161   ]
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") {
174     testonly = true
175     input = "linker_test_apk/AndroidManifest.xml.jinja2"
176     output = chromium_linker_test_manifest
177   }
179   android_resources("linker_resources") {
180     testonly = true
181     resource_dirs = [ "linker_test_apk/res" ]
182     android_manifest = chromium_linker_test_manifest
183     deps = [
184       ":chromium_linker_test_manifest",
185     ]
186   }
188   # GYP: //content/content_tests.gypi:chromium_linker_test_apk
189   android_apk("chromium_linker_test_apk") {
190     testonly = true
191     deps = [
192       ":chromium_linker_test_manifest",
193       ":content_shell_java",
194       ":copy_content_shell_assets",
195       ":linker_resources",
196       ":linker_test",
197       "//base:base_java",
198       "//content/public/android:content_java",
199       "//ui/android:ui_java",
200     ]
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
208   }
210   # GYP: //content/content_tests.gypi:chromium_android_linker_test
211   shared_library("linker_test") {
212     testonly = true
213     sources = [
214       "linker_test_apk/chromium_linker_test_android.cc",
215       "linker_test_apk/chromium_linker_test_linker_tests.cc",
216     ]
218     deps = [
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 :-(
224       "//skia",
225     ]
226   }
228   # GYP: //content/content_tests.gypi:chromium_android_linker_test_jni_headers
229   generate_jni("linker_test_jni_headers") {
230     testonly = true
231     jni_package = "content/shell"
232     sources = [
233       "linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java",
234     ]
235   }