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("//chrome/version.gni")
9 import("//testing/test.gni")
10 import("//third_party/icu/config.gni")
13 # GYP: //chrome/chrome.gyp:chrome_java (resources part)
14 android_resources("chrome_java_resources") {
15 resource_dirs = [ "java/res" ]
17 ":chrome_strings_grd",
18 "//content/public/android:content_java_resources",
19 "//chrome/app:java_strings_grd",
20 "//third_party/android_tools:android_support_v7_appcompat_resources",
22 custom_package = "org.chromium.chrome"
25 # GYP: //chrome/chrome.gyp:chrome_strings_grd
26 java_strings_grd("chrome_strings_grd") {
27 grd_file = "java/strings/android_chrome_strings.grd"
29 "values-am/android_chrome_strings.xml",
30 "values-ar/android_chrome_strings.xml",
31 "values-bg/android_chrome_strings.xml",
32 "values-ca/android_chrome_strings.xml",
33 "values-cs/android_chrome_strings.xml",
34 "values-da/android_chrome_strings.xml",
35 "values-de/android_chrome_strings.xml",
36 "values-el/android_chrome_strings.xml",
37 "values/android_chrome_strings.xml",
38 "values-en-rGB/android_chrome_strings.xml",
39 "values-es/android_chrome_strings.xml",
40 "values-es-rUS/android_chrome_strings.xml",
41 "values-fa/android_chrome_strings.xml",
42 "values-fi/android_chrome_strings.xml",
43 "values-tl/android_chrome_strings.xml",
44 "values-fr/android_chrome_strings.xml",
45 "values-hi/android_chrome_strings.xml",
46 "values-hr/android_chrome_strings.xml",
47 "values-hu/android_chrome_strings.xml",
48 "values-in/android_chrome_strings.xml",
49 "values-it/android_chrome_strings.xml",
50 "values-iw/android_chrome_strings.xml",
51 "values-ja/android_chrome_strings.xml",
52 "values-ko/android_chrome_strings.xml",
53 "values-lt/android_chrome_strings.xml",
54 "values-lv/android_chrome_strings.xml",
55 "values-nl/android_chrome_strings.xml",
56 "values-nb/android_chrome_strings.xml",
57 "values-pl/android_chrome_strings.xml",
58 "values-pt-rBR/android_chrome_strings.xml",
59 "values-pt-rPT/android_chrome_strings.xml",
60 "values-ro/android_chrome_strings.xml",
61 "values-ru/android_chrome_strings.xml",
62 "values-sk/android_chrome_strings.xml",
63 "values-sl/android_chrome_strings.xml",
64 "values-sr/android_chrome_strings.xml",
65 "values-sv/android_chrome_strings.xml",
66 "values-sw/android_chrome_strings.xml",
67 "values-th/android_chrome_strings.xml",
68 "values-tr/android_chrome_strings.xml",
69 "values-uk/android_chrome_strings.xml",
70 "values-vi/android_chrome_strings.xml",
71 "values-zh-rCN/android_chrome_strings.xml",
72 "values-zh-rTW/android_chrome_strings.xml",
76 # GYP: //chrome/chrome.gyp:chrome_java
77 android_library("chrome_java") {
79 ":chrome_java_resources",
80 ":document_tab_model_info_proto_java",
82 "//net/android:net_java",
83 "//components/bookmarks/common/android:bookmarks_java",
84 "//components/dom_distiller/android:dom_distiller_core_java",
85 "//components/gcm_driver/android:gcm_driver_java",
86 "//components/invalidation:java",
87 "//components/navigation_interception/android:navigation_interception_java",
88 "//components/variations/android:variations_java",
89 "//components/web_contents_delegate_android:web_contents_delegate_android_java",
90 "//content/public/android:content_java",
91 "//printing:printing_java",
92 "//sync/android:sync_java",
93 "//third_party/android_protobuf:protobuf_nano_javalib",
94 "//third_party/android_tools:android_support_v13_java",
95 "//third_party/android_tools:android_support_v7_appcompat_java",
96 "//third_party/cacheinvalidation:cacheinvalidation_javalib",
97 "//third_party/cacheinvalidation:cacheinvalidation_proto_java",
98 "//third_party/jsr-305:jsr_305_javalib",
99 "//third_party/libaddressinput:android_addressinput_widget_java",
100 "//third_party/libaddressinput:android_addressinput_widget_resources",
101 "//ui/android:ui_java",
102 "//ui/android:ui_java_resources",
106 ":app_banner_metrics_ids_javagen",
107 ":chrome_android_java_enums_srcjar",
108 ":chrome_version_srcjar",
109 ":resource_id_javagen",
110 "//chrome:page_info_connection_type_javagen",
111 "//chrome:content_setting_javagen",
112 "//chrome:content_settings_type_javagen",
115 DEPRECATED_java_in_dir = "java/src"
118 # GYP: //chrome/chrome_browser.gypi:activity_type_ids_java
119 # GYP: //chrome/chrome_browser.gypi:profile_account_management_metrics_java
120 # GYP: //chrome/chrome_browser.gypi:profile_sync_service_model_type_selection_java
121 # GYP: //chrome/chrome_browser.gypi:tab_load_status_java
122 # GYP: //chrome/chrome_browser.gypi:toolbar_model_security_levels_java
123 java_cpp_enum("chrome_android_java_enums_srcjar") {
125 "//chrome/browser/android/activity_type_ids.h",
126 "//chrome/browser/android/tab_android.h",
127 "//chrome/browser/profiles/profile_metrics.h",
128 "//chrome/browser/sync/profile_sync_service_android.cc",
129 "//chrome/browser/ui/toolbar/toolbar_model.h",
132 "org/chromium/chrome/browser/ActivityTypeIds.java",
133 "org/chromium/chrome/browser/TabLoadStatus.java",
134 "org/chromium/chrome/browser/profiles/ProfileAccountManagementMetrics.java",
135 "org/chromium/chrome/browser/sync/ModelTypeSelection.java",
136 "org/chromium/chrome/browser/ui/toolbar/ToolbarModelSecurityLevel.java",
140 # GYP: //chrome/chrome_browser.gypi:app_banner_metrics_ids_java
141 java_cpp_template("app_banner_metrics_ids_javagen") {
143 "java/AppBannerMetricsIds.template",
145 package_name = "org/chromium/chrome/browser/banners"
147 "../browser/android/banners/app_banner_metrics_id_list.h",
151 # GYP: //chrome/chrome_browser.gypi:document_tab_model_info_proto_java
152 proto_java_library("document_tab_model_info_proto_java") {
153 proto_path = "java/src/org/chromium/chrome/browser/tabmodel/document"
155 "$proto_path/document_tab_model_info.proto",
159 # GYP: //chrome/chrome_browser.gypi:resource_id_java
160 java_cpp_template("resource_id_javagen") {
162 "java/ResourceId.template",
164 package_name = "org/chromium/chrome/browser"
166 "../browser/android/resource_id.h",
170 # GYP: //chrome/chrome_shell.gypi:libchromeshell_base
171 group("chrome_shell_base") {
173 "//chrome/browser/ui",
174 "//chrome:chrome_android_core",
177 "//content/public/app:browser",
181 #[ 'order_profiling!=0', {
182 #'dependencies': [ '../tools/cygprofile/cygprofile.gyp:cygprofile', ],
186 # GYP: //chrome/chrome_shell.gypi:libchromeshell
187 shared_library("chrome_shell") {
190 "shell/chrome_main_delegate_chrome_shell_android.cc",
191 "shell/chrome_main_delegate_chrome_shell_android.h",
194 ":chrome_shell_base",
197 # GYP: via base/files/protect_file_posix.gypi
198 # TODO(pasko): Remove this non-trivial linker wrapping as soon as
199 # crbug.com/424562 is fixed.
200 if (!is_component_build) {
201 ldflags = [ "-Wl,--wrap=close" ]
202 deps += [ "//base:protect_file_posix" ]
206 # GYP: //chrome/chrome_shell.gypi:libchromesyncshell
207 shared_library("chrome_sync_shell") {
210 #"sync_shell/chrome_main_delegate_chrome_sync_shell_android.cc",
211 #"sync_shell/chrome_main_delegate_chrome_sync_shell_android.h",
214 "//sync:test_support_sync_fake_server_android",
217 ":chrome_shell_base",
222 android_resources("chrome_shell_resources") {
224 ":chrome_java_resources",
227 resource_dirs = [ "shell/res" ]
228 custom_package = "org.chromium.chrome.shell"
232 android_library("chrome_shell_java") {
235 ":chrome_shell_resources",
238 "//content/public/android:content_java",
239 "//components/dom_distiller/android:dom_distiller_core_java",
240 "//components/web_contents_delegate_android:web_contents_delegate_android_java",
241 "//printing:printing_java",
242 "//net/android:net_java",
243 "//sync/android:sync_java",
244 "//third_party/android_tools:android_support_v13_java",
245 "//third_party/android_tools:android_support_v7_appcompat_java",
246 "//ui/android:ui_java",
248 DEPRECATED_java_in_dir = "shell/java/src"
251 chrome_shell_assets_dir = "$root_build_dir/chrome_shell/assets"
254 copy_ex("chrome_shell_assets") {
256 dest = chrome_shell_assets_dir
258 "$root_build_dir/resources.pak",
259 "$root_build_dir/chrome_100_percent.pak",
260 "$root_build_dir/locales/am.pak",
261 "$root_build_dir/locales/ar.pak",
262 "$root_build_dir/locales/bg.pak",
263 "$root_build_dir/locales/ca.pak",
264 "$root_build_dir/locales/cs.pak",
265 "$root_build_dir/locales/da.pak",
266 "$root_build_dir/locales/de.pak",
267 "$root_build_dir/locales/el.pak",
268 "$root_build_dir/locales/en-GB.pak",
269 "$root_build_dir/locales/en-US.pak",
270 "$root_build_dir/locales/es.pak",
271 "$root_build_dir/locales/es-419.pak",
272 "$root_build_dir/locales/fa.pak",
273 "$root_build_dir/locales/fi.pak",
274 "$root_build_dir/locales/fil.pak",
275 "$root_build_dir/locales/fr.pak",
276 "$root_build_dir/locales/he.pak",
277 "$root_build_dir/locales/hi.pak",
278 "$root_build_dir/locales/hr.pak",
279 "$root_build_dir/locales/hu.pak",
280 "$root_build_dir/locales/id.pak",
281 "$root_build_dir/locales/it.pak",
282 "$root_build_dir/locales/ja.pak",
283 "$root_build_dir/locales/ko.pak",
284 "$root_build_dir/locales/lt.pak",
285 "$root_build_dir/locales/lv.pak",
286 "$root_build_dir/locales/nb.pak",
287 "$root_build_dir/locales/nl.pak",
288 "$root_build_dir/locales/pl.pak",
289 "$root_build_dir/locales/pt-BR.pak",
290 "$root_build_dir/locales/pt-PT.pak",
291 "$root_build_dir/locales/ro.pak",
292 "$root_build_dir/locales/ru.pak",
293 "$root_build_dir/locales/sk.pak",
294 "$root_build_dir/locales/sl.pak",
295 "$root_build_dir/locales/sr.pak",
296 "$root_build_dir/locales/sv.pak",
297 "$root_build_dir/locales/sw.pak",
298 "$root_build_dir/locales/th.pak",
299 "$root_build_dir/locales/tr.pak",
300 "$root_build_dir/locales/uk.pak",
301 "$root_build_dir/locales/vi.pak",
302 "$root_build_dir/locales/zh-CN.pak",
303 "$root_build_dir/locales/zh-TW.pak",
306 "//chrome:packed_resources",
307 "//chrome:packed_extra_resources",
310 if (icu_use_data_file) {
311 sources += [ "$root_build_dir/icudtl.dat" ]
313 if (v8_use_external_startup_data) {
315 "$root_build_dir/natives_blob.bin",
316 "$root_build_dir/snapshot_blob.bin",
321 chrome_shell_manifest =
322 "$target_gen_dir/chrome_shell_manifest/AndroidManifest.xml"
324 # GYP: //chrome/chrome_shell.gypi:chrome_shell_manifest
325 jinja_template("chrome_shell_manifest") {
327 input = "shell/java/AndroidManifest.xml.jinja2"
328 output = chrome_shell_manifest
331 # GYP: //chrome/chrome_shell.gypi:chrome_shell_apk
332 android_apk("chrome_shell_apk") {
336 ":chrome_shell_resources",
337 ":chrome_shell_java",
338 ":chrome_shell_assets",
341 apk_name = "ChromeShell"
342 android_manifest = chrome_shell_manifest
343 native_libs = [ "libchrome_shell.so" ]
344 asset_location = chrome_shell_assets_dir
349 #['component != "shared_library" and target_arch != "arm64" and target_arch != "x64" and profiling_full_stack_frames != 1', {
350 ## Only enable the chromium linker on regular builds, since the
351 ## component build crashes on Android 4.4. See b/11379966
352 #'use_chromium_linker': '1',
358 chrome_sync_shell_manifest =
359 "$target_gen_dir/chrome_sync_shell_manifest/AndroidManifest.xml"
361 # GYP: //chrome/chrome_shell.gypi:chrome_sync_shell_manifest
362 jinja_template("chrome_sync_shell_manifest") {
364 input = "sync_shell/java/AndroidManifest.xml.jinja2"
365 output = chrome_sync_shell_manifest
368 # GYP: //chrome/chrome_shell.gypi:chrome_sync_shell_apk
369 android_apk("chrome_sync_shell_apk") {
373 ":chrome_shell_resources",
374 ":chrome_shell_java",
375 ":chrome_shell_assets",
376 ":chrome_sync_shell",
378 apk_name = "ChromeSyncShell"
379 android_manifest = chrome_sync_shell_manifest
380 native_libs = [ "libchrome_sync_shell.so" ]
381 asset_location = chrome_shell_assets_dir
384 # GYP: part of //chrome/chrome_tests.gypi:chrome_shell_test_apk
385 android_library("chrome_javatests") {
387 DEPRECATED_java_in_dir = "javatests/src"
390 ":chrome_java_resources",
391 ":chrome_shell_java",
392 ":chrome_shell_resources",
393 ":chrome_shell_test_java",
395 "//base:base_java_test_support",
396 "//chrome/test/android:chrome_java_test_support",
397 "//components/bookmarks/common/android:bookmarks_java",
398 "//components/dom_distiller/android:dom_distiller_core_java",
399 "//components/invalidation:java",
400 "//content/public/android:content_java",
401 "//content/public/test/android:content_java_test_support",
402 "//printing:printing_java",
403 "//sync/android:sync_java",
404 "//sync:sync_java_test_support",
405 "//third_party/android_tools:android_support_v13_java",
406 "//third_party/android_tools:android_support_v7_appcompat_java",
407 "//third_party/cacheinvalidation:cacheinvalidation_javalib",
408 "//third_party/cacheinvalidation:cacheinvalidation_proto_java",
409 "//third_party/jsr-305:jsr_305_javalib",
410 "//ui/android:ui_java",
414 android_library("chrome_shell_test_java") {
418 ":chrome_shell_java",
420 "//base:base_java_test_support",
421 "//chrome/test/android:chrome_java_test_support",
422 "//content/public/android:content_java",
423 "//content/public/test/android:content_java_test_support",
424 "//third_party/android_tools:android_support_v13_java",
425 "//third_party/android_tools:android_support_v7_appcompat_java",
426 "//ui/android:ui_java",
428 DEPRECATED_java_in_dir = "shell/javatests/src"
431 # GYP: //chrome/chrome_tests.gypi:chrome_shell_test_apk
432 android_apk("chrome_shell_test_apk") {
436 ":chrome_shell_test_java",
437 "//sync/android:sync_javatests",
438 "//ui/android:ui_javatests",
440 apk_name = "ChromeShellTest"
441 android_manifest = "shell/javatests/AndroidManifest.xml"
444 # GYP: //chrome/chrome_tests.gypi:chrome_sync_shell_test_apk
445 android_apk("chrome_sync_shell_test_apk") {
449 ":chrome_shell_java",
450 ":chrome_shell_test_java",
452 "//base:base_java_test_support",
453 "//chrome/test/android:chrome_java_test_support",
454 "//components/invalidation:java",
455 "//content/public/android:content_java",
456 "//content/public/test/android:content_java_test_support",
457 "//sync/android:sync_java",
458 "//sync:sync_java_test_support",
459 "//third_party/android_tools:android_support_v13_java",
460 "//third_party/android_tools:android_support_v7_appcompat_java",
462 apk_name = "ChromeSyncShellTest"
463 DEPRECATED_java_in_dir = "sync_shell/javatests/src"
464 android_manifest = "sync_shell/javatests/AndroidManifest.xml"
467 # GYP: //chrome/chrome_tests.gypi:chrome_shell_uiautomator_tests_java
468 android_library("uiautomator_tests_java") {
470 DEPRECATED_java_in_dir = "uiautomator_tests/src"
472 "//base:base_java_test_support",
473 "//third_party/android_tools:uiautomator_java",
477 # GYP: //chrome/chrome_tests.gypi:chrome_shell_uiautomator_tests
478 uiautomator_test("uiautomator_tests") {
481 ":uiautomator_tests_java",
485 # GYP: //chrome/chrome_android.gypi:chrome_version_java
486 chrome_version_java_dir = "$root_gen_dir/templates/chrome_version_java"
487 chrome_version_java_file = "$chrome_version_java_dir/org/chromium/chrome/browser/ChromeVersionConstants.java"
488 process_version("chrome_version_java") {
489 source = "java/ChromeVersionConstants.java.version"
490 output = chrome_version_java_file
493 "CHANNEL=str.upper('$android_channel')",
497 zip("chrome_version_srcjar") {
499 chrome_version_java_file,
501 output = "$target_gen_dir/$target_name.srcjar"
502 base_dir = chrome_version_java_dir