Compare selection models in Textfield::ExecuteCommand.
[chromium-blink-merge.git] / components / cronet.gypi
blob83a832cf595dfb5a827946eb0fc8bc14a535ce8a
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.
6   'conditions': [
7     ['OS=="android" and use_icu_alternatives_on_android==1', {
8       # TODO(mef): Figure out what needs to be done for gn script.
9       'targets': [
10         {
11           'target_name': 'cronet_jni_headers',
12           'type': 'none',
13           'sources': [
14             'cronet/android/java/src/org/chromium/net/UrlRequest.java',
15             'cronet/android/java/src/org/chromium/net/UrlRequestContext.java',
16           ],
17           'variables': {
18             'jni_gen_package': 'cronet',
19           },
20           'includes': [ '../build/jni_generator.gypi' ],
21         },
22         {
23           'target_name': 'cronet_url_request_error_list',
24           'type': 'none',
25           'sources': [
26             'cronet/android/java/src/org/chromium/net/UrlRequestError.template',
27           ],
28           'variables': {
29             'package_name': 'org/chromium/cronet',
30             'template_deps': ['cronet/android/org_chromium_net_UrlRequest_error_list.h'],
31           },
32           'includes': [ '../build/android/java_cpp_template.gypi' ],
33         },
34         {
35           'target_name': 'cronet_url_request_priority_list',
36           'type': 'none',
37           'sources': [
38             'cronet/android/java/src/org/chromium/net/UrlRequestPriority.template',
39           ],
40           'variables': {
41             'package_name': 'org/chromium/cronet',
42             'template_deps': ['cronet/android/org_chromium_net_UrlRequest_priority_list.h'],
43           },
44           'includes': [ '../build/android/java_cpp_template.gypi' ],
45         },
46         {
47           'target_name': 'libcronet',
48           'type': 'shared_library',
49           'dependencies': [
50             '../base/base.gyp:base',
51             '../base/base.gyp:base_i18n',
52             '../third_party/icu/icu.gyp:icui18n',
53             '../third_party/icu/icu.gyp:icuuc',
54             '../url/url.gyp:url_lib',
55             'cronet_jni_headers',
56             'cronet_url_request_error_list',
57             'cronet_url_request_priority_list',
58             '../net/net.gyp:net',
59           ],
60           'sources': [
61             'cronet/android/cronet_jni.cc',
62             'cronet/android/org_chromium_net_UrlRequest.cc',
63             'cronet/android/org_chromium_net_UrlRequest.h',
64             'cronet/android/org_chromium_net_UrlRequest_error_list.h',
65             'cronet/android/org_chromium_net_UrlRequest_priority_list.h',
66             'cronet/android/org_chromium_net_UrlRequestContext.cc',
67             'cronet/android/org_chromium_net_UrlRequestContext.h',
68             'cronet/android/url_request_context_peer.cc',
69             'cronet/android/url_request_context_peer.h',
70             'cronet/android/url_request_peer.cc',
71             'cronet/android/url_request_peer.h',
72           ],
73           'cflags': [
74             # TODO(mef): Figure out a good way to get version from chrome_version_info_posix.h.
75             '-DCHROMIUM_VERSION=\\"TBD\\"',
76             '-DLOGGING=1',
77             '-fdata-sections',
78             '-ffunction-sections',
79             '-fno-rtti',
80             '-fvisibility=hidden',
81             '-fvisibility-inlines-hidden',
82             '-Wno-sign-promo',
83             '-Wno-missing-field-initializers',
84           ],
85           'ldflags': [
86             '-llog',
87             '-landroid',
88             '-Wl,--gc-sections',
89             '-Wl,--exclude-libs,ALL'
90           ],
91           'conditions': [
92             [ 'use_icu_alternatives_on_android == 1', {
93                 'dependencies!': [
94                   '../base/base.gyp:base_i18n',
95                   '../third_party/icu/icu.gyp:icui18n',
96                   '../third_party/icu/icu.gyp:icuuc',
97                 ]
98               },
99             ],
100           ],
101         },
102         {
103           'target_name': 'cronet',
104           'type': 'none',
105           'dependencies': [
106             '../base/base.gyp:base',
107             'libcronet',
108             'cronet_url_request_error_list',
109             'cronet_url_request_priority_list',
110           ],
111           'variables': {
112             'java_in_dir': 'cronet/android/java',
113           },
114           'includes': [ '../build/java.gypi' ],
115         },
116         {
117           'target_name': 'cronet_package',
118           'type': 'none',
119           'dependencies': [
120             'libcronet',
121             'cronet',
122           ],
123           'variables': {
124               'native_lib': 'libcronet.>(android_product_extension)',
125               'java_lib': 'cronet.jar',
126               'package_dir': '<(PRODUCT_DIR)/cronet',
127               'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/cronet',
128               'jar_extract_dir': '<(intermediate_dir)/cronet_jar_extract',
129               'jar_excluded_classes': [
130                 '*/BaseChromiumApp*.class',
131               ],
132               'jar_extract_stamp': '<(intermediate_dir)/jar_extract.stamp',
133               'cronet_jar_stamp': '<(intermediate_dir)/cronet_jar.stamp',
134           },
135           'actions': [
136             {
137               'action_name': 'strip libcronet',
138               'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
139               'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
140               'action': [
141                 '<(android_strip)',
142                 '--strip-unneeded',
143                 '<@(_inputs)',
144                 '-o',
145                 '<@(_outputs)',
146               ],
147             },
148             {
149               'action_name': 'extracting from jars',
150               'inputs':  [
151                 '<(PRODUCT_DIR)/lib.java/<(java_lib)',
152                 '<(PRODUCT_DIR)/lib.java/base_java.jar',
153                 '<(PRODUCT_DIR)/lib.java/net_java.jar',
154                 '<(PRODUCT_DIR)/lib.java/url_java.jar',
155               ],
156               'outputs': ['<(jar_extract_stamp)', '<(jar_extract_dir)'],
157               'action': [
158                 'python',
159                 'cronet/tools/extract_from_jars.py',
160                 '--classes-dir=<(jar_extract_dir)',
161                 '--jars=<@(_inputs)',
162                 '--stamp=<(jar_extract_stamp)',
163               ],
164             },
165             {
166               'action_name': 'jar_<(_target_name)',
167               'message': 'Creating <(_target_name) jar',
168               'inputs': [
169                 '<(DEPTH)/build/android/gyp/util/build_utils.py',
170                 '<(DEPTH)/build/android/gyp/util/md5_check.py',
171                 '<(DEPTH)/build/android/gyp/jar.py',
172                 '<(jar_extract_stamp)',
173               ],
174               'outputs': [
175                 '<(package_dir)/<(java_lib)',
176                 '<(cronet_jar_stamp)',
177               ],
178               'action': [
179                 'python', '<(DEPTH)/build/android/gyp/jar.py',
180                 '--classes-dir=<(jar_extract_dir)',
181                 '--jar-path=<(package_dir)/<(java_lib)',
182                 '--excluded-classes=<@(jar_excluded_classes)',
183                 '--stamp=<(cronet_jar_stamp)',
184               ]
185             },
186             {
187               'action_name': 'generate licenses',
188               'inputs':  ['cronet/tools/cronet_licenses.py'] ,
189               'outputs': ['<(package_dir)/LICENSE'],
190               'action': [
191                 'python',
192                 '<@(_inputs)',
193                 'license',
194                 '<@(_outputs)',
195               ],
196             },
197           ],
198           'copies': [
199             {
200               'destination': '<(package_dir)',
201               'files': [
202                 '../AUTHORS',
203                 '../chrome/VERSION',
204               ],
205             },
206           ],
207         },
208         {
209           'target_name': 'cronet_sample_apk',
210           'type': 'none',
211           'dependencies': [
212             'cronet',
213           ],
214           'variables': {
215             'apk_name': 'CronetSample',
216             'java_in_dir': 'cronet/android/sample',
217             'resource_dir': 'cronet/android/sample/res',
218             'native_lib_target': 'libcronet',
219           },
220           'includes': [ '../build/java_apk.gypi' ],
221         },
222         {
223           # cronet_sample_apk creates a .jar as a side effect. Any java targets
224           # that need that .jar in their classpath should depend on this target,
225           # cronet_sample_apk_java. Dependents of cronet_sample_apk receive its
226           # jar path in the variable 'apk_output_jar_path'. This target should
227           # only be used by targets which instrument cronet_sample_apk.
228           'target_name': 'cronet_sample_apk_java',
229           'type': 'none',
230           'dependencies': [
231             'cronet_sample_apk',
232           ],
233           'includes': [ '../build/apk_fake_jar.gypi' ],
234         },
235         {
236           'target_name': 'cronet_sample_test_apk',
237           'type': 'none',
238           'dependencies': [
239             'cronet_sample_apk_java',
240             '../base/base.gyp:base_java',
241             '../base/base.gyp:base_javatests',
242             '../base/base.gyp:base_java_test_support',
243             # TODO(mef): Figure out why some tests are failing.
244             #'../net/net.gyp:net_javatests',
245             #'../net/net.gyp:net_java_test_support',
246           ],
247           'variables': {
248             'apk_name': 'CronetSampleTest',
249             'java_in_dir': 'cronet/android/sample/javatests',
250             'resource_dir': 'cronet/android/sample/res',
251             'is_test_apk': 1,
252           },
253           'includes': [ '../build/java_apk.gypi' ],
254         },
255       ],
256     }],  # OS=="android"
257   ],