Reland: Plugin Placeholders: Refactor for platforms that don't support plugins
[chromium-blink-merge.git] / chrome / android / BUILD.gn
blob51afa6b24d839a5c3e72ab87c43129ef9312b7bf
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 # GYP: //chrome/chrome.gyp:chrome_java (resources part)
28 android_resources("chrome_java_resources") {
29   resource_dirs = [ "java/res" ]
30   deps = [
31     ":chrome_strings_grd",
32     "//content/public/android:content_java_resources",
33     "//chrome/app:java_strings_grd",
34     "//third_party/android_data_chart:android_data_chart_java_resources",
35     "//third_party/android_media:android_media_resources",
36     "//third_party/android_tools:android_support_v7_appcompat_resources",
37   ]
38   custom_package = "org.chromium.chrome"
41 # GYP: //chrome/chrome.gyp:chrome_strings_grd
42 java_strings_grd("chrome_strings_grd") {
43   grd_file = "java/strings/android_chrome_strings.grd"
44   outputs = [
45     "values-am/android_chrome_strings.xml",
46     "values-ar/android_chrome_strings.xml",
47     "values-bg/android_chrome_strings.xml",
48     "values-ca/android_chrome_strings.xml",
49     "values-cs/android_chrome_strings.xml",
50     "values-da/android_chrome_strings.xml",
51     "values-de/android_chrome_strings.xml",
52     "values-el/android_chrome_strings.xml",
53     "values/android_chrome_strings.xml",
54     "values-en-rGB/android_chrome_strings.xml",
55     "values-es/android_chrome_strings.xml",
56     "values-es-rUS/android_chrome_strings.xml",
57     "values-fa/android_chrome_strings.xml",
58     "values-fi/android_chrome_strings.xml",
59     "values-tl/android_chrome_strings.xml",
60     "values-fr/android_chrome_strings.xml",
61     "values-hi/android_chrome_strings.xml",
62     "values-hr/android_chrome_strings.xml",
63     "values-hu/android_chrome_strings.xml",
64     "values-in/android_chrome_strings.xml",
65     "values-it/android_chrome_strings.xml",
66     "values-iw/android_chrome_strings.xml",
67     "values-ja/android_chrome_strings.xml",
68     "values-ko/android_chrome_strings.xml",
69     "values-lt/android_chrome_strings.xml",
70     "values-lv/android_chrome_strings.xml",
71     "values-nl/android_chrome_strings.xml",
72     "values-nb/android_chrome_strings.xml",
73     "values-pl/android_chrome_strings.xml",
74     "values-pt-rBR/android_chrome_strings.xml",
75     "values-pt-rPT/android_chrome_strings.xml",
76     "values-ro/android_chrome_strings.xml",
77     "values-ru/android_chrome_strings.xml",
78     "values-sk/android_chrome_strings.xml",
79     "values-sl/android_chrome_strings.xml",
80     "values-sr/android_chrome_strings.xml",
81     "values-sv/android_chrome_strings.xml",
82     "values-sw/android_chrome_strings.xml",
83     "values-th/android_chrome_strings.xml",
84     "values-tr/android_chrome_strings.xml",
85     "values-uk/android_chrome_strings.xml",
86     "values-vi/android_chrome_strings.xml",
87     "values-zh-rCN/android_chrome_strings.xml",
88     "values-zh-rTW/android_chrome_strings.xml",
89   ]
92 # GYP: //chrome/chrome.gyp:chrome_java
93 android_library("chrome_java") {
94   deps = [
95     ":chrome_java_resources",
96     ":document_tab_model_info_proto_java",
97     "//base:base_java",
98     "//net/android:net_java",
99     "//components/bookmarks/common/android:bookmarks_java",
100     "//components/dom_distiller/android:dom_distiller_core_java",
101     "//components/gcm_driver/android:gcm_driver_java",
102     "//components/invalidation:java",
103     "//components/navigation_interception/android:navigation_interception_java",
104     "//components/service_tab_launcher:service_tab_launcher_java",
105     "//components/precache/android:precache_java",
106     "//components/variations/android:variations_java",
107     "//components/web_contents_delegate_android:web_contents_delegate_android_java",
108     "//content/public/android:content_java",
109     "//printing:printing_java",
110     "//sync/android:sync_java",
111     "//third_party/android_data_chart:android_data_chart_java",
112     "//third_party/android_media:android_media_java",
113     "//third_party/android_protobuf:protobuf_nano_javalib",
114     "//third_party/android_tools:android_gcm_java",
115     "//third_party/android_swipe_refresh:android_swipe_refresh_java",
116     "//third_party/android_tools:android_support_v13_java",
117     "//third_party/android_tools:android_support_v7_appcompat_java",
118     "//third_party/android_tools:android_support_v7_mediarouter_java",
119     "//third_party/cacheinvalidation:cacheinvalidation_javalib",
120     "//third_party/cacheinvalidation:cacheinvalidation_proto_java",
121     "//third_party/jsr-305:jsr_305_javalib",
122     "//media/base/android:media_java",
123     "//media/midi:midi_java",
124     "//ui/android:ui_java",
125     "//ui/android:ui_java_resources",
126     google_play_services_library,
127   ]
129   srcjar_deps = [
130     ":chrome_android_java_enums_srcjar",
131     ":chrome_version_srcjar",
132     ":resource_id_javagen",
133     "//chrome:page_info_connection_type_javagen",
134     "//chrome:content_setting_javagen",
135     "//chrome:content_settings_type_javagen",
136     "//components/enhanced_bookmarks:enhanced_bookmarks_java_enums_srcjar",
137   ]
139   DEPRECATED_java_in_dir = "java/src"
142 # GYP: //chrome/chrome_browser.gypi:activity_type_ids_java
143 # GYP: //chrome/chrome_browser.gypi:profile_account_management_metrics_java
144 # GYP: //chrome/chrome_browser.gypi:profile_sync_service_model_type_selection_java
145 # GYP: //chrome/chrome_browser.gypi:connection_security_helper_security_levels_java
146 # GYP: //chrome/chrome_browser.gypi:tab_load_status_java
147 java_cpp_enum("chrome_android_java_enums_srcjar") {
148   sources = [
149     "//chrome/browser/android/activity_type_ids.h",
150     "//chrome/browser/android/tab_android.h",
151     "//chrome/browser/profiles/profile_metrics.h",
152     "//chrome/browser/ssl/connection_security_helper.h",
153     "//chrome/browser/sync/profile_sync_service_android.cc",
154   ]
155   outputs = [
156     "org/chromium/chrome/browser/ActivityTypeIds.java",
157     "org/chromium/chrome/browser/TabLoadStatus.java",
158     "org/chromium/chrome/browser/profiles/ProfileAccountManagementMetrics.java",
159     "org/chromium/chrome/browser/ssl/ConnectionSecurityHelperSecurityLevel.java",
160     "org/chromium/chrome/browser/sync/ModelTypeSelection.java",
161   ]
164 # GYP: //chrome/chrome_browser.gypi:document_tab_model_info_proto_java
165 proto_java_library("document_tab_model_info_proto_java") {
166   proto_path = "java/src/org/chromium/chrome/browser/tabmodel/document"
167   sources = [
168     "$proto_path/document_tab_model_info.proto",
169   ]
172 # GYP: //chrome/chrome_browser.gypi:resource_id_java
173 java_cpp_template("resource_id_javagen") {
174   sources = [
175     "java/ResourceId.template",
176   ]
177   package_name = "org/chromium/chrome/browser"
178   inputs = [
179     "../browser/android/resource_id.h",
180   ]
183 # GYP: //chrome/chrome_shell.gypi:libchromeshell_base
184 group("chrome_shell_base") {
185   deps = [
186     "//chrome/browser/ui",
187     "//chrome:chrome_android_core",
188     "//base",
189     "//base/allocator",
190     "//content/public/app:both",
191     "//skia",
192   ]
193   # TODO(GYP):
194   #[ 'order_profiling!=0', {
195   #'dependencies': [ '../tools/cygprofile/cygprofile.gyp:cygprofile', ],
196   #}],
199 # GYP: //chrome/chrome_shell.gypi:libchromeshell
200 shared_library("chrome_shell") {
201   testonly = true
202   sources = [
203     "shell/chrome_main_delegate_chrome_shell_android.cc",
204     "shell/chrome_main_delegate_chrome_shell_android.h",
205     "shell/chrome_shell_entry_point.cc",
206   ]
207   deps = [
208     ":chrome_shell_base",
209   ]
212 # GYP: //chrome/chrome_shell.gypi:libchromesyncshell
213 shared_library("chrome_sync_shell") {
214   testonly = true
215   sources = [
216     #"shell/chrome_shell_entry_point.cc",
217     #"sync_shell/chrome_main_delegate_chrome_sync_shell_android.cc",
218     #"sync_shell/chrome_main_delegate_chrome_sync_shell_android.h",
219   ]
220   deps = [
221     "//sync:test_support_sync_fake_server_android",
222   ]
223   data_deps = [ ":chrome_shell_base" ]
226 # GYP: N/A
227 android_resources("chrome_shell_resources") {
228   deps = [
229     ":chrome_java_resources",
230   ]
231   testonly = true
232   resource_dirs = [ "shell/res" ]
233   custom_package = "org.chromium.chrome.shell"
236 # GYP: N/A
237 android_library("chrome_shell_java") {
238   testonly = true
239   deps = [
240     ":chrome_shell_resources",
241     ":chrome_java",
242     "//base:base_java",
243     "//content/public/android:content_java",
244     "//components/dom_distiller/android:dom_distiller_content_java",
245     "//components/dom_distiller/android:dom_distiller_core_java",
246     "//components/service_tab_launcher:service_tab_launcher_java",
247     "//components/web_contents_delegate_android:web_contents_delegate_android_java",
248     "//printing:printing_java",
249     "//net/android:net_java",
250     "//sync/android:sync_java",
251     "//third_party/android_tools:android_support_v13_java",
252     "//third_party/android_tools:android_support_v7_appcompat_java",
253     "//ui/android:ui_java",
254   ]
255   DEPRECATED_java_in_dir = "shell/java/src"
258 chrome_shell_assets_dir = "$root_build_dir/chrome_shell/assets"
260 # GYP: N/A
261 copy_ex("chrome_shell_assets") {
262   clear_dir = true
263   dest = chrome_shell_assets_dir
264   sources = [
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-419.pak",
277     "$root_build_dir/locales/es.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",
310     "$root_build_dir/resources.pak",
311   ]
312   deps = [
313     "//chrome:packed_resources",
314     "//chrome:packed_extra_resources",
315   ]
317   if (icu_use_data_file) {
318     sources += [ "$root_build_dir/icudtl.dat" ]
319     deps += [ "//third_party/icu:icudata" ]
320   }
321   if (v8_use_external_startup_data) {
322     sources += [
323       "$root_build_dir/natives_blob.bin",
324       "$root_build_dir/snapshot_blob.bin",
325     ]
326     deps += [ "//v8" ]
327   }
330 chrome_shell_manifest =
331     "$target_gen_dir/chrome_shell_manifest/AndroidManifest.xml"
333 # GYP: //chrome/chrome_shell.gypi:chrome_shell_manifest
334 jinja_template("chrome_shell_manifest") {
335   testonly = true
336   input = "shell/java/AndroidManifest.xml.jinja2"
337   output = chrome_shell_manifest
340 # TODO(cjhopman): This should actually be done as a build step instead of at gn
341 # time.
342 _version_py_path = "//build/util/version.py"
343 _chrome_version_path = "//chrome/VERSION"
344 _version_full = exec_script(_version_py_path,
345                             [
346                               "-f",
347                               rebase_path(_chrome_version_path, root_build_dir),
348                               "-t \"@MAJOR@.@MINOR@.@BUILD@.@PATCH@\"",
349                             ],
350                             "value",
351                             [ _chrome_version_path ])
353 # GYP: //chrome/chrome_shell.gypi:chrome_shell_apk
354 android_apk("chrome_shell_apk") {
355   testonly = true
356   deps = [
357     ":chrome_shell",
358     ":chrome_shell_assets",
359     ":chrome_shell_java",
360     ":chrome_shell_manifest",
361     ":chrome_shell_resources",
362     "//base:base_java",
363   ]
364   apk_name = "ChromeShell"
365   android_manifest = chrome_shell_manifest
366   native_libs = [ "libchrome_shell.so" ]
367   native_lib_version_name = _version_full
368   asset_location = chrome_shell_assets_dir
370   #TODO(GYP):
371   #'variables': {
372   #'conditions': [
373   #['component != "shared_library" and target_arch != "arm64" and target_arch != "x64" and profiling_full_stack_frames != 1', {
374   ## Only enable the chromium linker on regular builds, since the
375   ## component build crashes on Android 4.4. See b/11379966
376   #'use_chromium_linker': '1',
377   #}],
378   #],
379   #},
382 chrome_sync_shell_manifest =
383     "$target_gen_dir/chrome_sync_shell_manifest/AndroidManifest.xml"
385 # GYP: //chrome/chrome_shell.gypi:chrome_sync_shell_manifest
386 jinja_template("chrome_sync_shell_manifest") {
387   testonly = true
388   input = "sync_shell/java/AndroidManifest.xml.jinja2"
389   output = chrome_sync_shell_manifest
392 # GYP: //chrome/chrome_shell.gypi:chrome_sync_shell_apk
393 android_apk("chrome_sync_shell_apk") {
394   testonly = true
395   deps = [
396     ":chrome_shell_resources",
397     ":chrome_shell_java",
398     ":chrome_shell_assets",
399     ":chrome_sync_shell",
400     ":chrome_sync_shell_manifest",
401     "//base:base_java",
402   ]
403   apk_name = "ChromeSyncShell"
404   android_manifest = chrome_sync_shell_manifest
405   native_libs = [ "libchrome_sync_shell.so" ]
406   asset_location = chrome_shell_assets_dir
409 # GYP: part of //chrome/chrome_tests.gypi:chrome_shell_test_apk
410 android_library("chrome_javatests") {
411   testonly = true
412   DEPRECATED_java_in_dir = "javatests_shell/src"
413   deps = [
414     ":chrome_java",
415     ":chrome_java_resources",
416     ":chrome_shell_java",
417     ":chrome_shell_resources",
418     ":chrome_shell_test_java",
419     "//base:base_java",
420     "//base:base_java_test_support",
421     "//chrome/test/android:chrome_java_test_support",
422     "//components/bookmarks/common/android:bookmarks_java",
423     "//components/dom_distiller/android:dom_distiller_core_java",
424     "//components/invalidation:java",
425     "//components/invalidation:javatests",
426     "//components/navigation_interception/android:navigation_interception_java",
427     "//components/precache/android:precache_java",
428     "//components/precache/android:precache_javatests",
429     "//content/public/android:content_java",
430     "//content/public/test/android:content_java_test_support",
431     "//net/android:net_java_test_support",
432     "//printing:printing_java",
433     "//sync/android:sync_java",
434     "//sync/android:sync_javatests",
435     "//sync:sync_java_test_support",
436     "//third_party/android_protobuf:protobuf_nano_javalib",
437     "//third_party/android_tools:android_support_v13_java",
438     "//third_party/android_tools:android_support_v7_appcompat_java",
439     "//third_party/cacheinvalidation:cacheinvalidation_javalib",
440     "//third_party/cacheinvalidation:cacheinvalidation_proto_java",
441     "//third_party/jsr-305:jsr_305_javalib",
442     "//ui/android:ui_java",
443   ]
446 android_library("chrome_shell_test_java") {
447   testonly = true
448   deps = [
449     ":chrome_java",
450     ":chrome_shell_java",
451     "//base:base_java",
452     "//base:base_java_test_support",
453     "//chrome/test/android:chrome_java_test_support",
454     "//content/public/android:content_java",
455     "//content/public/test/android:content_java_test_support",
456     "//third_party/android_tools:android_support_v13_java",
457     "//third_party/android_tools:android_support_v7_appcompat_java",
458     "//ui/android:ui_java",
459   ]
460   DEPRECATED_java_in_dir = "shell/javatests/src"
463 # GYP: //chrome/chrome_tests.gypi:chrome_shell_test_apk
464 instrumentation_test_apk("chrome_shell_test_apk") {
465   apk_under_test = ":chrome_shell_apk"
466   deps = [
467     ":chrome_javatests",
468     ":chrome_shell_test_java",
469     "//sync/android:sync_javatests",
470     "//ui/android:ui_javatests",
471   ]
472   apk_name = "ChromeShellTest"
473   android_manifest = "shell/javatests/AndroidManifest.xml"
474   isolate_file = "../chrome_shell_test_apk.isolate"
477 # GYP: //chrome/chrome_tests.gypi:chrome_junit_tests
478 junit_binary("chrome_junit_tests") {
479   java_files = [
480     "junit/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtilsTest.java",
481     "junit/src/org/chromium/chrome/browser/omaha/ResponseParserTest.java",
482     "junit/src/org/chromium/chrome/browser/media/remote/AbstractMediaRouteControllerTest.java",
483     "junit/src/org/chromium/chrome/browser/media/remote/MediaUrlResolverTest.java",
484     "junit/src/org/chromium/chrome/browser/media/remote/RemoteVideoInfoTest.java",
485     "junit/src/org/chromium/chrome/browser/media/remote/TransportControlTest.java",
486   ]
487   deps = [
488     ":chrome_java",
489     "//base:base_java",
490     "//base:base_java_test_support",
491     "//third_party/junit:hamcrest",
492     "//third_party/android_tools:android_support_v7_mediarouter_java",
493   ]
496 # GYP: //chrome/chrome_tests.gypi:chrome_sync_shell_test_apk
497 if (false) {
498   # TODO(GYP): We need sync/sync_tests.gypi:test_support_sync_proto_java to be ported.
499   # crbug.com/475612
500   instrumentation_test_apk("chrome_sync_shell_test_apk") {
501     apk_under_test = ":chrome_sync_shell_apk"
502     deps = [
503       ":chrome_java",
504       ":chrome_shell_java",
505       ":chrome_shell_test_java",
506       "//base:base_java",
507       "//base:base_java_test_support",
508       "//chrome/test/android:chrome_java_test_support",
509       "//components/invalidation:java",
510       "//content/public/android:content_java",
511       "//content/public/test/android:content_java_test_support",
512       "//sync/android:sync_java",
513       "//sync:sync_java_test_support",
514       "//third_party/android_tools:android_support_v13_java",
515       "//third_party/android_tools:android_support_v7_appcompat_java",
516       "//ui/android:ui_java",
517     ]
518     apk_name = "ChromeSyncShellTest"
519     DEPRECATED_java_in_dir = "sync_shell/javatests/src"
520     android_manifest = "sync_shell/javatests/AndroidManifest.xml"
521   }
524 # GYP: //chrome/chrome_tests.gypi:chrome_shell_uiautomator_tests_java
525 android_library("uiautomator_tests_java") {
526   testonly = true
527   DEPRECATED_java_in_dir = "uiautomator_tests/src"
528   deps = [
529     "//base:base_java_test_support",
530     "//third_party/android_tools:uiautomator_java",
531   ]
534 # GYP: //chrome/chrome_tests.gypi:chrome_shell_uiautomator_tests
535 uiautomator_test("uiautomator_tests") {
536   testonly = true
537   deps = [
538     ":uiautomator_tests_java",
539   ]
542 # GYP: //chrome/chrome_android.gypi:chrome_version_java
543 chrome_version_java_dir = "$root_gen_dir/templates/chrome_version_java"
544 chrome_version_java_file = "$chrome_version_java_dir/org/chromium/chrome/browser/ChromeVersionConstants.java"
545 process_version("chrome_version_java") {
546   template_file = "java/ChromeVersionConstants.java.version"
547   output = chrome_version_java_file
548   extra_args = [
549     "-e",
550     "CHANNEL=str.upper('$android_channel')",
551   ]
554 zip("chrome_version_srcjar") {
555   inputs = [
556     chrome_version_java_file,
557   ]
558   output = "$target_gen_dir/$target_name.srcjar"
559   base_dir = chrome_version_java_dir
560   deps = [
561     ":chrome_version_java",
562   ]
565 #GYP: //chrome/android/chrome_apk.gyp:custom_tabs_service_aidl
566 android_aidl("custom_tabs_service_aidl") {
567   import_include = "java_staging/src/org/chromium/chrome/browser/customtabs"
568   interface_file =
569       "java_staging/src/org/chromium/chrome/browser/customtabs/common.aidl"
570   sources = [
571     "java_staging/src/org/chromium/chrome/browser/customtabs/ICustomTabsConnectionCallback.aidl",
572     "java_staging/src/org/chromium/chrome/browser/customtabs/ICustomTabsConnectionService.aidl",
573   ]
576 # GYP: //chrome/android/chrome_apk.gyp:chrome_staging_java
577 android_library("chrome_staging_java") {
578   DEPRECATED_java_in_dir = "java_staging/src"
580   deps = [
581     ":chrome_staging_java_resources",
582     "//base:base_java",
583     "//net/android:net_java",
584     "//chrome/android:chrome_java",
585     "//chrome/android:chrome_java_resources",
586     "//chrome/android:document_tab_model_info_proto_java",
587     "//components/bookmarks/common/android:bookmarks_java",
588     "//components/dom_distiller/android:dom_distiller_content_java",
589     "//components/dom_distiller/android:dom_distiller_core_java",
590     "//components/invalidation:java",
591     "//components/navigation_interception/android:navigation_interception_java",
592     "//components/service_tab_launcher:service_tab_launcher_java",
593     "//components/variations/android:variations_java",
594     "//components/web_contents_delegate_android:web_contents_delegate_android_java",
595     "//content/public/android:content_java",
596     "//media/base/android:media_java",
597     "//printing:printing_java",
598     "//sync/android:sync_java",
599     "//third_party/android_protobuf:protobuf_nano_javalib",
600     "//third_party/android_tools:android_gcm_java",
601     "//third_party/android_tools:android_support_v13_java",
602     "//third_party/android_tools:android_support_v7_appcompat_java",
603     "//third_party/android_tools:android_support_v7_mediarouter_java",
604     "//third_party/android_tools:android_support_v7_mediarouter_resources",
605     "//third_party/android_tools:android_support_v7_recyclerview_java",
606     "//third_party/cacheinvalidation:cacheinvalidation_javalib",
607     "//third_party/cacheinvalidation:cacheinvalidation_proto_java",
608     "//third_party/jsr-305:jsr_305_javalib",
609     "//ui/android:ui_java",
610     "//ui/android:ui_java_resources",
611     google_play_services_library,
612   ]
613   srcjar_deps = [ ":custom_tabs_service_aidl" ]
616 #GYP: //chrome/android/chrome_apk.gyp:chrome_staging_java
617 android_resources("chrome_staging_java_resources") {
618   resource_dirs = [
619     "java_staging/res",
620     "java_staging/res_default",
621   ]
622   custom_package = "com.google.android.apps.chrome"
623   deps = [
624     "//chrome/android:chrome_java_resources",
625     "//components/policy:app_restrictions_resources",
626     "//third_party/android_tools:android_support_v7_appcompat_resources",
627     "//third_party/android_tools:android_support_v7_mediarouter_resources",
628   ]
629   if (!enable_configuration_policy) {
630     deps -= [ "//components/policy:app_restrictions_resources" ]
631   }
634 # GYP: //chrome/android/chrome_apk.gyp:chrome_staging_test_java
635 android_library("chrome_staging_test_java") {
636   testonly = true
637   DEPRECATED_java_in_dir = "javatests/src"
639   deps = [
640     "//chrome/android:chrome_staging_java",
641     "//chrome/android:chrome_staging_java_resources",
642     "//chrome/test/android:chrome_staging_test_support_java",
643     "//base:base_java",
644     "//base:base_java_test_support",
645     "//chrome/android:chrome_java",
646     "//chrome/android:chrome_java_resources",
647     "//chrome/test/android:chrome_java_test_support",
648     "//components/bookmarks/common/android:bookmarks_java",
649     "//components/dom_distiller/android:dom_distiller_core_java",
650     "//components/web_contents_delegate_android:web_contents_delegate_android_java",
651     "//content/public/android:content_java",
652     "//content/public/test/android:content_java_test_support",
653     "//net/android:net_java",
654     "//net/android:net_java_test_support",
655     "//sync/android:sync_java",
656     "//sync:sync_java_test_support",
657     "//third_party/android_tools:android_support_v7_appcompat_java",
658     "//third_party/android_tools:android_support_v7_recyclerview_java",
659     "//third_party/android_tools:android_support_v13_java",
660     "//third_party/cacheinvalidation:cacheinvalidation_javalib",
661     "//third_party/jsr-305:jsr_305_javalib",
662     "//ui/android:ui_java",
663   ]
666 # GYP: //chrome/android/chrome_apk.gyp:staging_jni_headers
667 generate_jni("staging_jni_headers") {
668   jni_package = "staging/android"
669   gypi_values = exec_script("//build/gypi_to_gn.py",
670                             [
671                               rebase_path("chrome_apk.gyp"),
672                               "--replace=<(chrome_java_dir)=java_staging",
673                             ],
674                             "scope",
675                             [ "chrome_apk.gyp" ])
676   sources = gypi_values.chrome_staging_jni_files
679 # GYP: //chrome/android/chrome_apk.gyp:libchrome_staging
680 static_library("chrome_staging") {
681   deps = [
682     ":staging_jni_headers",
683     "//chrome/browser",
684     "//chrome:strings",
685     "//components/enhanced_bookmarks",
686     "//components/metrics/proto",
687     "//third_party/leveldatabase",
688   ]
690   gypi_values = exec_script(
691           "//build/gypi_to_gn.py",
692           [
693             rebase_path("chrome_apk.gyp"),
694             "--replace=<(chrome_native_sources_dir)=../browser/android/",
695           ],
696           "scope",
697           [ "chrome_apk.gyp" ])
698   sources = gypi_values.chrome_staging_native_sources
700   if (safe_browsing_mode != 0) {
701     sources += [
702       "../browser/android/spdy_proxy_resource_throttle.cc",
703       "../browser/android/spdy_proxy_resource_throttle.h",
704     ]
705   }
707   libs = [
708     "android",
709     "jnigraphics",
710   ]
712   defines = []
715 chrome_public_apk_assets_dir = "$root_build_dir/chrome_public_apk_assets"
717 chrome_android_paks_gypi =
718     exec_script("//build/gypi_to_gn.py",
719                 [ rebase_path("//chrome/chrome_android_paks.gypi") ],
720                 "scope",
721                 [ "//chrome/chrome_android_paks.gypi" ])
723 copy_ex("chrome_public_apk_assets") {
724   clear_dir = true
725   dest = chrome_public_apk_assets_dir
726   gypi_sources = chrome_android_paks_gypi.chrome_android_pak_input_resources
727   cleaned_sources = rebase_path(gypi_sources, "<(PRODUCT_DIR)")
728   sources = rebase_path(cleaned_sources, ".", root_out_dir)
729   if (icu_use_data_file) {
730     sources += [ "$root_build_dir/icudtl.dat" ]
731   }
732   deps = [
733     "//chrome:packed_extra_resources",
734     "//chrome:packed_resources",
735     "//third_party/icu:icudata",
736   ]
738   if (v8_use_external_startup_data) {
739     sources += [
740       "$root_build_dir/natives_blob.bin",
741       "$root_build_dir/snapshot_blob.bin",
742     ]
743     deps += [ "//v8" ]
744   }
746   sources += [ "$root_build_dir/resources.pak" ]
749 # GYP: //chrome/android/chrome_apk.gyp:chrome_apk_manifest
750 jinja_template("chrome_public_apk_manifest") {
751   input = "java_staging/AndroidManifest.xml"
752   output = "$root_gen_dir/chrome_public_apk_manifest/AndroidManifest.xml"
753   variables = jinja_variables
754   variables += [
755     "min_sdk_version=16",
756     "target_sdk_version=22",
757   ]
760 # GYP: //chrome/android/chrome_apk.gyp:chrome_public_template_resources
761 jinja_template_resources("chrome_public_template_resources") {
762   resources = [
763     "java_staging/res_template/xml/searchable.xml",
764     "java_staging/res_template/xml/syncadapter.xml",
765   ]
766   res_dir = "java_staging/res_template"
767   variables = jinja_variables
770 # GYP: //chrome/android/chrome_apk.gyp:libchrome_public
771 shared_library("chrome_public") {
772   deps = [
773     "//chrome/android:chrome_staging",
774     "//chrome:chrome_android_core",
775   ]
776   gypi_values = exec_script(
777           "//build/gypi_to_gn.py",
778           [
779             rebase_path("chrome_apk.gyp"),
780             "--replace=<(chrome_native_sources_dir)=../browser/android/",
781           ],
782           "scope",
783           [ "chrome_apk.gyp" ])
784   sources = gypi_values.chrome_public_app_native_sources
786   # TODO(GYP):
787   #'target_conditions': [
788   #['component != "shared_library"', {
789   #'product_extension': '<(version_libchrome_short).so',
790   #}],
791   #],
794 android_apk("chrome_public_apk") {
795   version_name = "Developer Build"
796   version_code = "1"
797   android_manifest = get_target_outputs(":chrome_public_apk_manifest")
798   android_manifest = android_manifest[1]
799   apk_name = "ChromePublic"
800   native_libs = [ "$root_build_dir/lib.stripped/libchrome_public.so" ]
801   native_lib_version_name = _version_full
802   asset_location = chrome_public_apk_assets_dir
804   deps = [
805     ":chrome_staging_java",
806     ":chrome_staging_java_resources",
807     ":chrome_public",
808     ":chrome_public_apk_assets",
809     ":chrome_public_apk_manifest",
810     ":chrome_public_template_resources",
811     "//base:base_java",
812     "//third_party/android_tools:google_play_services_default_resources",
813   ]
816 chrome_public_test_apk_manifest =
817     "$root_gen_dir/chrome_public_test_apk_manifest/AndroidManifest.xml"
819 # GYP: //chrome/android/chrome_apk.gyp:chrome_public_test_apk_manifest
820 jinja_template("chrome_public_test_apk_manifest") {
821   input = "javatests/AndroidManifest.xml"
822   output = chrome_public_test_apk_manifest
823   variables = jinja_variables
826 # GYP: //chrome/android/chrome_apk.gyp:chrome_public_test_apk
827 instrumentation_test_apk("chrome_public_test_apk") {
828   # TODO(GYP,cjhopman): Does this need version code/name?
829   apk_name = "ChromePublicTest"
830   apk_under_test = ":chrome_public_apk"
831   android_manifest = chrome_public_test_apk_manifest
832   deps = [
833     ":chrome_public_test_apk_manifest",
834     "//chrome/test/android:chrome_staging_test_support_java",
835     "//chrome/android:chrome_staging_test_java",
836   ]
837   isolate_file = "../chrome_public_test_apk.isolate"