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("//chrome/version.gni")
8 import("//third_party/icu/config.gni")
11 # GYP: //chrome/chrome.gyp:chrome_java (resources part)
12 android_resources("chrome_java_resources") {
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",
81 "//net/android:net_java",
82 "//components/bookmarks/common/android:bookmarks_java",
83 "//components/dom_distiller/android:dom_distiller_core_java",
84 "//components/gcm_driver/android:gcm_driver_java",
85 "//components/invalidation:java",
86 "//components/navigation_interception/android:navigation_interception_java",
87 "//components/variations/android:variations_java",
88 "//components/web_contents_delegate_android:web_contents_delegate_android_java",
89 "//content/public/android:content_java",
90 "//printing:printing_java",
91 "//sync/android:sync_java",
92 "//third_party/android_tools:android_support_v13_java",
93 "//third_party/android_tools:android_support_v7_appcompat_java",
94 "//third_party/cacheinvalidation:cacheinvalidation_javalib",
95 "//third_party/cacheinvalidation:cacheinvalidation_proto_java",
96 "//third_party/jsr-305:jsr_305_javalib",
97 "//ui/android:ui_java",
98 "//ui/android:ui_java_resources",
102 ":activity_type_ids_javagen",
103 ":app_banner_metrics_ids_javagen",
104 ":profile_account_management_metrics_javagen",
105 ":profile_sync_service_model_type_selection_javagen",
106 ":resource_id_javagen",
107 ":toolbar_model_security_levels_javagen",
108 ":tab_load_status_javagen",
109 ":chrome_version_srcjar",
110 "//chrome:page_info_connection_type_javagen",
113 DEPRECATED_java_in_dir = "java/src"
116 # GYP: //chrome/chrome_browser.gypi:activity_type_ids_java
117 java_cpp_template("activity_type_ids_javagen") {
119 "java/ActivityTypeIds.template",
121 package_name = "org/chromium/chrome/browser"
123 "../browser/android/activity_type_id_list.h"
127 # GYP: //chrome/chrome_browser.gypi:app_banner_metrics_ids_java
128 java_cpp_template("app_banner_metrics_ids_javagen") {
130 "java/AppBannerMetricsIds.template",
132 package_name = "org/chromium/chrome/browser/banners"
134 "../browser/android/banners/app_banner_metrics_id_list.h"
138 # GYP: //chrome/chrome_browser.gypi:resource_id_java
139 java_cpp_template("resource_id_javagen") {
141 "java/ResourceId.template",
143 package_name = "org/chromium/chrome/browser"
145 "../browser/android/resource_id.h"
149 # GYP: //chrome/chrome_browser.gypi:profile_account_management_metrics_java
150 java_cpp_template("profile_account_management_metrics_javagen") {
152 "java/ProfileAccountManagementMetrics.template",
154 package_name = "org/chromium/chrome/browser/profiles"
156 "../browser/profiles/profile_metrics_list.h"
160 # GYP: //chrome/chrome_browser.gypi:profile_sync_service_model_type_selection_java
161 java_cpp_template("profile_sync_service_model_type_selection_javagen") {
163 "java/ModelTypeSelection.template",
165 package_name = "org/chromium/chrome/browser/sync"
167 "../browser/sync/profile_sync_service_model_type_selection_android.h"
171 # GYP: //chrome/chrome_browser.gypi:toolbar_model_security_levels_java
172 java_cpp_template("toolbar_model_security_levels_javagen") {
174 "java/ToolbarModelSecurityLevel.template",
176 package_name = "org/chromium/chrome/browser/ui/toolbar"
178 "../browser/ui/toolbar/toolbar_model_security_level_list.h"
182 # GYP: //chrome/chrome_browser.gypi:tab_load_status_java
183 java_cpp_template("tab_load_status_javagen") {
185 "java/TabLoadStatus.template",
187 package_name = "org/chromium/chrome/browser"
189 "../browser/android/tab_load_status.h"
193 # GYP: //chrome/chrome_shell.gypi:libchromeshell_base
194 static_library("chrome_shell_base") {
196 "shell/chrome_shell_google_location_settings_helper.cc",
197 "shell/chrome_shell_google_location_settings_helper.h",
201 "//chrome/browser/ui",
202 "//chrome:chrome_android_core",
205 "//content/public/app:browser",
210 #[ 'order_profiling!=0', {
212 #[ 'OS=="android"', {
213 #'dependencies': [ '../tools/cygprofile/cygprofile.gyp:cygprofile', ],
219 # TODO(GYP, cjhopman): make chrome_shell_base actually link and then move it to
220 # deps. Also, actually compile the main delegates at that point.
221 # GYP: //chrome/chrome_browser.gypi:libchromeshell
222 shared_library("chrome_shell") {
225 # This file must always be included in the shared_library step to ensure
226 # JNI_OnLoad is exported.
227 #"//chrome/app/android/chrome_jni_onload.cc",
228 #"shell/chrome_main_delegate_chrome_shell_android.cc",
229 #"shell/chrome_main_delegate_chrome_shell_android.h",
232 #":chrome_shell_base",
234 deps = [ ":chrome_java" ]
240 # GYP: //chrome/chrome_browser.gypi:libchromesyncshell
241 shared_library("chrome_sync_shell") {
244 # This file must always be included in the shared_library step to ensure
245 # JNI_OnLoad is exported.
246 #"//chrome/app/android/chrome_jni_onload.cc",
247 #"sync_shell/chrome_main_delegate_chrome_sync_shell_android.cc",
248 #"sync_shell/chrome_main_delegate_chrome_sync_shell_android.h",
251 "//sync:test_support_sync_fake_server_android",
254 ":chrome_shell_base",
259 android_resources("chrome_shell_resources") {
261 ":chrome_java_resources",
264 resource_dirs = [ "shell/res" ]
265 custom_package = "org.chromium.chrome.shell"
269 android_library("chrome_shell_java") {
272 ":chrome_shell_resources",
275 "//content/public/android:content_java",
276 "//components/dom_distiller/android:dom_distiller_core_java",
277 "//components/web_contents_delegate_android:web_contents_delegate_android_java",
278 "//printing:printing_java",
279 "//net/android:net_java",
280 "//sync/android:sync_java",
281 "//ui/android:ui_java",
283 DEPRECATED_java_in_dir = "shell/java/src"
286 chrome_shell_assets_dir = "$root_build_dir/chrome_shell/assets"
289 copy_ex("chrome_shell_assets") {
291 dest = chrome_shell_assets_dir
293 "$root_build_dir/resources.pak",
294 "$root_build_dir/chrome_100_percent.pak",
295 "$root_build_dir/locales/am.pak",
296 "$root_build_dir/locales/ar.pak",
297 "$root_build_dir/locales/bg.pak",
298 "$root_build_dir/locales/ca.pak",
299 "$root_build_dir/locales/cs.pak",
300 "$root_build_dir/locales/da.pak",
301 "$root_build_dir/locales/de.pak",
302 "$root_build_dir/locales/el.pak",
303 "$root_build_dir/locales/en-GB.pak",
304 "$root_build_dir/locales/en-US.pak",
305 "$root_build_dir/locales/es.pak",
306 "$root_build_dir/locales/es-419.pak",
307 "$root_build_dir/locales/fa.pak",
308 "$root_build_dir/locales/fi.pak",
309 "$root_build_dir/locales/fil.pak",
310 "$root_build_dir/locales/fr.pak",
311 "$root_build_dir/locales/he.pak",
312 "$root_build_dir/locales/hi.pak",
313 "$root_build_dir/locales/hr.pak",
314 "$root_build_dir/locales/hu.pak",
315 "$root_build_dir/locales/id.pak",
316 "$root_build_dir/locales/it.pak",
317 "$root_build_dir/locales/ja.pak",
318 "$root_build_dir/locales/ko.pak",
319 "$root_build_dir/locales/lt.pak",
320 "$root_build_dir/locales/lv.pak",
321 "$root_build_dir/locales/nb.pak",
322 "$root_build_dir/locales/nl.pak",
323 "$root_build_dir/locales/pl.pak",
324 "$root_build_dir/locales/pt-BR.pak",
325 "$root_build_dir/locales/pt-PT.pak",
326 "$root_build_dir/locales/ro.pak",
327 "$root_build_dir/locales/ru.pak",
328 "$root_build_dir/locales/sk.pak",
329 "$root_build_dir/locales/sl.pak",
330 "$root_build_dir/locales/sr.pak",
331 "$root_build_dir/locales/sv.pak",
332 "$root_build_dir/locales/sw.pak",
333 "$root_build_dir/locales/th.pak",
334 "$root_build_dir/locales/tr.pak",
335 "$root_build_dir/locales/uk.pak",
336 "$root_build_dir/locales/vi.pak",
337 "$root_build_dir/locales/zh-CN.pak",
338 "$root_build_dir/locales/zh-TW.pak",
341 "//chrome:packed_resources",
342 "//chrome:packed_extra_resources",
345 if (icu_use_data_file) {
347 "$root_build_dir/icudtl.dat"
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',
363 # GYP: //chrome/chrome_browser.gypi:chrome_shell_apk
364 android_apk("chrome_shell_apk") {
367 ":chrome_shell_resources",
368 ":chrome_shell_java",
369 ":chrome_shell_assets",
372 apk_name = "ChromeShell"
373 android_manifest = "shell/java/AndroidManifest.xml"
375 "$root_build_dir/lib.stripped/libchrome_shell.so"
377 asset_location = chrome_shell_assets_dir
380 # GYP: //chrome/chrome_browser.gypi:chrome_sync_shell_apk
381 android_apk("chrome_sync_shell_apk") {
384 ":chrome_shell_resources",
385 ":chrome_shell_java",
386 ":chrome_shell_assets",
387 ":chrome_sync_shell",
389 apk_name = "ChromeSyncShell"
390 android_manifest = "sync_shell/java/AndroidManifest.xml"
392 "$root_build_dir/lib.stripped/libchrome_sync_shell.so"
394 asset_location = chrome_shell_assets_dir
397 # GYP: //chrome/chrome_android.gypi:chrome_version_java
398 chrome_version_java_dir = "$root_gen_dir/templates/chrome_version_java"
399 chrome_version_java_file = "$chrome_version_java_dir/org/chromium/chrome/browser/ChromeVersionConstants.java"
400 process_version("chrome_version_java") {
401 source = "java/ChromeVersionConstants.java.version"
402 output = chrome_version_java_file
405 zip("chrome_version_srcjar") {
406 inputs = [ chrome_version_java_file ]
407 output = "$target_gen_dir/$target_name.srcjar"
408 base_dir = chrome_version_java_dir