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 # This file must always be included in the shared_library step to ensure
191 # JNI_OnLoad is exported.
192 "//chrome/app/android/chrome_jni_onload.cc",
193 "shell/chrome_main_delegate_chrome_shell_android.cc",
194 "shell/chrome_main_delegate_chrome_shell_android.h",
197 ":chrome_shell_base",
200 # GYP: via base/files/protect_file_posix.gypi
201 # TODO(pasko): Remove this non-trivial linker wrapping as soon as
202 # crbug.com/424562 is fixed.
203 if (!is_component_build) {
204 ldflags = [ "-Wl,--wrap=close" ]
205 deps += [ "//base:protect_file_posix" ]
209 # GYP: //chrome/chrome_shell.gypi:libchromesyncshell
210 shared_library("chrome_sync_shell") {
213 # This file must always be included in the shared_library step to ensure
214 # JNI_OnLoad is exported.
215 #"//chrome/app/android/chrome_jni_onload.cc",
216 #"sync_shell/chrome_main_delegate_chrome_sync_shell_android.cc",
217 #"sync_shell/chrome_main_delegate_chrome_sync_shell_android.h",
220 "//sync:test_support_sync_fake_server_android",
223 ":chrome_shell_base",
228 android_resources("chrome_shell_resources") {
230 ":chrome_java_resources",
233 resource_dirs = [ "shell/res" ]
234 custom_package = "org.chromium.chrome.shell"
238 android_library("chrome_shell_java") {
241 ":chrome_shell_resources",
244 "//content/public/android:content_java",
245 "//components/dom_distiller/android:dom_distiller_core_java",
246 "//components/web_contents_delegate_android:web_contents_delegate_android_java",
247 "//printing:printing_java",
248 "//net/android:net_java",
249 "//sync/android:sync_java",
250 "//third_party/android_tools:android_support_v13_java",
251 "//third_party/android_tools:android_support_v7_appcompat_java",
252 "//ui/android:ui_java",
254 DEPRECATED_java_in_dir = "shell/java/src"
257 chrome_shell_assets_dir = "$root_build_dir/chrome_shell/assets"
260 copy_ex("chrome_shell_assets") {
262 dest = chrome_shell_assets_dir
264 "$root_build_dir/resources.pak",
265 "$root_build_dir/chrome_100_percent.pak",
266 "$root_build_dir/locales/am.pak",
267 "$root_build_dir/locales/ar.pak",
268 "$root_build_dir/locales/bg.pak",
269 "$root_build_dir/locales/ca.pak",
270 "$root_build_dir/locales/cs.pak",
271 "$root_build_dir/locales/da.pak",
272 "$root_build_dir/locales/de.pak",
273 "$root_build_dir/locales/el.pak",
274 "$root_build_dir/locales/en-GB.pak",
275 "$root_build_dir/locales/en-US.pak",
276 "$root_build_dir/locales/es.pak",
277 "$root_build_dir/locales/es-419.pak",
278 "$root_build_dir/locales/fa.pak",
279 "$root_build_dir/locales/fi.pak",
280 "$root_build_dir/locales/fil.pak",
281 "$root_build_dir/locales/fr.pak",
282 "$root_build_dir/locales/he.pak",
283 "$root_build_dir/locales/hi.pak",
284 "$root_build_dir/locales/hr.pak",
285 "$root_build_dir/locales/hu.pak",
286 "$root_build_dir/locales/id.pak",
287 "$root_build_dir/locales/it.pak",
288 "$root_build_dir/locales/ja.pak",
289 "$root_build_dir/locales/ko.pak",
290 "$root_build_dir/locales/lt.pak",
291 "$root_build_dir/locales/lv.pak",
292 "$root_build_dir/locales/nb.pak",
293 "$root_build_dir/locales/nl.pak",
294 "$root_build_dir/locales/pl.pak",
295 "$root_build_dir/locales/pt-BR.pak",
296 "$root_build_dir/locales/pt-PT.pak",
297 "$root_build_dir/locales/ro.pak",
298 "$root_build_dir/locales/ru.pak",
299 "$root_build_dir/locales/sk.pak",
300 "$root_build_dir/locales/sl.pak",
301 "$root_build_dir/locales/sr.pak",
302 "$root_build_dir/locales/sv.pak",
303 "$root_build_dir/locales/sw.pak",
304 "$root_build_dir/locales/th.pak",
305 "$root_build_dir/locales/tr.pak",
306 "$root_build_dir/locales/uk.pak",
307 "$root_build_dir/locales/vi.pak",
308 "$root_build_dir/locales/zh-CN.pak",
309 "$root_build_dir/locales/zh-TW.pak",
312 "//chrome:packed_resources",
313 "//chrome:packed_extra_resources",
316 if (icu_use_data_file) {
317 sources += [ "$root_build_dir/icudtl.dat" ]
319 if (v8_use_external_startup_data) {
321 "$root_build_dir/natives_blob.bin",
322 "$root_build_dir/snapshot_blob.bin",
327 chrome_shell_manifest =
328 "$target_gen_dir/chrome_shell_manifest/AndroidManifest.xml"
330 # GYP: //chrome/chrome_shell.gypi:chrome_shell_manifest
331 jinja_template("chrome_shell_manifest") {
333 input = "shell/java/AndroidManifest.xml.jinja2"
334 output = chrome_shell_manifest
337 # GYP: //chrome/chrome_shell.gypi:chrome_shell_apk
338 android_apk("chrome_shell_apk") {
342 ":chrome_shell_resources",
343 ":chrome_shell_java",
344 ":chrome_shell_assets",
347 apk_name = "ChromeShell"
348 android_manifest = chrome_shell_manifest
349 native_libs = [ "libchrome_shell.so" ]
350 asset_location = chrome_shell_assets_dir
355 #['component != "shared_library" and target_arch != "arm64" and target_arch != "x64" and profiling_full_stack_frames != 1', {
356 ## Only enable the chromium linker on regular builds, since the
357 ## component build crashes on Android 4.4. See b/11379966
358 #'use_chromium_linker': '1',
364 chrome_sync_shell_manifest =
365 "$target_gen_dir/chrome_sync_shell_manifest/AndroidManifest.xml"
367 # GYP: //chrome/chrome_shell.gypi:chrome_sync_shell_manifest
368 jinja_template("chrome_sync_shell_manifest") {
370 input = "sync_shell/java/AndroidManifest.xml.jinja2"
371 output = chrome_sync_shell_manifest
374 # GYP: //chrome/chrome_shell.gypi:chrome_sync_shell_apk
375 android_apk("chrome_sync_shell_apk") {
379 ":chrome_shell_resources",
380 ":chrome_shell_java",
381 ":chrome_shell_assets",
382 ":chrome_sync_shell",
384 apk_name = "ChromeSyncShell"
385 android_manifest = chrome_sync_shell_manifest
386 native_libs = [ "libchrome_sync_shell.so" ]
387 asset_location = chrome_shell_assets_dir
390 # GYP: part of //chrome/chrome_tests.gypi:chrome_shell_test_apk
391 android_library("chrome_javatests") {
393 DEPRECATED_java_in_dir = "javatests/src"
396 ":chrome_java_resources",
397 ":chrome_shell_java",
398 ":chrome_shell_resources",
399 ":chrome_shell_test_java",
401 "//base:base_java_test_support",
402 "//chrome/test/android:chrome_java_test_support",
403 "//components/bookmarks/common/android:bookmarks_java",
404 "//components/dom_distiller/android:dom_distiller_core_java",
405 "//components/invalidation:java",
406 "//content/public/android:content_java",
407 "//content/public/test/android:content_java_test_support",
408 "//printing:printing_java",
409 "//sync/android:sync_java",
410 "//sync:sync_java_test_support",
411 "//third_party/android_tools:android_support_v13_java",
412 "//third_party/android_tools:android_support_v7_appcompat_java",
413 "//third_party/cacheinvalidation:cacheinvalidation_javalib",
414 "//third_party/cacheinvalidation:cacheinvalidation_proto_java",
415 "//third_party/jsr-305:jsr_305_javalib",
416 "//ui/android:ui_java",
420 android_library("chrome_shell_test_java") {
424 ":chrome_shell_java",
426 "//base:base_java_test_support",
427 "//chrome/test/android:chrome_java_test_support",
428 "//content/public/android:content_java",
429 "//content/public/test/android:content_java_test_support",
430 "//third_party/android_tools:android_support_v13_java",
431 "//third_party/android_tools:android_support_v7_appcompat_java",
432 "//ui/android:ui_java",
434 DEPRECATED_java_in_dir = "shell/javatests/src"
437 # GYP: //chrome/chrome_tests.gypi:chrome_shell_test_apk
438 android_apk("chrome_shell_test_apk") {
442 ":chrome_shell_test_java",
443 "//sync/android:sync_javatests",
444 "//ui/android:ui_javatests",
446 apk_name = "ChromeShellTest"
447 android_manifest = "shell/javatests/AndroidManifest.xml"
450 # GYP: //chrome/chrome_tests.gypi:chrome_sync_shell_test_apk
451 android_apk("chrome_sync_shell_test_apk") {
455 ":chrome_shell_java",
456 ":chrome_shell_test_java",
458 "//base:base_java_test_support",
459 "//chrome/test/android:chrome_java_test_support",
460 "//components/invalidation:java",
461 "//content/public/android:content_java",
462 "//content/public/test/android:content_java_test_support",
463 "//sync/android:sync_java",
464 "//sync:sync_java_test_support",
465 "//third_party/android_tools:android_support_v13_java",
466 "//third_party/android_tools:android_support_v7_appcompat_java",
468 apk_name = "ChromeSyncShellTest"
469 DEPRECATED_java_in_dir = "sync_shell/javatests/src"
470 android_manifest = "sync_shell/javatests/AndroidManifest.xml"
473 # GYP: //chrome/chrome_tests.gypi:chrome_shell_uiautomator_tests_java
474 android_library("uiautomator_tests_java") {
476 DEPRECATED_java_in_dir = "uiautomator_tests/src"
478 "//base:base_java_test_support",
479 "//third_party/android_tools:uiautomator_java",
483 # GYP: //chrome/chrome_tests.gypi:chrome_shell_uiautomator_tests
484 uiautomator_test("uiautomator_tests") {
487 ":uiautomator_tests_java",
491 # GYP: //chrome/chrome_android.gypi:chrome_version_java
492 chrome_version_java_dir = "$root_gen_dir/templates/chrome_version_java"
493 chrome_version_java_file = "$chrome_version_java_dir/org/chromium/chrome/browser/ChromeVersionConstants.java"
494 process_version("chrome_version_java") {
495 source = "java/ChromeVersionConstants.java.version"
496 output = chrome_version_java_file
499 "CHANNEL=str.upper('$android_channel')",
503 zip("chrome_version_srcjar") {
505 chrome_version_java_file,
507 output = "$target_gen_dir/$target_name.srcjar"
508 base_dir = chrome_version_java_dir