third_party/re2: Remove remove-static-initializers.patch.
[chromium-blink-merge.git] / content / shell / android / BUILD.gn
blob3ad831e9aaad6d555bd31de2b1c47988d71018a7
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     "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",
18   ]
21 shared_library("libcontent_shell_content_view") {
22   testonly = true
23   deps = [
24     ":content_shell_jni_headers",
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   ]
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   ]
96   if (icu_use_data_file) {
97     sources += [ "$root_build_dir/icudtl.dat" ]
98   }
99   if (v8_use_external_startup_data) {
100     sources += [
101       "$root_build_dir/natives_blob.bin",
102       "$root_build_dir/snapshot_blob.bin",
103     ]
104   }
107 android_apk("content_shell_apk") {
108   use_chromium_linker = true
109   testonly = true
110   datadeps = [
111     # "//tools/android/forwarder",
112   ]
113   deps = [
114     ":content_shell_apk_resources",
115     ":content_shell_java",
116     ":content_shell_apk_java",
117     ":libcontent_shell_content_view",
118     ":copy_content_shell_assets",
119     "//base:base_java",
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",
126   ]
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
132   # TODO(GYP)
133   #'extra_native_libs': ['<(SHARED_LIB_DIR)/libosmesa.so'],
136 android_library("content_shell_test_java") {
137   testonly = true
138   deps = [
139     ":content_shell_java",
140     ":content_shell_apk_java",
141     "//base:base_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",
146   ]
147   DEPRECATED_java_in_dir = "javatests/src"
150 android_apk("content_shell_test_apk") {
151   testonly = true
152   deps = [
153     "//content/public/android:content_javatests",
154     "//base:base_javatests",
155     "//net/android:net_javatests",
156   ]
157   datadeps = [
158     ":content_shell_apk",
159   ]
160   apk_under_test = ":content_shell_apk"
161   apk_name = "ContentShellTest"
162   android_manifest = "javatests/AndroidManifest.xml"
165 if (current_cpu != "x64" && current_cpu != "arm64") {
166   chromium_linker_test_manifest =
167       "$target_gen_dir/linker_test_apk/AndroidManifest.xml"
169   jinja_template("chromium_linker_test_manifest") {
170     testonly = true
171     input = "linker_test_apk/AndroidManifest.xml.jinja2"
172     output = chromium_linker_test_manifest
173   }
175   android_resources("linker_resources") {
176     resource_dirs = [ "linker_test_apk/res" ]
177     android_manifest = chromium_linker_test_manifest
178   }
180   # GYP: //content/content_tests.gypi:chromium_linker_test_apk
181   android_apk("chromium_linker_test_apk") {
182     testonly = true
183     deps = [
184       ":content_shell_java",
185       ":copy_content_shell_assets",
186       ":linker_resources",
187       ":linker_test",
188       "//base:base_java",
189       "//content/public/android:content_java",
190       "//ui/android:ui_java",
191     ]
192     android_manifest = chromium_linker_test_manifest
193     asset_location = content_shell_assets_dir
194     apk_name = "ChromiumLinkerTest"
195     DEPRECATED_java_in_dir = "linker_test_apk/src"
196     native_libs = [ "liblinker_test.so" ]
197     use_chromium_linker = true
198     enable_chromium_linker_tests = true
199   }
201   # GYP: //content/content_tests.gypi:chromium_android_linker_test
202   shared_library("linker_test") {
203     testonly = true
204     sources = [
205       "linker_test_apk/chromium_linker_test_android.cc",
206       "linker_test_apk/chromium_linker_test_linker_tests.cc",
207     ]
209     deps = [
210       ":linker_test_jni_headers",
211       "//content/shell:content_shell_lib",
213       # Required to include "content/public/browser/android/compositor.h"
214       # in chromium_linker_test_android.cc :-(
215       "//skia",
216     ]
217   }
219   # GYP: //content/content_tests.gypi:chromium_android_linker_test_jni_headers
220   generate_jni("linker_test_jni_headers") {
221     testonly = true
222     jni_package = "content/shell"
223     sources = [
224       "linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java",
225     ]
226   }