CacheStorage: Remove unused return value from put operation
[chromium-blink-merge.git] / components / cronet.gypi
blob19cd8b36a28e9d32f67df9953ff118bbbf3d6b21
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"', {
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/CronetHistogramManager.java',
15             'cronet/android/java/src/org/chromium/net/CronetLibraryLoader.java',
16             'cronet/android/java/src/org/chromium/net/CronetUploadDataStream.java',
17             'cronet/android/java/src/org/chromium/net/CronetUrlRequest.java',
18             'cronet/android/java/src/org/chromium/net/CronetUrlRequestContext.java',
19             'cronet/android/java/src/org/chromium/net/ChromiumUrlRequest.java',
20             'cronet/android/java/src/org/chromium/net/ChromiumUrlRequestContext.java',
21           ],
22           'variables': {
23             'jni_gen_package': 'cronet',
24           },
25           'includes': [ '../build/jni_generator.gypi' ],
26         },
27         {
28           'target_name': 'cronet_url_request_java',
29           'type': 'none',
30           'variables': {
31             'source_file': 'cronet/android/chromium_url_request.h',
32           },
33           'includes': [ '../build/android/java_cpp_enum.gypi' ],
34         },
35         {
36           'target_name': 'net_request_priority_java',
37           'type': 'none',
38           'variables': {
39             'source_file': '../net/base/request_priority.h',
40           },
41           'includes': [ '../build/android/java_cpp_enum.gypi' ],
42         },
43         {
44           'target_name': 'cronet_url_request_context_config_list',
45           'type': 'none',
46           'sources': [
47             'cronet/android/java/src/org/chromium/net/UrlRequestContextConfigList.template',
48           ],
49           'variables': {
50             'package_name': 'org/chromium/cronet',
51             'template_deps': ['cronet/url_request_context_config_list.h'],
52           },
53           'includes': [ '../build/android/java_cpp_template.gypi' ],
54         },
55         {
56           'target_name': 'cronet_version',
57           'type': 'none',
58           'variables': {
59             'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
60             'version_py_path': '<(DEPTH)/build/util/version.py',
61             'version_path': '<(DEPTH)/chrome/VERSION',
62             'template_input_path': 'cronet/android/java/src/org/chromium/net/Version.template',
63             'output_path': '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)/org/chromium/cronet/Version.java',
64           },
65           'direct_dependent_settings': {
66             'variables': {
67               # Ensure that the output directory is used in the class path
68               # when building targets that depend on this one.
69               'generated_src_dirs': [
70                 '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)',
71               ],
72               # Ensure dependents are rebuilt when the generated Java file changes.
73               'additional_input_paths': [
74                 '<(output_path)',
75               ],
76             },
77           },
78           'actions': [
79             {
80               'action_name': 'cronet_version',
81               'inputs': [
82                 '<(template_input_path)',
83                 '<(version_path)',
84                 '<(lastchange_path)',
85               ],
86               'outputs': [
87                 '<(output_path)',
88               ],
89               'action': [
90                 'python',
91                 '<(version_py_path)',
92                 '-f', '<(version_path)',
93                 '-f', '<(lastchange_path)',
94                 '<(template_input_path)',
95                 '<(output_path)',
96               ],
97               'message': 'Generating version information',
98             },
99           ],
100         },
101         {
102           # cronet_static_small target has reduced binary size through using
103           # ICU alternatives which requires file and ftp support be disabled.
104           'target_name': 'cronet_static_small',
105           'defines': [
106             'USE_ICU_ALTERNATIVES_ON_ANDROID=1',
107             'DISABLE_FILE_SUPPORT=1',
108             'DISABLE_FTP_SUPPORT=1',
109           ],
110           'dependencies': [
111             '../net/net.gyp:net_small',
112           ],
113           'includes': [ 'cronet/cronet_static.gypi' ],
114         },
115         {
116           # cronet_static target depends on ICU and includes file and ftp support.
117           'target_name': 'cronet_static',
118           'dependencies': [
119             '../base/base.gyp:base_i18n',
120             '../net/net.gyp:net',
121           ],
122           'includes': [ 'cronet/cronet_static.gypi' ],
123         },
124         {
125           'target_name': 'libcronet',
126           'type': 'shared_library',
127           'sources': [
128             'cronet/android/cronet_jni.cc',
129           ],
130           'dependencies': [
131             'cronet_static_small',
132             '../base/base.gyp:base',
133             '../net/net.gyp:net_small',
134             '../url/url.gyp:url_lib_use_icu_alternatives_on_android',
135           ],
136         },
137         { # cronet_stub.jar defines HttpUrlRequest interface and provides its
138           # its implementation using HttpUrlConnection (not the Chromium stack).
139           'target_name': 'cronet_stub',
140           'type': 'none',
141           'dependencies': [
142             'cronet_url_request_context_config_list',
143             'cronet_version',
144           ],
145           'variables': {
146             'java_in_dir': 'cronet/android/java',
147             'javac_includes': [
148               '**/ChunkedWritableByteChannel.java',
149               '**/ExtendedResponseInfo.java',
150               '**/HistogramManager.java',
151               '**/HttpUrlConnection*.java',
152               '**/HttpUrlRequest*.java',
153               '**/ResponseInfo.java',
154               '**/ResponseTooLargeException.java',
155               '**/UploadDataProvider.java',
156               '**/UploadDataSink.java',
157               '**/UrlRequest.java',
158               '**/UrlRequestContext.java',
159               '**/UrlRequestContextConfig.java',
160               '**/UrlRequestContextConfigList.java',
161               '**/UrlRequestException.java',
162               '**/UrlRequestListener.java',
163               '**/UserAgent.java',
164               '**/Version.java',
165             ],
166           },
167           'includes': [ '../build/java.gypi' ],
168         },
169         { # cronet.jar implements HttpUrlRequest interface using Chromium stack
170           # in native libcronet.so library.
171           'target_name': 'cronet_java',
172           'type': 'none',
173           'dependencies': [
174             '../base/base.gyp:base',
175             'cronet_stub',
176             'cronet_url_request_java',
177             'libcronet',
178             'net_request_priority_java',
179           ],
180           'variables': {
181             'java_in_dir': 'cronet/android/java',
182             'javac_includes': [
183               '**/ChromiumAsyncUrlRequest.java',
184               '**/ChromiumUrlRequest.java',
185               '**/ChromiumUrlRequestContext.java',
186               '**/ChromiumUrlRequestError.java',
187               '**/ChromiumUrlRequestFactory.java',
188               '**/ChromiumUrlRequestPriority.java',
189               '**/CronetHistogramManager.java',
190               '**/CronetResponseInfo.java',
191               '**/CronetLibraryLoader.java',
192               '**/CronetUploadDataStream.java',
193               '**/CronetUrlRequest.java',
194               '**/CronetUrlRequestContext.java',
195               '**/CronetUrlRequestFactory.java',
196               '**/RequestPriority.java',
197               '**/urlconnection/CronetBufferedOutputStream.java',
198               '**/urlconnection/CronetFixedModeOutputStream.java',
199               '**/urlconnection/CronetInputStream.java',
200               '**/urlconnection/CronetHttpURLConnection.java',
201               '**/urlconnection/CronetHttpURLStreamHandler.java',
202               '**/urlconnection/CronetOutputStream.java',
203               '**/urlconnection/CronetURLStreamHandlerFactory.java',
204               '**/urlconnection/MessageLoop.java',
205             ],
206           },
207           'includes': [ '../build/java.gypi' ],
208         },
209         {
210           'target_name': 'cronet_sample_apk',
211           'type': 'none',
212           'dependencies': [
213             'cronet_java',
214             'cronet_stub',
215           ],
216           'variables': {
217             'apk_name': 'CronetSample',
218             'java_in_dir': 'cronet/android/sample',
219             'resource_dir': 'cronet/android/sample/res',
220             'native_lib_target': 'libcronet',
221             'proguard_enabled': 'true',
222             'proguard_flags_paths': [
223               'cronet/android/proguard.cfg',
224               'cronet/android/sample/javatests/proguard.cfg',
225             ],
226           },
227           'includes': [ '../build/java_apk.gypi' ],
228         },
229         {
230           # cronet_sample_apk creates a .jar as a side effect. Any java targets
231           # that need that .jar in their classpath should depend on this target,
232           # cronet_sample_apk_java. Dependents of cronet_sample_apk receive its
233           # jar path in the variable 'apk_output_jar_path'. This target should
234           # only be used by targets which instrument cronet_sample_apk.
235           'target_name': 'cronet_sample_apk_java',
236           'type': 'none',
237           'dependencies': [
238             'cronet_sample_apk',
239           ],
240           'includes': [ '../build/apk_fake_jar.gypi' ],
241         },
242         {
243           'target_name': 'cronet_sample_test_apk',
244           'type': 'none',
245           'dependencies': [
246             'cronet_java',
247             'cronet_sample_apk_java',
248             'cronet_stub',
249             '../base/base.gyp:base_java_test_support',
250           ],
251           'variables': {
252             'apk_name': 'CronetSampleTest',
253             'java_in_dir': 'cronet/android/sample/javatests',
254             'resource_dir': 'cronet/android/sample/res',
255             'is_test_apk': 1,
256           },
257           'includes': [ '../build/java_apk.gypi' ],
258         },
259         {
260           'target_name': 'cronet_tests_jni_headers',
261           'type': 'none',
262           'sources': [
263             'cronet/android/test/src/org/chromium/net/CronetTestUtil.java',
264             'cronet/android/test/src/org/chromium/net/MockUrlRequestJobFactory.java',
265             'cronet/android/test/src/org/chromium/net/NativeTestServer.java',
266             'cronet/android/test/src/org/chromium/net/NetworkChangeNotifierUtil.java',
267             'cronet/android/test/src/org/chromium/net/QuicTestServer.java',
268             'cronet/android/test/src/org/chromium/net/TestUploadDataStreamHandler.java',
269           ],
270           'variables': {
271             'jni_gen_package': 'cronet_tests',
272           },
273           'includes': [ '../build/jni_generator.gypi' ],
274         },
275         {
276           'target_name': 'libcronet_tests',
277           'type': 'shared_library',
278           'sources': [
279             'cronet/android/test/cronet_test_jni.cc',
280             'cronet/android/test/mock_url_request_job_factory.cc',
281             'cronet/android/test/mock_url_request_job_factory.h',
282             'cronet/android/test/native_test_server.cc',
283             'cronet/android/test/native_test_server.h',
284             'cronet/android/test/quic_test_server.cc',
285             'cronet/android/test/quic_test_server.h',
286             'cronet/android/test/test_upload_data_stream_handler.cc',
287             'cronet/android/test/test_upload_data_stream_handler.h',
288             'cronet/android/test/network_change_notifier_util.cc',
289             'cronet/android/test/network_change_notifier_util.h',
290           ],
291           'dependencies': [
292             'cronet_static',
293             'cronet_tests_jni_headers',
294             '../base/base.gyp:base',
295             '../net/net.gyp:net',
296             '../net/net.gyp:net_quic_proto',
297             '../net/net.gyp:net_test_support',
298             '../net/net.gyp:simple_quic_tools',
299             '../url/url.gyp:url_lib',
300             '../base/base.gyp:base_i18n',
301             '../third_party/icu/icu.gyp:icui18n',
302             '../third_party/icu/icu.gyp:icuuc',
303           ],
304           'conditions': [
305             # If file support is disabled, add the following sources since
306             # url_request_mock_http_job depends on them.
307             ['disable_file_support==1',
308               {
309                 'sources': [
310                   '../net/base/directory_lister.cc',
311                   '../net/base/directory_lister.h',
312                   '../net/url_request/test_url_request_interceptor.cc',
313                   '../net/url_request/test_url_request_interceptor.h',
314                   '../net/url_request/url_request_file_job.cc',
315                   '../net/url_request/url_request_file_job.h',
316                   '../net/test/url_request/url_request_mock_http_job.cc',
317                   '../net/test/url_request/url_request_mock_http_job.h',
318                 ]
319               }
320             ],
321           ],
322         },
323         {
324           'target_name': 'cronet_test_apk',
325           'type': 'none',
326           'dependencies': [
327             'cronet_java',
328           ],
329           'variables': {
330             'apk_name': 'CronetTest',
331             'java_in_dir': 'cronet/android/test',
332             'resource_dir': 'cronet/android/test/res',
333             'asset_location': 'cronet/android/test/assets',
334             'native_lib_target': 'libcronet_tests',
335           },
336           'includes': [ '../build/java_apk.gypi' ],
337         },
338         {
339           # cronet_test_apk creates a .jar as a side effect. Any java targets
340           # that need that .jar in their classpath should depend on this target,
341           # cronet_test_apk_java. Dependents of cronet_test_apk receive its
342           # jar path in the variable 'apk_output_jar_path'. This target should
343           # only be used by targets which instrument cronet_test_apk.
344           'target_name': 'cronet_test_apk_java',
345           'type': 'none',
346           'dependencies': [
347             'cronet_test_apk',
348           ],
349           'includes': [ '../build/apk_fake_jar.gypi' ],
350         },
351         {
352           'target_name': 'cronet_test_instrumentation_apk',
353           'type': 'none',
354           'dependencies': [
355             'cronet_test_apk_java',
356             '../base/base.gyp:base_java_test_support',
357           ],
358           'variables': {
359             'apk_name': 'CronetTestInstrumentation',
360             'java_in_dir': 'cronet/android/test/javatests',
361             'resource_dir': 'cronet/android/test/res',
362             'is_test_apk': 1,
363           },
364           'includes': [ '../build/java_apk.gypi' ],
365         },
366         {
367           'target_name': 'cronet_package',
368           'type': 'none',
369           'dependencies': [
370             'libcronet',
371             'cronet_java',
372             'cronet_stub',
373             '../net/net.gyp:net_unittests_apk',
374           ],
375           'variables': {
376             'native_lib': 'libcronet.>(android_product_extension)',
377             'java_lib': 'cronet.jar',
378             'java_stub_lib': 'cronet_stub.jar',
379             'java_src_lib': 'cronet-src.jar',
380             'java_sample_src_lib': 'cronet-sample-src.jar',
381             'lib_java_dir': '<(PRODUCT_DIR)/lib.java',
382             'package_dir': '<(PRODUCT_DIR)/cronet',
383             'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/cronet',
384             'jar_extract_dir': '<(intermediate_dir)/cronet_jar_extract',
385             'jar_extract_stamp': '<(intermediate_dir)/jar_extract.stamp',
386             'cronet_jar_stamp': '<(intermediate_dir)/cronet_jar.stamp',
387           },
388           'actions': [
389             {
390               'action_name': 'strip libcronet',
391               'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
392               'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
393               'action': [
394                 '<(android_strip)',
395                 '--strip-unneeded',
396                 '<@(_inputs)',
397                 '-o',
398                 '<@(_outputs)',
399               ],
400             },
401             {
402               'action_name': 'extracting from jars',
403               'inputs':  [
404                 '<(lib_java_dir)/cronet_java.jar',
405                 '<(lib_java_dir)/base_java.jar',
406                 '<(lib_java_dir)/net_java.jar',
407                 '<(lib_java_dir)/url_java.jar',
408               ],
409               'outputs': ['<(jar_extract_stamp)', '<(jar_extract_dir)'],
410               'action': [
411                 'python',
412                 'cronet/tools/extract_from_jars.py',
413                 '--classes-dir=<(jar_extract_dir)',
414                 '--jars=<@(_inputs)',
415                 '--stamp=<(jar_extract_stamp)',
416               ],
417             },
418             {
419               'action_name': 'jar_<(_target_name)',
420               'message': 'Creating <(_target_name) jar',
421               'inputs': [
422                 '<(DEPTH)/build/android/gyp/util/build_utils.py',
423                 '<(DEPTH)/build/android/gyp/util/md5_check.py',
424                 '<(DEPTH)/build/android/gyp/jar.py',
425                 '<(jar_extract_stamp)',
426               ],
427               'outputs': [
428                 '<(package_dir)/<(java_lib)',
429                 '<(cronet_jar_stamp)',
430               ],
431               'action': [
432                 'python', '<(DEPTH)/build/android/gyp/jar.py',
433                 '--classes-dir=<(jar_extract_dir)',
434                 '--jar-path=<(package_dir)/<(java_lib)',
435                 '--stamp=<(cronet_jar_stamp)',
436               ]
437             },
438             {
439               'action_name': 'jar_src_<(_target_name)',
440               'inputs': ['cronet/tools/jar_src.py'] ,
441               'outputs': ['<(package_dir)/<(java_src_lib)'],
442               'action': [
443                 'python',
444                 '<@(_inputs)',
445                 '--src-dir=cronet/android/java/src',
446                 '--jar-path=<(package_dir)/<(java_src_lib)',
447               ],
448             },
449             {
450               'action_name': 'jar_sample_src_<(_target_name)',
451               'inputs': ['cronet/tools/jar_src.py'] ,
452               'outputs': ['<(package_dir)/<(java_sample_src_lib)'],
453               'action': [
454                 'python',
455                 '<@(_inputs)',
456                 '--src-dir=cronet/android/sample',
457                 '--jar-path=<(package_dir)/<(java_sample_src_lib)',
458               ],
459             },
460             {
461               'action_name': 'generate licenses',
462               'inputs': ['cronet/tools/cronet_licenses.py'] ,
463               'outputs': ['<(package_dir)/LICENSE'],
464               'action': [
465                 'python',
466                 '<@(_inputs)',
467                 'license',
468                 '<@(_outputs)',
469               ],
470             },
471           ],
472           'copies': [
473             {
474               'destination': '<(package_dir)',
475               'files': [
476                 '../AUTHORS',
477                 '../chrome/VERSION',
478                 'cronet/android/proguard.cfg',
479                 '<(lib_java_dir)/<(java_stub_lib)'
480               ],
481             },
482             {
483               'destination': '<(package_dir)/symbols/<(android_app_abi)',
484               'files': [
485                 '<(SHARED_LIB_DIR)/<(native_lib)',
486               ],
487             },
488           ],
489         },
490       ],
491     }],  # OS=="android"
492   ],