Make the ChromeOS session name more robust w.r.t. the device type.
[chromium-blink-merge.git] / chrome / android / chrome_apk.gyp
blobb2e53e83654c47a981d47c853a59c4c0960c352a
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     # This list is shared with GN.
16     # Defines a list of source files should be present in the open-source
17     # chrome-apk but not in the published static_library which is included in the
18     # real chrome for android.
19     'chrome_public_app_native_sources': [
20       '../browser/android/chrome_entry_point.cc',
21       '../browser/android/chrome_main_delegate_staging_android_initializer.cc',
22     ],
23   },
24   'targets': [
25     {
26       # GN: //chrome/android:custom_tabs_service_aidl
27       'target_name': 'custom_tabs_service_aidl',
28       'type': 'none',
29       'variables': {
30         'aidl_interface_file': 'java/src/org/chromium/chrome/browser/customtabs/common.aidl',
31         'aidl_import_include': 'java/src/org/chromium/chrome/browser/customtabs',
32       },
33       'sources': [
34         'java/src/org/chromium/chrome/browser/customtabs/ICustomTabsConnectionCallback.aidl',
35         'java/src/org/chromium/chrome/browser/customtabs/ICustomTabsConnectionService.aidl',
36       ],
37       'includes': [ '../../build/java_aidl.gypi' ],
38     },
39     {
40       # GN: //chrome/android:chrome_public_template_resources
41       'target_name': 'chrome_public_template_resources',
42       'type': 'none',
43       'variables': {
44         'jinja_inputs_base_dir': 'java/res_template',
45         'jinja_inputs': [
46           '<(jinja_inputs_base_dir)/xml/searchable.xml',
47           '<(jinja_inputs_base_dir)/xml/syncadapter.xml',
48         ],
49         'jinja_outputs_zip': '<(PRODUCT_DIR)/res.java/<(_target_name).zip',
50         'jinja_variables': [
51           'manifest_package=<(manifest_package)',
52         ],
53       },
54       'all_dependent_settings': {
55         'variables': {
56           'additional_input_paths': ['<(jinja_outputs_zip)'],
57           'dependencies_res_zip_paths': ['<(jinja_outputs_zip)'],
58         },
59       },
60       'includes': [ '../../build/android/jinja_template.gypi' ],
61     },
62     {
63       # GN: //chrome/android:chrome_public
64       'target_name': 'libchrome_public',
65       'type': 'shared_library',
66       'dependencies': [
67         '../../chrome/chrome.gyp:chrome_android_core',
68       ],
69       'include_dirs': [
70         '../..',
71       ],
72       'sources': [
73         '<@(chrome_public_app_native_sources)',
74       ],
75       'ldflags': [
76         # Some android targets still depend on --gc-sections to link.
77         # TODO: remove --gc-sections for Debug builds (crbug.com/159847).
78         '-Wl,--gc-sections',
79       ],
80       'conditions': [
81         # TODO(yfriedman): move this DEP to chrome_android_core to be shared
82         # between internal/external.
83         ['cld_version==2', {
84           'dependencies': [
85             '../../third_party/cld_2/cld_2.gyp:cld2_dynamic',
86           ],
87         }],
88         # conditions for order_text_section
89         # Cygprofile methods need to be linked into the instrumented build.
90         ['order_profiling!=0', {
91           'conditions': [
92             ['OS=="android"', {
93               'dependencies': [ '../../tools/cygprofile/cygprofile.gyp:cygprofile' ],
94             }],
95           ],
96         }],  # order_profiling!=0
97         ['use_allocator!="none"', {
98           'dependencies': [
99             '../../base/allocator/allocator.gyp:allocator',
100           ],
101         }],
102       ],
103     },
104     {
105       # GN: //chrome/android:chrome_public_apk_manifest
106       'target_name': 'chrome_public_manifest',
107       'type': 'none',
108       'variables': {
109         'jinja_inputs': ['java/AndroidManifest.xml'],
110         'jinja_output': '<(chrome_public_apk_manifest)',
111         'jinja_variables': [
112           'channel=<(android_channel)',
113           'configuration_policy=<(configuration_policy)',
114           'manifest_package=<(manifest_package)',
115           'min_sdk_version=16',
116           'target_sdk_version=22',
117         ],
118       },
119       'includes': [ '../../build/android/jinja_template.gypi' ],
120     },
121     {
122       # GN: //chrome/android:chrome_public_apk
123       'target_name': 'chrome_public_apk',
124       'type': 'none',
125       'variables': {
126         'android_manifest_path': '<(chrome_public_apk_manifest)',
127         'apk_name': 'ChromePublic',
128         'native_lib_target': 'libchrome_public',
129         'java_in_dir': 'java',
130         'conditions': [
131           # Only attempt loading the library from the APK for 64 bit devices
132           # until the number of 32 bit devices which don't support this
133           # approach falls to a minimal level -  http://crbug.com/390618.
134           ['component != "shared_library" and profiling==0 and (target_arch == "arm64" or target_arch == "x86_64")', {
135             'load_library_from_zip_file': '<(chrome_apk_load_library_from_zip)',
136             'load_library_from_zip': '<(chrome_apk_load_library_from_zip)',
137           }],
138         ],
139       },
140       'dependencies': [
141         'chrome_android_paks_copy',
142         'chrome_public_template_resources',
143         '../chrome.gyp:chrome_java',
144       ],
145       'includes': [ 'chrome_apk.gypi' ],
146     },
147     {
148       # GN: N/A
149       # chrome_public_apk creates a .jar as a side effect. Any java targets
150       # that need that .jar in their classpath should depend on this target,
151       'target_name': 'chrome_public_apk_java',
152       'type': 'none',
153       'dependencies': [
154         'chrome_public_apk',
155       ],
156       'includes': [ '../../build/apk_fake_jar.gypi' ],
157     },
158     {
159       # GN: //chrome/android:chrome_shared_test_java
160       # This target is for sharing tests between both upstream and internal
161       # trees until sufficient test coverage is upstream.
162       'target_name': 'chrome_shared_test_java',
163       'type': 'none',
164       'variables': {
165         'java_in_dir': 'javatests',
166       },
167       'dependencies': [
168         '../../base/base.gyp:base_java',
169         '../../base/base.gyp:base_java_test_support',
170         '../../chrome/chrome.gyp:chrome_java',
171         '../../chrome/chrome.gyp:chrome_java_test_support',
172         '../../components/components.gyp:invalidation_javatests',
173         '../../components/components.gyp:precache_javatests',
174         '../../components/components.gyp:web_contents_delegate_android_java',
175         '../../content/content_shell_and_tests.gyp:content_java_test_support',
176         '../../net/net.gyp:net_java',
177         '../../net/net.gyp:net_java_test_support',
178         '../../sync/sync.gyp:sync_java_test_support',
179         '../../third_party/android_tools/android_tools.gyp:android_support_v7_appcompat_javalib',
180       ],
181       'includes': [ '../../build/java.gypi' ],
182     },
183     {
184       # GN: //chrome/android:chrome_public_test_apk_manifest
185       'target_name': 'chrome_public_test_apk_manifest',
186       'type': 'none',
187       'variables': {
188         'jinja_inputs': ['javatests/AndroidManifest.xml'],
189         'jinja_output': '<(chrome_public_test_apk_manifest)',
190         'jinja_variables': [
191           'manifest_package=<(manifest_package)',
192         ],
193       },
194       'includes': [ '../../build/android/jinja_template.gypi' ],
195     },
196     {
197       # GN: //chrome/android:chrome_public_test_apk
198       'target_name': 'chrome_public_test_apk',
199       'type': 'none',
200       'dependencies': [
201         'chrome_shared_test_java',
202         'chrome_public_apk_java',
203         '../../testing/android/on_device_instrumentation.gyp:broker_java',
204         '../../testing/android/on_device_instrumentation.gyp:require_driver_apk',
205       ],
206       'variables': {
207         'android_manifest_path': '<(chrome_public_test_apk_manifest)',
208         'package_name': 'chrome_public_test',
209         'java_in_dir': 'javatests',
210         'java_in_dir_suffix': '/src_dummy',
211         'apk_name': 'ChromePublicTest',
212         'is_test_apk': 1,
213         'test_type': 'instrumentation',
214         'isolate_file': '../chrome_public_test_apk.isolate',
215       },
216       'includes': [
217         '../../build/java_apk.gypi',
218         '../../build/android/test_runner.gypi',
219       ],
220     },
221   ],
224 # Local Variables:
225 # tab-width:2
226 # indent-tabs-mode:nil
227 # End:
228 # vim: set expandtab tabstop=2 shiftwidth=2: