Cleanup: Pass std::string as const reference from chromeos/
[chromium-blink-merge.git] / chrome / android / chrome_apk.gyp
blobcd9937bd3de6e83e093cdea78cbcec40519e8d4d
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     'sync_shell_manifest_package': 'org.chromium.chrome.sync_shell',
14     'chrome_public_apk_manifest': '<(SHARED_INTERMEDIATE_DIR)/chrome_public_apk_manifest/AndroidManifest.xml',
15     'chrome_public_test_apk_manifest': '<(SHARED_INTERMEDIATE_DIR)/chrome_public_test_apk_manifest/AndroidManifest.xml',
16     'chrome_sync_shell_apk_manifest': '<(SHARED_INTERMEDIATE_DIR)/chrome_sync_shell_apk_manifest/AndroidManifest.xml',
17     'chrome_sync_shell_test_apk_manifest': '<(SHARED_INTERMEDIATE_DIR)/chrome_sync_shell_test_apk_manifest/AndroidManifest.xml',
18     # This list is shared with GN.
19     # Defines a list of source files should be present in the open-source
20     # chrome-apk but not in the published static_library which is included in the
21     # real chrome for android.
22     'chrome_public_app_native_sources': [
23       '../app/android/chrome_main_delegate_android_initializer.cc',
24       '../browser/android/chrome_entry_point.cc',
25     ],
26   },
27   'targets': [
28     {
29       #GN: //chrome/android::custom_tabs_service_aidl
30       'target_name': 'custom_tabs_service_aidl',
31       'type': 'none',
32       'variables': {
33         'aidl_interface_file': 'java/src/android/support/customtabs/common.aidl',
34         'aidl_import_include': 'java/src/android/support/customtabs',
35       },
36       'sources': [
37         'java/src/android/support/customtabs/ICustomTabsCallback.aidl',
38         'java/src/android/support/customtabs/ICustomTabsService.aidl',
39       ],
40       'includes': [ '../../build/java_aidl.gypi' ],
41     },
42     {
43       # GN: //chrome/android:chrome_public_template_resources
44       'target_name': 'chrome_public_template_resources',
45       'type': 'none',
46       'variables': {
47         'jinja_inputs_base_dir': 'java/res_template',
48         'jinja_inputs': [
49           '<(jinja_inputs_base_dir)/xml/searchable.xml',
50           '<(jinja_inputs_base_dir)/xml/syncadapter.xml',
51         ],
52         'jinja_outputs_zip': '<(PRODUCT_DIR)/res.java/<(_target_name).zip',
53         'jinja_variables': [
54           'manifest_package=<(manifest_package)',
55         ],
56       },
57       'all_dependent_settings': {
58         'variables': {
59           'additional_input_paths': ['<(jinja_outputs_zip)'],
60           'dependencies_res_zip_paths': ['<(jinja_outputs_zip)'],
61         },
62       },
63       'includes': [ '../../build/android/jinja_template.gypi' ],
64     },
65     {
66       # TODO(pvalenzuela): Implement this target with GN:
67       # http://crbug.com/475612
68       'target_name': 'chrome_sync_shell_template_resources',
69       'type': 'none',
70       'variables': {
71         'jinja_inputs_base_dir': 'java/res_template',
72         'jinja_inputs': [
73           '<(jinja_inputs_base_dir)/xml/searchable.xml',
74           '<(jinja_inputs_base_dir)/xml/syncadapter.xml',
75         ],
76         'jinja_outputs_zip': '<(PRODUCT_DIR)/res.java/<(_target_name).zip',
77         'jinja_variables': [
78           'manifest_package=<(sync_shell_manifest_package)',
79         ],
80       },
81       'all_dependent_settings': {
82         'variables': {
83           'additional_input_paths': ['<(jinja_outputs_zip)'],
84           'dependencies_res_zip_paths': ['<(jinja_outputs_zip)'],
85         },
86       },
87       'includes': [ '../../build/android/jinja_template.gypi' ],
88     },
89     {
90       # The base library used in both ChromePublic and ChromeSyncShell.
91       'target_name': 'libchrome_public_base',
92       'type': 'none',
93       'dependencies': [
94         '../../chrome/chrome.gyp:chrome_android_core',
95       ],
96       'include_dirs': [
97         '../..',
98       ],
99       'direct_dependent_settings': {
100         'ldflags': [
101           # Some android targets still depend on --gc-sections to link.
102           # TODO: remove --gc-sections for Debug builds (crbug.com/159847).
103           '-Wl,--gc-sections',
104         ],
105       },
106       'conditions': [
107         # TODO(yfriedman): move this DEP to chrome_android_core to be shared
108         # between internal/external.
109         ['cld_version==2', {
110           'dependencies': [
111             '../../third_party/cld_2/cld_2.gyp:cld2_dynamic',
112           ],
113         }],
114         # conditions for order_text_section
115         # Cygprofile methods need to be linked into the instrumented build.
116         ['order_profiling!=0', {
117           'conditions': [
118             ['OS=="android"', {
119               'dependencies': [ '../../tools/cygprofile/cygprofile.gyp:cygprofile' ],
120             }],
121           ],
122         }],  # order_profiling!=0
123         ['use_allocator!="none"', {
124           'dependencies': [
125             '../../base/allocator/allocator.gyp:allocator',
126           ],
127         }],
128       ],
129     },
130     {
131       # GN: //chrome/android:chrome_public
132       'target_name': 'libchrome_public',
133       'type': 'shared_library',
134       'sources': [
135         '<@(chrome_public_app_native_sources)',
136       ],
137       'dependencies': [
138         'libchrome_public_base',
139       ],
140     },
141     {
142       # TODO(pvalenzuela): Implement this target with GN:
143       # http://crbug.com/475612
144       'target_name': 'libchrome_sync_shell',
145       'type': 'shared_library',
146       'sources': [
147         '../browser/android/chrome_entry_point.cc',
148         '../browser/android/chrome_sync_shell_main_delegate_initializer.cc',
149         '../browser/android/chrome_sync_shell_main_delegate.h',
150         '../browser/android/chrome_sync_shell_main_delegate.cc',
151       ],
152       'dependencies': [
153         'libchrome_public_base',
154         '../../sync/sync.gyp:sync',
155         '../../sync/sync.gyp:test_support_sync_fake_server_android',
156       ],
157     },
158     {
159       # GN: //chrome/android:chrome_public_apk_manifest
160       'target_name': 'chrome_public_manifest',
161       'type': 'none',
162       'variables': {
163         'jinja_inputs': ['java/AndroidManifest.xml'],
164         'jinja_output': '<(chrome_public_apk_manifest)',
165         'jinja_variables': [
166           'channel=<(android_channel)',
167           'configuration_policy=<(configuration_policy)',
168           'manifest_package=<(manifest_package)',
169           'min_sdk_version=16',
170           'target_sdk_version=23',
171         ],
172       },
173       'includes': [ '../../build/android/jinja_template.gypi' ],
174     },
175     {
176       # TODO(pvalenzuela): Implement this target with GN:
177       # http://crbug.com/475612
178       'target_name': 'chrome_sync_shell_manifest',
179       'type': 'none',
180       'variables': {
181         'jinja_inputs': ['java/AndroidManifest.xml'],
182         'jinja_output': '<(chrome_sync_shell_apk_manifest)',
183         'jinja_variables': [
184           'channel=<(android_channel)',
185           'configuration_policy=<(configuration_policy)',
186           'manifest_package=<(sync_shell_manifest_package)',
187           'min_sdk_version=16',
188           'target_sdk_version=22',
189         ],
190       },
191       'includes': [ '../../build/android/jinja_template.gypi' ],
192     },
193     {
194       # GN: //chrome/android:chrome_public_apk
195       'target_name': 'chrome_public_apk',
196       'type': 'none',
197       'variables': {
198         'android_manifest_path': '<(chrome_public_apk_manifest)',
199         'apk_name': 'ChromePublic',
200         'native_lib_target': 'libchrome_public',
201         'java_in_dir': 'java',
202         'resource_dir': '../../chrome/android/java/res_chromium',
203         'conditions': [
204           # Only attempt loading the library from the APK for 64 bit devices
205           # until the number of 32 bit devices which don't support this
206           # approach falls to a minimal level -  http://crbug.com/390618.
207           ['component != "shared_library" and profiling==0 and (target_arch == "arm64" or target_arch == "x86_64")', {
208             'load_library_from_zip_file': '<(chrome_apk_load_library_from_zip)',
209             'load_library_from_zip': '<(chrome_apk_load_library_from_zip)',
210           }],
211         ],
212       },
213       'dependencies': [
214         'chrome_android_paks_copy',
215         'chrome_public_template_resources',
216         '../chrome.gyp:chrome_java',
217       ],
218       'includes': [ 'chrome_apk.gypi' ],
219     },
220     {
221       # GN: N/A
222       # chrome_public_apk creates a .jar as a side effect. Any java targets
223       # that need that .jar in their classpath should depend on this target,
224       'target_name': 'chrome_public_apk_java',
225       'type': 'none',
226       'dependencies': [
227         'chrome_public_apk',
228       ],
229       'includes': [ '../../build/apk_fake_jar.gypi' ],
230     },
231     {
232       # TODO(pvalenzuela): Implement this target with GN:
233       # http://crbug.com/475612
234       'target_name': 'chrome_sync_shell_apk',
235       'type': 'none',
236       'variables': {
237         'android_manifest_path': '<(chrome_sync_shell_apk_manifest)',
238         'apk_name': 'ChromeSyncShell',
239         'native_lib_target': 'libchrome_sync_shell',
240         'java_in_dir': 'java',
241         'conditions': [
242           # Only attempt loading the library from the APK for 64 bit devices
243           # until the number of 32 bit devices which don't support this
244           # approach falls to a minimal level -  http://crbug.com/390618.
245           ['component != "shared_library" and profiling==0 and (target_arch == "arm64" or target_arch == "x86_64")', {
246             'load_library_from_zip_file': '<(chrome_apk_load_library_from_zip)',
247             'load_library_from_zip': '<(chrome_apk_load_library_from_zip)',
248           }],
249         ],
250       },
251       'dependencies': [
252         'chrome_android_paks_copy',
253         'chrome_sync_shell_template_resources',
254         '../chrome.gyp:chrome_java',
255         # This exists here because com.google.protobuf.nano is needed in tests,
256         # but that code is stripped out via proguard. Adding this deps adds
257         # usages and prevents removal of the proto code.
258         '../../sync/sync.gyp:test_support_sync_proto_java',
259       ],
260       'includes': [ 'chrome_apk.gypi' ],
261     },
262     {
263       # GN: N/A
264       # chrome_sync_shell_apk creates a .jar as a side effect. Any java targets
265       # that need that .jar in their classpath should depend on this target.
266       'target_name': 'chrome_sync_shell_apk_java',
267       'type': 'none',
268       'dependencies': [
269         'chrome_sync_shell_apk',
270       ],
271       'includes': [ '../../build/apk_fake_jar.gypi' ],
272     },
273     {
274       # GN: //chrome/android:chrome_shared_test_java
275       # This target is for sharing tests between both upstream and internal
276       # trees until sufficient test coverage is upstream.
277       'target_name': 'chrome_shared_test_java',
278       'type': 'none',
279       'variables': {
280         'java_in_dir': 'javatests',
281       },
282       'dependencies': [
283         '../../base/base.gyp:base_java',
284         '../../base/base.gyp:base_java_test_support',
285         '../../chrome/chrome.gyp:chrome_java',
286         '../../chrome/chrome.gyp:chrome_java_test_support',
287         '../../components/components.gyp:invalidation_javatests',
288         '../../components/components.gyp:offline_pages_enums_java',
289         '../../components/components.gyp:precache_javatests',
290         '../../components/components.gyp:web_contents_delegate_android_java',
291         '../../content/content_shell_and_tests.gyp:content_java_test_support',
292         '../../net/net.gyp:net_java',
293         '../../net/net.gyp:net_java_test_support',
294         '../../sync/sync.gyp:sync_java_test_support',
295         '../../third_party/android_tools/android_tools.gyp:android_support_v7_appcompat_javalib',
296         '../../ui/android/ui_android.gyp:ui_javatests',
297       ],
298       'includes': [ '../../build/java.gypi' ],
299     },
300     {
301       # GN: //chrome/android:chrome_public_test_apk_manifest
302       'target_name': 'chrome_public_test_apk_manifest',
303       'type': 'none',
304       'variables': {
305         'jinja_inputs': ['javatests/AndroidManifest.xml'],
306         'jinja_output': '<(chrome_public_test_apk_manifest)',
307         'jinja_variables': [
308           'manifest_package=<(manifest_package)',
309         ],
310       },
311       'includes': [ '../../build/android/jinja_template.gypi' ],
312     },
313     {
314       # TODO(pvalenzuela): Implement this target with GN:
315       # http://crbug.com/475612
316       'target_name': 'chrome_sync_shell_test_apk_manifest',
317       'type': 'none',
318       'variables': {
319         'jinja_inputs': ['sync_shell/javatests/AndroidManifest.xml'],
320         'jinja_output': '<(chrome_sync_shell_test_apk_manifest)',
321         'jinja_variables': [
322           'manifest_package=<(sync_shell_manifest_package)',
323         ],
324       },
325       'includes': [ '../../build/android/jinja_template.gypi' ],
326     },
327     {
328       # GN: //chrome/android:chrome_public_test_apk
329       'target_name': 'chrome_public_test_apk',
330       'type': 'none',
331       'dependencies': [
332         'chrome_shared_test_java',
333         'chrome_public_apk_java',
334         '../../testing/android/on_device_instrumentation.gyp:broker_java',
335         '../../testing/android/on_device_instrumentation.gyp:require_driver_apk',
336       ],
337       'variables': {
338         'android_manifest_path': '<(chrome_public_test_apk_manifest)',
339         'package_name': 'chrome_public_test',
340         'java_in_dir': 'javatests',
341         'java_in_dir_suffix': '/src_dummy',
342         'apk_name': 'ChromePublicTest',
343         'is_test_apk': 1,
344         'test_type': 'instrumentation',
345         'isolate_file': '../chrome_public_test_apk.isolate',
346       },
347       'includes': [
348         '../../build/java_apk.gypi',
349         '../../build/android/test_runner.gypi',
350       ],
351     },
352     {
353       # TODO(pvalenzuela): Implement this target with GN:
354       # http://crbug.com/475612
355       'target_name': 'chrome_sync_shell_test_apk',
356       'type': 'none',
357       'dependencies': [
358         'chrome_sync_shell_apk_java',
359         '../../base/base.gyp:base_java',
360         '../../base/base.gyp:base_java_test_support',
361         '../../chrome/chrome.gyp:chrome_java',
362         '../../chrome/chrome.gyp:chrome_java_test_support',
363         '../../sync/sync.gyp:sync_java',
364         '../../sync/sync.gyp:sync_java_test_support',
365         '../../sync/sync.gyp:sync_javatests',
366         '../../sync/sync.gyp:test_support_sync_proto_java',
367         '../../testing/android/on_device_instrumentation.gyp:broker_java',
368         '../../testing/android/on_device_instrumentation.gyp:require_driver_apk',
369       ],
370       'variables': {
371         'android_manifest_path': '<(chrome_sync_shell_test_apk_manifest)',
372         'package_name': 'chrome_sync_shell_test',
373         'java_in_dir': 'sync_shell/javatests',
374         'apk_name': 'ChromeSyncShellTest',
375         'is_test_apk': 1,
376         'test_type': 'instrumentation',
377       },
378       'includes': [
379         '../../build/java_apk.gypi',
380         '../../build/android/test_runner.gypi',
381       ],
382     },
383   ],
386 # Local Variables:
387 # tab-width:2
388 # indent-tabs-mode:nil
389 # End:
390 # vim: set expandtab tabstop=2 shiftwidth=2: