Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / chrome / android / chrome_apk.gyp
blob72497842db6ed602f4e475ee60ece94a4af62600
1 # Copyright 2015 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   'includes': [
6     '../../chrome/chrome_android_paks.gypi', # Included for the list of pak resources.
7     '../../build/util/version.gypi'
8    ],
9   'variables': {
10     'chromium_code': 1,
11     'package_name': 'chrome_public_apk',
12     'manifest_package%': 'org.chromium.chrome',
13     'chrome_public_apk_manifest': '<(SHARED_INTERMEDIATE_DIR)/chrome_public_apk_manifest/AndroidManifest.xml',
14     'chrome_public_test_apk_manifest': '<(SHARED_INTERMEDIATE_DIR)/chrome_public_test_apk_manifest/AndroidManifest.xml',
15     'never_lint': 1,
16     'chrome_java_dir': 'java_staging',
17     'chrome_java_tests_dir': 'javatests',
18     'chrome_java_test_support_dir': '../test/android/javatests_staging',
19     'chrome_native_sources_dir': '../browser/android/',
20     # This list is shared with GN.
21     'chrome_staging_jni_files': [
22       '<(chrome_java_dir)/src/org/chromium/chrome/browser/bookmark/EditBookmarkHelper.java',
23       '<(chrome_java_dir)/src/org/chromium/chrome/browser/compositor/CompositorView.java',
24       '<(chrome_java_dir)/src/org/chromium/chrome/browser/compositor/scene_layer/ContextualSearchSceneLayer.java',
25       '<(chrome_java_dir)/src/org/chromium/chrome/browser/compositor/scene_layer/ReaderModeSceneLayer.java',
26       '<(chrome_java_dir)/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java',
27       '<(chrome_java_dir)/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java',
28       '<(chrome_java_dir)/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java',
29       '<(chrome_java_dir)/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTabHelper.java',
30       '<(chrome_java_dir)/src/org/chromium/chrome/browser/document/DocumentWebContentsDelegate.java',
31       '<(chrome_java_dir)/src/org/chromium/chrome/browser/rlz/RevenueStats.java',
32       '<(chrome_java_dir)/src/org/chromium/chrome/browser/tab/ThumbnailTabHelper.java',
33     ],
34     # This list is shared with GN.
35     'chrome_staging_native_sources': [
36       '<(chrome_native_sources_dir)/bookmark/edit_bookmark_helper.cc',
37       '<(chrome_native_sources_dir)/bookmark/edit_bookmark_helper.h',
38       '<(chrome_native_sources_dir)/chrome_main_delegate_staging_android.cc',
39       '<(chrome_native_sources_dir)/chrome_main_delegate_staging_android.h',
40       '<(chrome_native_sources_dir)/compositor/compositor_view.cc',
41       '<(chrome_native_sources_dir)/compositor/compositor_view.h',
42       '<(chrome_native_sources_dir)/compositor/layer/reader_mode_layer.cc',
43       '<(chrome_native_sources_dir)/compositor/layer/reader_mode_layer.h',
44       '<(chrome_native_sources_dir)/compositor/layer/tab_handle_layer.cc',
45       '<(chrome_native_sources_dir)/compositor/layer/tab_handle_layer.h',
46       '<(chrome_native_sources_dir)/compositor/scene_layer/contextual_search_scene_layer.cc',
47       '<(chrome_native_sources_dir)/compositor/scene_layer/contextual_search_scene_layer.h',
48       '<(chrome_native_sources_dir)/compositor/scene_layer/reader_mode_scene_layer.cc',
49       '<(chrome_native_sources_dir)/compositor/scene_layer/reader_mode_scene_layer.h',
50       '<(chrome_native_sources_dir)/compositor/scene_layer/tab_list_scene_layer.cc',
51       '<(chrome_native_sources_dir)/compositor/scene_layer/tab_list_scene_layer.h',
52       '<(chrome_native_sources_dir)/compositor/scene_layer/tab_strip_scene_layer.cc',
53       '<(chrome_native_sources_dir)/compositor/scene_layer/tab_strip_scene_layer.h',
54       '<(chrome_native_sources_dir)/contextualsearch/contextual_search_context.cc',
55       '<(chrome_native_sources_dir)/contextualsearch/contextual_search_context.h',
56       '<(chrome_native_sources_dir)/contextualsearch/contextual_search_delegate.cc',
57       '<(chrome_native_sources_dir)/contextualsearch/contextual_search_delegate.h',
58       '<(chrome_native_sources_dir)/contextualsearch/contextual_search_manager.cc',
59       '<(chrome_native_sources_dir)/contextualsearch/contextual_search_manager.h',
60       '<(chrome_native_sources_dir)/contextualsearch/contextual_search_tab_helper.cc',
61       '<(chrome_native_sources_dir)/contextualsearch/contextual_search_tab_helper.h',
62       '<(chrome_native_sources_dir)/document/document_web_contents_delegate.cc',
63       '<(chrome_native_sources_dir)/rlz/revenue_stats.cc',
64       '<(chrome_native_sources_dir)/rlz/revenue_stats.h',
65       '<(chrome_native_sources_dir)/staging_jni_registrar.cc',
66       '<(chrome_native_sources_dir)/staging_jni_registrar.h',
67       '<(chrome_native_sources_dir)/tab/thumbnail_tab_helper_android.cc',
68       '<(chrome_native_sources_dir)/tab/thumbnail_tab_helper_android.h',
69     ],
70     # This list is shared with GN.
71     # Defines a list of source files should be present in the open-source
72     # chrome-apk but not in the published static_library which is included in the
73     # real chrome for android.
74     'chrome_public_app_native_sources': [
75       '<(chrome_native_sources_dir)/chrome_entry_point.cc',
76       '<(chrome_native_sources_dir)/chrome_main_delegate_staging_android_initializer.cc',
77       '<(chrome_native_sources_dir)/chrome_staging_jni_onload.cc',
78       '<(chrome_native_sources_dir)/chrome_staging_jni_onload.h',
79     ],
80   },
81   'targets': [
82     {
83       # GN: //chrome/browser/android:chrome_staging
84       'target_name': 'libchrome_staging',
85       'type': 'static_library',
86       'dependencies': [
87         'staging_jni_headers',
88         '<(DEPTH)/chrome/chrome.gyp:browser',
89         '<(DEPTH)/components/components.gyp:component_metrics_proto',
90         '<(DEPTH)/skia/skia.gyp:skia',
91         '<(DEPTH)/third_party/leveldatabase/leveldatabase.gyp:leveldatabase',
92       ],
93       'sources': [
94         '<@(chrome_staging_native_sources)',
95       ],
96       'include_dirs': [
97         '<(DEPTH)',
98         '<(SHARED_INTERMEDIATE_DIR)/staging/android',
99         '<(android_ndk_include)',  # For native_window.h, GL includes, etc.
100         '<(DEPTH)/skia/config',
101       ],
102       'link_settings': {
103         'libraries': [
104           '-landroid',      # ANativeWindow
105           '-ljnigraphics',  # NDK access to bitmap
106         ],
107       },
108       'conditions': [
109         ['safe_browsing!=0', {
110           'sources': [
111             '<(chrome_native_sources_dir)/spdy_proxy_resource_throttle.cc',
112             '<(chrome_native_sources_dir)/spdy_proxy_resource_throttle.h',
113           ],
114         }],
115       ],
116     },
117     {
118       # GN: //chrome/android:staging_jni_headers
119       'target_name': 'staging_jni_headers',
120       'type': 'none',
121       'sources': [
122         '<@(chrome_staging_jni_files)',
123       ],
124       'variables': {
125         'jni_gen_package': 'staging/android',
126       },
127       'includes': [ '../../build/jni_generator.gypi' ],
128     },
129     {
130       # GN: //chrome/android:chrome_staging_java
131       'target_name': 'chrome_staging_java',
132       'type': 'none',
133       'variables': {
134         'java_in_dir': '<(chrome_java_dir)',
135         'R_package': 'com.google.android.apps.chrome',
136         'R_package_relpath': 'com/google/android/apps/chrome',
137         'has_java_resources': 1,
138         'res_channel_dir': '<(chrome_java_dir)/res_default',
139         'res_extra_dirs': ['<(res_channel_dir)'],
140         'res_extra_files': ['<!@(find <(res_channel_dir) -type f)'],
141       },
142       'dependencies': [
143         'chrome_template_resources',
144         'hosted_service_aidl',
145         '<(DEPTH)/base/base.gyp:base_java',
146         '<(DEPTH)/chrome/chrome.gyp:chrome_java',
147         '<(DEPTH)/chrome/chrome.gyp:document_tab_model_info_proto_java',
148         '<(DEPTH)/components/components.gyp:app_restrictions_resources',
149         '<(DEPTH)/components/components.gyp:navigation_interception_java',
150         '<(DEPTH)/components/components.gyp:service_tab_launcher',
151         '<(DEPTH)/components/components.gyp:web_contents_delegate_android_java',
152         '<(DEPTH)/content/content.gyp:content_java',
153         '<(DEPTH)/media/media.gyp:media_java',
154         '<(DEPTH)/net/net.gyp:net_java',
155         '<(DEPTH)/third_party/android_protobuf/android_protobuf.gyp:protobuf_nano_javalib',
156         '<(DEPTH)/third_party/android_tools/android_tools.gyp:android_support_v13_javalib',
157         '<(DEPTH)/third_party/android_tools/android_tools.gyp:android_support_v7_appcompat_javalib',
158         '<(DEPTH)/third_party/android_tools/android_tools.gyp:android_support_v7_mediarouter_javalib',
159         '<(DEPTH)/third_party/android_tools/android_tools.gyp:android_support_v7_recyclerview_javalib',
160         '<(DEPTH)/third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_javalib',
161         '<(DEPTH)/third_party/jsr-305/jsr-305.gyp:jsr_305_javalib',
162         '<(DEPTH)/ui/android/ui_android.gyp:ui_java',
163       ],
164       'conditions': [
165         ['configuration_policy != 1', {
166           'dependencies!': [
167             '<(DEPTH)/components/components.gyp:app_restrictions_resources',
168           ],
169         }],
170       ],
171       'includes': [ '../../build/java.gypi' ],
172     },
173     {
174       # GN: //chrome/test/android:chrome_staging_test_support_java
175       'target_name': 'chrome_staging_test_support_java',
176       'type': 'none',
177       'variables': {
178           'java_in_dir': '<(chrome_java_test_support_dir)',
179       },
180       'dependencies': [
181         'chrome_staging_java',
182         '<(DEPTH)/base/base.gyp:base_java',
183         '<(DEPTH)/base/base.gyp:base_java_test_support',
184         '<(DEPTH)/chrome/chrome.gyp:chrome_java',
185         '<(DEPTH)/chrome/chrome.gyp:chrome_java_test_support',
186         '<(DEPTH)/content/content_shell_and_tests.gyp:content_java_test_support',
187         '<(DEPTH)/net/net.gyp:net_java',
188         '<(DEPTH)/net/net.gyp:net_java_test_support',
189         '<(DEPTH)/sync/sync.gyp:sync_java_test_support',
190       ],
191       'includes': [ '../../build/java.gypi' ],
192     },
193     {
194       'target_name': 'chrome_template_resources',
195       'type': 'none',
196       'variables': {
197         'jinja_inputs_base_dir': '<(chrome_java_dir)/res_template',
198         'jinja_inputs': [
199           '<(jinja_inputs_base_dir)/xml/searchable.xml',
200           '<(jinja_inputs_base_dir)/xml/syncadapter.xml',
201         ],
202         'jinja_outputs_zip': '<(PRODUCT_DIR)/res.java/<(_target_name).zip',
203         'jinja_variables': [
204           'manifest_package=<(manifest_package)',
205         ],
206       },
207       'all_dependent_settings': {
208         'variables': {
209           'additional_input_paths': ['<(jinja_outputs_zip)'],
210           'dependencies_res_zip_paths': ['<(jinja_outputs_zip)'],
211         },
212       },
213       'includes': [ '../../build/android/jinja_template.gypi' ],
214     },
215     {
216       'target_name': 'hosted_service_aidl',
217       'type': 'none',
218       'variables': {
219         'aidl_interface_file': '<(chrome_java_dir)/src/org/chromium/chrome/browser/hosted/common.aidl',
220         'aidl_import_include': '<(chrome_java_dir)/src/org/chromium/chrome/browser/hosted',
221       },
222       'sources': [
223         '<(chrome_java_dir)/src/org/chromium/chrome/browser/hosted/IBrowserConnectionCallback.aidl',
224         '<(chrome_java_dir)/src/org/chromium/chrome/browser/hosted/IBrowserConnectionService.aidl',
225       ],
226       'includes': [ '../../build/java_aidl.gypi' ],
227     },
228     {
229       # GN: TODO
230       'target_name': 'libchrome_public',
231       'type': 'shared_library',
232       'dependencies': [
233         'libchrome_staging',
234         '<(DEPTH)/chrome/chrome.gyp:chrome_android_core',
235       ],
236       'include_dirs': [
237         '<(DEPTH)',
238       ],
239       'sources': [
240         '<@(chrome_public_app_native_sources)',
241       ],
242       'ldflags': [
243         # Some android targets still depend on --gc-sections to link.
244         # TODO: remove --gc-sections for Debug builds (crbug.com/159847).
245         '-Wl,--gc-sections',
246       ],
247       'conditions': [
248         # TODO(yfriedman): move this DEP to chrome_android_core to be shared
249         # between internal/external.
250         ['cld_version==2', {
251           'dependencies': [
252             '<(DEPTH)/third_party/cld_2/cld_2.gyp:cld2_dynamic',
253           ],
254         }],
255         # conditions for order_text_section
256         # Cygprofile methods need to be linked into the instrumented build.
257         ['order_profiling!=0', {
258           'conditions': [
259             ['OS=="android"', {
260               'dependencies': [ '<(DEPTH)/tools/cygprofile/cygprofile.gyp:cygprofile' ],
261             }],
262           ],
263         }],  # order_profiling!=0
264         ['use_allocator!="none"', {
265           'dependencies': [
266             '<(DEPTH)/base/allocator/allocator.gyp:allocator',
267           ],
268         }],
269       ],
270     },
271     {
272       'target_name': 'chrome_public_manifest',
273       'type': 'none',
274       'variables': {
275         'jinja_inputs': ['<(chrome_java_dir)/AndroidManifest.xml'],
276         'jinja_output': '<(chrome_public_apk_manifest)',
277         'jinja_variables': [
278           'channel=<(android_channel)',
279           'configuration_policy=<(configuration_policy)',
280           'manifest_package=<(manifest_package)',
281           'min_sdk_version=16',
282         ],
283       },
284       'includes': [ '../../build/android/jinja_template.gypi' ],
285     },
286     {
287       'target_name': 'chrome_public_apk',
288       'type': 'none',
289       'variables': {
290         'android_manifest_path': '<(chrome_public_apk_manifest)',
291         'apk_name': 'ChromePublic',
292         'native_lib_target': 'libchrome_public',
293         'java_in_dir': '<(chrome_java_dir)',
294         'conditions': [
295           # Only attempt loading the library from the APK for 64 bit devices
296           # until the number of 32 bit devices which don't support this
297           # approach falls to a minimal level -  http://crbug.com/390618.
298           ['component != "shared_library" and profiling==0 and (target_arch == "arm64" or target_arch == "x86_64")', {
299             'load_library_from_zip_file': '<(chrome_apk_load_library_from_zip)',
300             'load_library_from_zip': '<(chrome_apk_load_library_from_zip)',
301           }],
302         ],
303       },
304       'dependencies': [
305         'chrome_android_paks_copy',
306         'chrome_staging_java',
307       ],
308       'includes': [ 'chrome_apk.gypi' ],
309     },
310     {
311       # GN: N/A
312       # chrome_public_apk creates a .jar as a side effect. Any java targets
313       # that need that .jar in their classpath should depend on this target,
314       'target_name': 'chrome_public_apk_java',
315       'type': 'none',
316       'dependencies': [
317         'chrome_public_apk',
318       ],
319       'includes': [ '../../build/apk_fake_jar.gypi' ],
320     },
321     {
322       # GN: //chrome/browser/android:chrome_staging_unittests
323       'target_name': 'chrome_staging_unittests',
324       'type': 'static_library',
325       'sources': [
326         '<(chrome_native_sources_dir)/contextualsearch/contextual_search_delegate_unittest.cc',
327         '<(chrome_native_sources_dir)/history_report/delta_file_commons_unittest.cc',
328         '<(chrome_native_sources_dir)/history_report/delta_file_backend_leveldb_unittest.cc',
329         '<(chrome_native_sources_dir)/history_report/usage_reports_buffer_backend_unittest.cc',
330         '<(chrome_native_sources_dir)/policy/policy_manager_unittest.cc',
331       ],
332       'dependencies': [
333         'libchrome_staging',
334         '<(DEPTH)/base/base.gyp:base_java',
335         '<(DEPTH)/chrome/chrome.gyp:chrome_java',
336         '<(DEPTH)/chrome/chrome.gyp:delta_file_proto',
337         '<(DEPTH)/chrome/chrome.gyp:test_support_unit',
338         '<(DEPTH)/net/net.gyp:net_test_support',
339         '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
340         '<(DEPTH)/testing/gtest.gyp:gtest',
341       ],
342        'include_dirs': [
343         '<(DEPTH)',
344       ],
345     },
346     {
347       # GN: None.
348       # This target is for sharing tests between both upstream and internal
349       # trees until sufficient test coverage is upstream.
350       'target_name': 'chrome_shared_test_java',
351       'type': 'none',
352       'variables': {
353         'java_in_dir': '<(chrome_java_tests_dir)',
354       },
355       'dependencies': [
356         'chrome_staging_java',
357         'chrome_staging_test_support_java',
358         '<(DEPTH)/base/base.gyp:base_java',
359         '<(DEPTH)/base/base.gyp:base_java_test_support',
360         '<(DEPTH)/chrome/chrome.gyp:chrome_java',
361         '<(DEPTH)/chrome/chrome.gyp:chrome_java_test_support',
362         '<(DEPTH)/components/components.gyp:web_contents_delegate_android_java',
363         '<(DEPTH)/content/content_shell_and_tests.gyp:content_java_test_support',
364         '<(DEPTH)/net/net.gyp:net_java',
365         '<(DEPTH)/net/net.gyp:net_java_test_support',
366         '<(DEPTH)/sync/sync.gyp:sync_java_test_support',
367         '<(DEPTH)/third_party/android_tools/android_tools.gyp:android_support_v7_appcompat_javalib',
368       ],
369       'includes': [ '../../build/java.gypi' ],
370     },
371     {
372       # GN: None. This will most likely be merged with chrome_shell before GN is
373       # done.
374       'target_name': 'chrome_public_test_apk_manifest',
375       'type': 'none',
376       'variables': {
377         'jinja_inputs': ['<(chrome_java_tests_dir)/AndroidManifest.xml'],
378         'jinja_output': '<(chrome_public_test_apk_manifest)',
379         'jinja_variables': [
380           'manifest_package=<(manifest_package)',
381         ],
382       },
383       'includes': [ '../../build/android/jinja_template.gypi' ],
384     },
385     {
386       # GN: None. This will most likely be merged with chrome_shell before GN is
387       # done.
388       'target_name': 'chrome_public_test_apk',
389       'type': 'none',
390       'dependencies': [
391         'chrome_shared_test_java',
392         'chrome_public_apk_java',
393       ],
394       'variables': {
395         'android_manifest_path': '<(chrome_public_test_apk_manifest)',
396         'package_name': 'chrome_public_test',
397         'java_in_dir': '<(chrome_java_tests_dir)',
398         'java_in_dir_suffix': '/src_dummy',
399         'apk_name': 'ChromePublicTest',
400         'is_test_apk': 1,
401       },
402       'includes': [ '../../build/java_apk.gypi' ],
403     },
404   ],
407 # Local Variables:
408 # tab-width:2
409 # indent-tabs-mode:nil
410 # End:
411 # vim: set expandtab tabstop=2 shiftwidth=2: