Update CrOS OOBE throbber to MD throbber; delete old asset
[chromium-blink-merge.git] / chrome / android / BUILD.gn
blob2baab32cd3e21a09d3659d9d8652a507bd7a1250
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")
11 import("//third_party/protobuf/proto_library.gni")
12 import("channel.gni")
14 manifest_package = "org.chromium.chrome"
15 if (enable_configuration_policy) {
16   configuration_policy = 1
17 } else {
18   configuration_policy = 0
21 jinja_variables = [
22   "channel=$android_channel",
23   "manifest_package=$manifest_package",
24   "configuration_policy=$configuration_policy",
27 chrome_android_paks_gypi =
28     exec_script("//build/gypi_to_gn.py",
29                 [
30                   rebase_path("//chrome/chrome_android_paks.gypi"),
31                   "--replace=<(PRODUCT_DIR)=$root_out_dir",
32                 ],
33                 "scope",
34                 [ "//chrome/chrome_android_paks.gypi" ])
36 locale_pak_resources("chrome_locale_paks") {
37   sources = chrome_android_paks_gypi.chrome_android_pak_locale_resources
39   deps = [
40     "//chrome:packed_resources",
41   ]
44 # GYP: //chrome/chrome.gyp:chrome_java (resources part)
45 android_resources("chrome_java_resources") {
46   if (!defined(android_branding_res_dirs)) {
47     android_branding_res_dirs = [ "//chrome/android/java/res_chromium" ]
48   }
49   resource_dirs = [ "java/res" ] + android_branding_res_dirs
50   deps = [
51     ":chrome_locale_paks",
52     ":chrome_strings_grd",
53     "//components/policy:app_restrictions_resources",
54     "//content/public/android:content_java_resources",
55     "//chrome/app:java_strings_grd",
56     "//third_party/android_data_chart:android_data_chart_java_resources",
57     "//third_party/android_media:android_media_resources",
58   ]
59   if (!enable_configuration_policy) {
60     deps -= [ "//components/policy:app_restrictions_resources" ]
61   }
62   custom_package = "org.chromium.chrome"
65 # GYP: //chrome/chrome.gyp:chrome_strings_grd
66 java_strings_grd("chrome_strings_grd") {
67   grd_file = "java/strings/android_chrome_strings.grd"
68   outputs = [
69     "values-am/android_chrome_strings.xml",
70     "values-ar/android_chrome_strings.xml",
71     "values-bg/android_chrome_strings.xml",
72     "values-ca/android_chrome_strings.xml",
73     "values-cs/android_chrome_strings.xml",
74     "values-da/android_chrome_strings.xml",
75     "values-de/android_chrome_strings.xml",
76     "values-el/android_chrome_strings.xml",
77     "values/android_chrome_strings.xml",
78     "values-en-rGB/android_chrome_strings.xml",
79     "values-es/android_chrome_strings.xml",
80     "values-es-rUS/android_chrome_strings.xml",
81     "values-fa/android_chrome_strings.xml",
82     "values-fi/android_chrome_strings.xml",
83     "values-tl/android_chrome_strings.xml",
84     "values-fr/android_chrome_strings.xml",
85     "values-hi/android_chrome_strings.xml",
86     "values-hr/android_chrome_strings.xml",
87     "values-hu/android_chrome_strings.xml",
88     "values-in/android_chrome_strings.xml",
89     "values-it/android_chrome_strings.xml",
90     "values-iw/android_chrome_strings.xml",
91     "values-ja/android_chrome_strings.xml",
92     "values-ko/android_chrome_strings.xml",
93     "values-lt/android_chrome_strings.xml",
94     "values-lv/android_chrome_strings.xml",
95     "values-nl/android_chrome_strings.xml",
96     "values-nb/android_chrome_strings.xml",
97     "values-pl/android_chrome_strings.xml",
98     "values-pt-rBR/android_chrome_strings.xml",
99     "values-pt-rPT/android_chrome_strings.xml",
100     "values-ro/android_chrome_strings.xml",
101     "values-ru/android_chrome_strings.xml",
102     "values-sk/android_chrome_strings.xml",
103     "values-sl/android_chrome_strings.xml",
104     "values-sr/android_chrome_strings.xml",
105     "values-sv/android_chrome_strings.xml",
106     "values-sw/android_chrome_strings.xml",
107     "values-th/android_chrome_strings.xml",
108     "values-tr/android_chrome_strings.xml",
109     "values-uk/android_chrome_strings.xml",
110     "values-vi/android_chrome_strings.xml",
111     "values-zh-rCN/android_chrome_strings.xml",
112     "values-zh-rTW/android_chrome_strings.xml",
113   ]
116 # GYP: //chrome/chrome.gyp:chrome_java
117 android_library("chrome_java") {
118   deps = [
119     ":chrome_java_resources",
120     ":document_tab_model_info_proto_java",
121     "//base:base_java",
122     "//net/android:net_java",
123     "//components/bookmarks/common/android:bookmarks_java",
124     "//components/dom_distiller/android:dom_distiller_content_java",
125     "//components/dom_distiller/android:dom_distiller_core_java",
126     "//components/gcm_driver/android:gcm_driver_java",
127     "//components/invalidation/impl:java",
128     "//components/navigation_interception/android:navigation_interception_java",
129     "//components/policy/android:policy_java",
130     "//components/precache/android:precache_java",
131     "//components/safe_json/android:safe_json_java",
132     "//components/service_tab_launcher:service_tab_launcher_java",
133     "//components/signin/core/browser/android:java",
134     "//components/variations/android:variations_java",
135     "//components/web_contents_delegate_android:web_contents_delegate_android_java",
136     "//content/public/android:content_java",
137     "//media/base/android:media_java",
138     "//printing:printing_java",
139     "//sync/android:sync_java",
140     "//third_party/android_data_chart:android_data_chart_java",
141     "//third_party/android_media:android_media_java",
142     "//third_party/android_protobuf:protobuf_nano_javalib",
143     "//third_party/android_swipe_refresh:android_swipe_refresh_java",
144     "//third_party/android_tools:android_gcm_java",
145     "//third_party/android_tools:android_support_design_java",
146     "//third_party/android_tools:android_support_v13_java",
147     "//third_party/android_tools:android_support_v7_appcompat_java",
148     "//third_party/android_tools:android_support_v7_mediarouter_java",
149     "//third_party/android_tools:android_support_v7_mediarouter_resources",
150     "//third_party/android_tools:android_support_v7_recyclerview_java",
151     "//third_party/cacheinvalidation:cacheinvalidation_javalib",
152     "//third_party/cacheinvalidation:cacheinvalidation_proto_java",
153     "//third_party/jsr-305:jsr_305_javalib",
154     "//third_party/WebKit/public:blink_headers_java",
155     "//media/base/android:media_java",
156     "//media/midi:midi_java",
157     "//ui/android:ui_java",
158     "//ui/android:ui_java_resources",
159     google_play_services_library,
160   ]
162   srcjar_deps = [
163     ":chrome_android_java_enums_srcjar",
164     ":chrome_version_srcjar",
165     ":custom_tabs_service_aidl",
166     ":resource_id_javagen",
167     "//chrome:page_info_connection_type_javagen",
168     "//chrome:content_setting_javagen",
169     "//chrome:content_settings_type_javagen",
170     "//components/enhanced_bookmarks:enhanced_bookmarks_java_enums_srcjar",
171     "//components/offline_pages:offline_pages_enums_java",
172   ]
174   DEPRECATED_java_in_dir = "java/src"
177 # GYP: //chrome/chrome_browser.gypi:activity_type_ids_java
178 # GYP: //chrome/chrome_browser.gypi:connectivity_check_result_java
179 # GYP: //chrome/chrome_browser.gypi:shortcut_source_java
180 # GYP: //chrome/chrome_browser.gypi:profile_account_management_metrics_java
181 # GYP: //chrome/chrome_browser.gypi:connection_security_security_levels_java
182 # GYP: //chrome/chrome_browser.gypi:tab_load_status_java
183 java_cpp_enum("chrome_android_java_enums_srcjar") {
184   sources = [
185     "//chrome/browser/android/activity_type_ids.h",
186     "//chrome/browser/android/feedback/connectivity_checker.cc",
187     "//chrome/browser/android/shortcut_info.h",
188     "//chrome/browser/android/tab_android.h",
189     "//chrome/browser/profiles/profile_metrics.h",
190     "//chrome/browser/ssl/connection_security.h",
191   ]
192   outputs = [
193     "org/chromium/chrome/browser/ActivityTypeIds.java",
194     "org/chromium/chrome/browser/feedback/ConnectivityCheckResult.java",
195     "org/chromium/chrome/browser/ShortcutSource.java",
196     "org/chromium/chrome/browser/TabLoadStatus.java",
197     "org/chromium/chrome/browser/profiles/ProfileAccountManagementMetrics.java",
198     "org/chromium/chrome/browser/ssl/ConnectionSecurityLevel.java",
199   ]
202 # GYP: //chrome/chrome_browser.gypi:document_tab_model_info_proto_java
203 proto_java_library("document_tab_model_info_proto_java") {
204   proto_path = "java/src/org/chromium/chrome/browser/tabmodel/document"
205   sources = [
206     "$proto_path/document_tab_model_info.proto",
207   ]
210 # GYP: //chrome/chrome_browser.gypi:resource_id_java
211 java_cpp_template("resource_id_javagen") {
212   sources = [
213     "java/ResourceId.template",
214   ]
215   package_name = "org/chromium/chrome/browser"
216   inputs = [
217     "../browser/android/resource_id.h",
218   ]
221 # GYP: //chrome/chrome_shell.gypi:libchromeshell_base
222 group("chrome_shell_base") {
223   deps = [
224     "//chrome/browser/ui",
225     "//chrome:chrome_android_core",
226     "//base",
227     "//base/allocator",
228     "//content/public/app:both",
229     "//skia",
230   ]
231   # TODO(GYP):
232   #[ 'order_profiling!=0', {
233   #'dependencies': [ '../tools/cygprofile/cygprofile.gyp:cygprofile', ],
234   #}],
237 # GYP: //chrome/chrome_shell.gypi:libchromeshell
238 shared_library("chrome_shell") {
239   testonly = true
240   sources = [
241     "shell/chrome_main_delegate_chrome_shell_android.cc",
242     "shell/chrome_main_delegate_chrome_shell_android.h",
243     "shell/chrome_shell_entry_point.cc",
244   ]
245   deps = [
246     ":chrome_shell_base",
247   ]
250 # GYP: //chrome/chrome_shell.gypi:libchromesyncshell
251 shared_library("chrome_sync_shell") {
252   testonly = true
253   sources = [
254     #"shell/chrome_shell_entry_point.cc",
255     #"sync_shell/chrome_main_delegate_chrome_sync_shell_android.cc",
256     #"sync_shell/chrome_main_delegate_chrome_sync_shell_android.h",
257   ]
258   deps = [
259     "//sync:test_support_sync_fake_server_android",
260   ]
261   data_deps = [ ":chrome_shell_base" ]
264 # GYP: N/A
265 android_resources("chrome_shell_resources") {
266   deps = [
267     ":chrome_java_resources",
268   ]
269   testonly = true
270   resource_dirs = [ "shell/res" ]
271   custom_package = "org.chromium.chrome.shell"
274 # GYP: N/A
275 android_library("chrome_shell_java") {
276   testonly = true
277   deps = [
278     ":chrome_java",
279     ":chrome_java_resources",
280     ":chrome_shell_resources",
281     "//base:base_java",
282     "//content/public/android:content_java",
283     "//components/dom_distiller/android:dom_distiller_content_java",
284     "//components/dom_distiller/android:dom_distiller_core_java",
285     "//components/service_tab_launcher:service_tab_launcher_java",
286     "//components/web_contents_delegate_android:web_contents_delegate_android_java",
287     "//printing:printing_java",
288     "//net/android:net_java",
289     "//sync/android:sync_java",
290     "//third_party/android_tools:android_support_v13_java",
291     "//third_party/android_tools:android_support_v7_appcompat_java",
292     "//ui/android:ui_java",
293   ]
294   DEPRECATED_java_in_dir = "shell/java/src"
297 chrome_shell_assets_dir = "$root_build_dir/chrome_shell/assets"
299 # GYP: N/A
300 copy_ex("chrome_shell_assets") {
301   clear_dir = true
302   dest = chrome_shell_assets_dir
303   sources = [
304     "$root_build_dir/chrome_100_percent.pak",
305     "$root_build_dir/locales/am.pak",
306     "$root_build_dir/locales/ar.pak",
307     "$root_build_dir/locales/bg.pak",
308     "$root_build_dir/locales/ca.pak",
309     "$root_build_dir/locales/cs.pak",
310     "$root_build_dir/locales/da.pak",
311     "$root_build_dir/locales/de.pak",
312     "$root_build_dir/locales/el.pak",
313     "$root_build_dir/locales/en-GB.pak",
314     "$root_build_dir/locales/en-US.pak",
315     "$root_build_dir/locales/es-419.pak",
316     "$root_build_dir/locales/es.pak",
317     "$root_build_dir/locales/fa.pak",
318     "$root_build_dir/locales/fi.pak",
319     "$root_build_dir/locales/fil.pak",
320     "$root_build_dir/locales/fr.pak",
321     "$root_build_dir/locales/he.pak",
322     "$root_build_dir/locales/hi.pak",
323     "$root_build_dir/locales/hr.pak",
324     "$root_build_dir/locales/hu.pak",
325     "$root_build_dir/locales/id.pak",
326     "$root_build_dir/locales/it.pak",
327     "$root_build_dir/locales/ja.pak",
328     "$root_build_dir/locales/ko.pak",
329     "$root_build_dir/locales/lt.pak",
330     "$root_build_dir/locales/lv.pak",
331     "$root_build_dir/locales/nb.pak",
332     "$root_build_dir/locales/nl.pak",
333     "$root_build_dir/locales/pl.pak",
334     "$root_build_dir/locales/pt-BR.pak",
335     "$root_build_dir/locales/pt-PT.pak",
336     "$root_build_dir/locales/ro.pak",
337     "$root_build_dir/locales/ru.pak",
338     "$root_build_dir/locales/sk.pak",
339     "$root_build_dir/locales/sl.pak",
340     "$root_build_dir/locales/sr.pak",
341     "$root_build_dir/locales/sv.pak",
342     "$root_build_dir/locales/sw.pak",
343     "$root_build_dir/locales/th.pak",
344     "$root_build_dir/locales/tr.pak",
345     "$root_build_dir/locales/uk.pak",
346     "$root_build_dir/locales/vi.pak",
347     "$root_build_dir/locales/zh-CN.pak",
348     "$root_build_dir/locales/zh-TW.pak",
349     "$root_build_dir/resources.pak",
350   ]
351   deps = [
352     "//chrome:packed_resources",
353     "//chrome:packed_extra_resources",
354   ]
356   if (icu_use_data_file) {
357     sources += [ "$root_build_dir/icudtl.dat" ]
358     deps += [ "//third_party/icu:icudata" ]
359   }
360   if (v8_use_external_startup_data) {
361     sources += [
362       "$root_build_dir/natives_blob.bin",
363       "$root_build_dir/snapshot_blob.bin",
364     ]
365     deps += [ "//v8" ]
366   }
369 chrome_shell_manifest =
370     "$target_gen_dir/chrome_shell_manifest/AndroidManifest.xml"
372 # GYP: //chrome/chrome_shell.gypi:chrome_shell_manifest
373 jinja_template("chrome_shell_manifest") {
374   testonly = true
375   input = "shell/java/AndroidManifest.xml.jinja2"
376   output = chrome_shell_manifest
379 # GYP: //chrome/chrome_shell.gypi:chrome_shell_apk
380 android_apk("chrome_shell_apk") {
381   testonly = true
382   deps = [
383     ":chrome_shell",
384     ":chrome_shell_assets",
385     ":chrome_shell_java",
386     ":chrome_shell_manifest",
387     ":chrome_shell_resources",
388     "//base:base_java",
389   ]
390   apk_name = "ChromeShell"
391   android_manifest = chrome_shell_manifest
392   native_libs = [ "libchrome_shell.so" ]
393   native_lib_version_rule = "//build/util:chrome_version_json"
394   _native_lib_file =
395       rebase_path("$root_gen_dir/CHROME_VERSION.json", root_out_dir)
396   native_lib_version_arg = "@FileArg($_native_lib_file:full-quoted)"
397   asset_location = chrome_shell_assets_dir
399   #TODO(GYP):
400   #'variables': {
401   #'conditions': [
402   #['component != "shared_library" and target_arch != "arm64" and target_arch != "x64" and profiling_full_stack_frames != 1', {
403   ## Only enable the chromium linker on regular builds, since the
404   ## component build crashes on Android 4.4. See b/11379966
405   #'use_chromium_linker': '1',
406   #}],
407   #],
408   #},
411 chrome_sync_shell_manifest =
412     "$target_gen_dir/chrome_sync_shell_manifest/AndroidManifest.xml"
414 # GYP: //chrome/chrome_shell.gypi:chrome_sync_shell_manifest
415 jinja_template("chrome_sync_shell_manifest") {
416   testonly = true
417   input = "sync_shell/java/AndroidManifest.xml.jinja2"
418   output = chrome_sync_shell_manifest
421 # GYP: //chrome/chrome_shell.gypi:chrome_sync_shell_apk
422 android_apk("chrome_sync_shell_apk") {
423   testonly = true
424   deps = [
425     ":chrome_shell_resources",
426     ":chrome_shell_java",
427     ":chrome_shell_assets",
428     ":chrome_sync_shell",
429     ":chrome_sync_shell_manifest",
430     "//base:base_java",
431   ]
432   apk_name = "ChromeSyncShell"
433   android_manifest = chrome_sync_shell_manifest
434   native_libs = [ "libchrome_sync_shell.so" ]
435   asset_location = chrome_shell_assets_dir
438 # GYP: part of //chrome/chrome_tests.gypi:chrome_shell_test_apk
439 android_library("chrome_javatests") {
440   testonly = true
441   DEPRECATED_java_in_dir = "javatests_shell/src"
442   deps = [
443     ":chrome_java",
444     ":chrome_java_resources",
445     ":chrome_shell_java",
446     ":chrome_shell_resources",
447     ":chrome_shell_test_java",
448     "//base:base_java",
449     "//base:base_java_test_support",
450     "//chrome/test/android:chrome_java_test_support",
451     "//components/bookmarks/common/android:bookmarks_java",
452     "//components/dom_distiller/android:dom_distiller_core_java",
453     "//components/invalidation/impl:java",
454     "//components/navigation_interception/android:navigation_interception_java",
455     "//content/public/android:content_java",
456     "//content/public/test/android:content_java_test_support",
457     "//net/android:net_java_test_support",
458     "//sync/android:sync_java",
459     "//sync:sync_java_test_support",
460     "//third_party/android_protobuf:protobuf_nano_javalib",
461     "//third_party/android_tools:android_support_v13_java",
462     "//third_party/android_tools:android_support_v7_appcompat_java",
463     "//third_party/android_tools:legacy_http_javalib",
464     "//third_party/cacheinvalidation:cacheinvalidation_javalib",
465     "//third_party/cacheinvalidation:cacheinvalidation_proto_java",
466     "//third_party/jsr-305:jsr_305_javalib",
467     "//ui/android:ui_java",
468   ]
471 android_library("chrome_shell_test_java") {
472   testonly = true
473   deps = [
474     ":chrome_java",
475     ":chrome_shell_java",
476     "//base:base_java",
477     "//base:base_java_test_support",
478     "//chrome/test/android:chrome_java_test_support",
479     "//content/public/android:content_java",
480     "//content/public/test/android:content_java_test_support",
481     "//third_party/android_tools:android_support_v13_java",
482     "//third_party/android_tools:android_support_v7_appcompat_java",
483     "//ui/android:ui_java",
484   ]
485   DEPRECATED_java_in_dir = "shell/javatests/src"
488 # GYP: //chrome/chrome_tests.gypi:chrome_shell_test_apk
489 instrumentation_test_apk("chrome_shell_test_apk") {
490   apk_under_test = ":chrome_shell_apk"
491   deps = [
492     ":chrome_javatests",
493     ":chrome_shell_test_java",
494   ]
495   apk_name = "ChromeShellTest"
496   android_manifest = "shell/javatests/AndroidManifest.xml"
497   isolate_file = "../chrome_shell_test_apk.isolate"
500 # GYP: //chrome/chrome_tests.gypi:chrome_junit_tests
501 junit_binary("chrome_junit_tests") {
502   java_files = [
503     "junit/src/org/chromium/chrome/browser/childaccounts/ChildAccountServiceTest.java",
504     "junit/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtilsTest.java",
505     "junit/src/org/chromium/chrome/browser/omaha/ResponseParserTest.java",
506     "junit/src/org/chromium/chrome/browser/media/remote/AbstractMediaRouteControllerTest.java",
507     "junit/src/org/chromium/chrome/browser/media/remote/MediaUrlResolverTest.java",
508     "junit/src/org/chromium/chrome/browser/media/remote/RemoteVideoInfoTest.java",
509     "junit/src/org/chromium/chrome/browser/media/remote/TransportControlTest.java",
510   ]
511   deps = [
512     ":chrome_java",
513     "//base:base_java",
514     "//base:base_java_test_support",
515     "//sync:sync_java_test_support",
516     "//sync/android:sync_java",
517     "//third_party/junit:hamcrest",
518     "//third_party/android_tools:android_support_v7_mediarouter_java",
519   ]
522 # GYP: //chrome/chrome_tests.gypi:chrome_sync_shell_test_apk
523 if (false) {
524   # TODO(GYP): We need sync/sync_tests.gypi:test_support_sync_proto_java to be ported.
525   # crbug.com/475612
526   instrumentation_test_apk("chrome_sync_shell_test_apk") {
527     apk_under_test = ":chrome_sync_shell_apk"
528     deps = [
529       ":chrome_java",
530       ":chrome_shell_java",
531       ":chrome_shell_test_java",
532       "//base:base_java",
533       "//base:base_java_test_support",
534       "//chrome/test/android:chrome_java_test_support",
535       "//components/invalidation/impl:java",
536       "//content/public/android:content_java",
537       "//content/public/test/android:content_java_test_support",
538       "//sync/android:sync_java",
539       "//sync:sync_java_test_support",
540       "//third_party/android_tools:android_support_v13_java",
541       "//third_party/android_tools:android_support_v7_appcompat_java",
542       "//ui/android:ui_java",
543     ]
544     apk_name = "ChromeSyncShellTest"
545     DEPRECATED_java_in_dir = "sync_shell/javatests/src"
546     android_manifest = "sync_shell/javatests/AndroidManifest.xml"
547   }
550 # GYP: //chrome/chrome_tests.gypi:chrome_shell_uiautomator_tests_java
551 android_library("uiautomator_tests_java") {
552   testonly = true
553   DEPRECATED_java_in_dir = "uiautomator_tests/src"
554   deps = [
555     "//base:base_java_test_support",
556     "//third_party/android_tools:uiautomator_java",
557   ]
560 # GYP: //chrome/chrome_tests.gypi:chrome_shell_uiautomator_tests
561 uiautomator_test("uiautomator_tests") {
562   testonly = true
563   deps = [
564     ":uiautomator_tests_java",
565   ]
568 # GYP: //chrome/chrome_android.gypi:chrome_version_java
569 chrome_version_java_dir = "$root_gen_dir/templates/chrome_version_java"
570 chrome_version_java_file = "$chrome_version_java_dir/org/chromium/chrome/browser/ChromeVersionConstants.java"
571 process_version("chrome_version_java") {
572   template_file = "java/ChromeVersionConstants.java.version"
573   output = chrome_version_java_file
574   extra_args = [
575     "-e",
576     "CHANNEL=str.upper('$android_channel')",
577   ]
580 zip("chrome_version_srcjar") {
581   inputs = [
582     chrome_version_java_file,
583   ]
584   output = "$target_gen_dir/$target_name.srcjar"
585   base_dir = chrome_version_java_dir
586   deps = [
587     ":chrome_version_java",
588   ]
591 #GYP: //chrome/android/chrome_apk.gyp:custom_tabs_service_aidl
592 android_aidl("custom_tabs_service_aidl") {
593   import_include = "java/src/android/support/customtabs"
594   interface_file = "java/src/android/support/customtabs/common.aidl"
595   sources = [
596     "java/src/android/support/customtabs/ICustomTabsCallback.aidl",
597     "java/src/android/support/customtabs/ICustomTabsService.aidl",
598   ]
601 # GYP: //chrome/android/chrome_apk.gyp:chrome_shared_test_java
602 android_library("chrome_shared_test_java") {
603   testonly = true
604   DEPRECATED_java_in_dir = "javatests/src"
606   deps = [
607     "//base:base_java",
608     "//base:base_java_test_support",
609     "//chrome/android:chrome_java",
610     "//chrome/android:chrome_java_resources",
611     "//chrome/test/android:chrome_java_test_support",
612     "//components/bookmarks/common/android:bookmarks_java",
613     "//components/dom_distiller/android:dom_distiller_core_java",
614     "//components/invalidation/impl:java",
615     "//components/invalidation/impl:javatests",
616     "//components/navigation_interception/android:navigation_interception_java",
617     "//components/policy/android:policy_java",
618     "//components/precache/android:precache_java",
619     "//components/precache/android:precache_javatests",
620     "//components/web_contents_delegate_android:web_contents_delegate_android_java",
621     "//content/public/android:content_java",
622     "//content/public/test/android:content_java_test_support",
623     "//net/android:net_java",
624     "//net/android:net_java_test_support",
625     "//printing:printing_java",
626     "//sync/android:sync_java",
627     "//sync/android:sync_javatests",
628     "//sync:sync_java_test_support",
629     "//third_party/android_tools:android_support_v7_appcompat_java",
630     "//third_party/android_tools:android_support_v7_recyclerview_java",
631     "//third_party/android_tools:android_support_v13_java",
632     "//third_party/android_tools:legacy_http_javalib",
633     "//third_party/cacheinvalidation:cacheinvalidation_javalib",
634     "//third_party/jsr-305:jsr_305_javalib",
635     "//ui/android:ui_java",
636     "//ui/android:ui_javatests",
637   ]
640 android_resources("chrome_public_apk_resources") {
641   resource_dirs = [ "java/res_chromium" ]
642   custom_package = "org.chromium.chrome"
645 chrome_public_apk_assets_dir = "$root_build_dir/chrome_public_apk_assets"
647 copy_ex("chrome_public_apk_assets") {
648   clear_dir = true
649   dest = chrome_public_apk_assets_dir
650   sources = chrome_android_paks_gypi.chrome_android_pak_input_resources
651   if (icu_use_data_file) {
652     sources += [ "$root_build_dir/icudtl.dat" ]
653   }
654   deps = [
655     "//chrome:packed_extra_resources",
656     "//chrome:packed_resources",
657     "//third_party/icu:icudata",
658   ]
660   if (v8_use_external_startup_data) {
661     sources += [
662       "$root_build_dir/natives_blob.bin",
663       "$root_build_dir/snapshot_blob.bin",
664     ]
665     deps += [ "//v8" ]
666   }
668   sources += [ "$root_build_dir/resources.pak" ]
671 # GYP: //chrome/android/chrome_apk.gyp:chrome_apk_manifest
672 jinja_template("chrome_public_apk_manifest") {
673   input = "java/AndroidManifest.xml"
674   output = "$root_gen_dir/chrome_public_apk_manifest/AndroidManifest.xml"
675   variables = jinja_variables
676   variables += [
677     "min_sdk_version=16",
678     "target_sdk_version=23",
679   ]
682 # GYP: //chrome/android/chrome_apk.gyp:chrome_public_template_resources
683 jinja_template_resources("chrome_public_template_resources") {
684   resources = [
685     "java/res_template/xml/searchable.xml",
686     "java/res_template/xml/syncadapter.xml",
687   ]
688   res_dir = "java/res_template"
689   variables = jinja_variables
692 # GYP: //chrome/android/chrome_apk.gyp:libchrome_public
693 shared_library("chrome_public") {
694   deps = [
695     "//chrome:chrome_android_core",
696   ]
697   gypi_values = exec_script(
698           "//build/gypi_to_gn.py",
699           [
700             rebase_path("chrome_apk.gyp"),
701             "--replace=<(chrome_native_sources_dir)=../browser/android/",
702           ],
703           "scope",
704           [ "chrome_apk.gyp" ])
705   sources = gypi_values.chrome_public_app_native_sources
707   # TODO(GYP):
708   #'target_conditions': [
709   #['component != "shared_library"', {
710   #'product_extension': '<(version_libchrome_short).so',
711   #}],
712   #],
715 android_apk("chrome_public_apk") {
716   version_name = "Developer Build"
717   version_code = "1"
718   android_manifest = get_target_outputs(":chrome_public_apk_manifest")
719   android_manifest = android_manifest[1]
720   apk_name = "ChromePublic"
721   native_libs = [ "$root_build_dir/lib.stripped/libchrome_public.so" ]
722   native_lib_version_rule = "//build/util:chrome_version_json"
723   _native_lib_file =
724       rebase_path("$root_gen_dir/CHROME_VERSION.json", root_out_dir)
725   native_lib_version_arg = "@FileArg($_native_lib_file:full-quoted)"
726   asset_location = chrome_public_apk_assets_dir
728   deps = [
729     ":chrome_java",
730     ":chrome_java_resources",
731     ":chrome_public",
732     ":chrome_public_apk_assets",
733     ":chrome_public_apk_manifest",
734     ":chrome_public_apk_resources",
735     ":chrome_public_template_resources",
736     "//base:base_java",
737     google_play_services_resources,
738   ]
741 chrome_public_test_apk_manifest =
742     "$root_gen_dir/chrome_public_test_apk_manifest/AndroidManifest.xml"
744 # GYP: //chrome/android/chrome_apk.gyp:chrome_public_test_apk_manifest
745 jinja_template("chrome_public_test_apk_manifest") {
746   input = "javatests/AndroidManifest.xml"
747   output = chrome_public_test_apk_manifest
748   variables = jinja_variables
751 # GYP: //chrome/android/chrome_apk.gyp:chrome_public_test_apk
752 instrumentation_test_apk("chrome_public_test_apk") {
753   # TODO(GYP,cjhopman): Does this need version code/name?
754   apk_name = "ChromePublicTest"
755   apk_under_test = ":chrome_public_apk"
756   android_manifest = chrome_public_test_apk_manifest
757   deps = [
758     ":chrome_public_test_apk_manifest",
759     "//chrome/android:chrome_shared_test_java",
760   ]
761   isolate_file = "../chrome_public_test_apk.isolate"