Include all dupe types (event when value is zero) in scan stats.
[chromium-blink-merge.git] / components / cronet.gypi
blob4fb3fb9753d024dd17a4293c1c24911819591db7
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           'conditions': [
115             ['enable_data_reduction_proxy_support==1',
116               {
117                 'dependencies': [
118                   '../components/components.gyp:data_reduction_proxy_core_browser_small',
119                 ],
120               },
121             ],
122           ],
123         },
124         {
125           # cronet_static target depends on ICU and includes file and ftp support.
126           'target_name': 'cronet_static',
127           'dependencies': [
128             '../base/base.gyp:base_i18n',
129             '../net/net.gyp:net',
130           ],
131           'includes': [ 'cronet/cronet_static.gypi' ],
132           'conditions': [
133             ['enable_data_reduction_proxy_support==1',
134               {
135                 'dependencies': [
136                   '../components/components.gyp:data_reduction_proxy_core_browser',
137                 ],
138               },
139             ],
140           ],
141         },
142         {
143           'target_name': 'libcronet',
144           'type': 'shared_library',
145           'sources': [
146             'cronet/android/cronet_jni.cc',
147           ],
148           'dependencies': [
149             'cronet_static_small',
150             '../base/base.gyp:base',
151             '../net/net.gyp:net_small',
152             '../url/url.gyp:url_lib_use_icu_alternatives_on_android',
153           ],
154         },
155         { # cronet_api.jar defines Cronet API and provides implementation of
156           # legacy api using HttpUrlConnection (not the Chromium stack).
157           'target_name': 'cronet_api',
158           'type': 'none',
159           'dependencies': [
160             'cronet_url_request_context_config_list',
161             'cronet_version',
162           ],
163           'variables': {
164             'java_in_dir': 'cronet/android/java',
165             'javac_includes': [
166               '**/ChunkedWritableByteChannel.java',
167               '**/ExtendedResponseInfo.java',
168               '**/HistogramManager.java',
169               '**/HttpUrlConnection*.java',
170               '**/HttpUrlRequest*.java',
171               '**/ResponseInfo.java',
172               '**/ResponseTooLargeException.java',
173               '**/UploadDataProvider.java',
174               '**/UploadDataSink.java',
175               '**/UrlRequest.java',
176               '**/UrlRequestContext.java',
177               '**/UrlRequestContextConfig.java',
178               '**/UrlRequestContextConfigList.java',
179               '**/UrlRequestException.java',
180               '**/UrlRequestListener.java',
181               '**/UserAgent.java',
182               '**/Version.java',
183             ],
184           },
185           'includes': [ '../build/java.gypi' ],
186         },
187         { # cronet.jar implements HttpUrlRequest interface using Chromium stack
188           # in native libcronet.so library.
189           'target_name': 'cronet_java',
190           'type': 'none',
191           'dependencies': [
192             '../base/base.gyp:base',
193             'cronet_api',
194             'cronet_url_request_java',
195             'libcronet',
196             'net_request_priority_java',
197           ],
198           'variables': {
199             'java_in_dir': 'cronet/android/java',
200             'javac_includes': [
201               '**/ChromiumAsyncUrlRequest.java',
202               '**/ChromiumUrlRequest.java',
203               '**/ChromiumUrlRequestContext.java',
204               '**/ChromiumUrlRequestError.java',
205               '**/ChromiumUrlRequestFactory.java',
206               '**/ChromiumUrlRequestPriority.java',
207               '**/CronetHistogramManager.java',
208               '**/CronetResponseInfo.java',
209               '**/CronetLibraryLoader.java',
210               '**/CronetUploadDataStream.java',
211               '**/CronetUrlRequest.java',
212               '**/CronetUrlRequestContext.java',
213               '**/CronetUrlRequestFactory.java',
214               '**/RequestPriority.java',
215               '**/urlconnection/CronetBufferedOutputStream.java',
216               '**/urlconnection/CronetFixedModeOutputStream.java',
217               '**/urlconnection/CronetInputStream.java',
218               '**/urlconnection/CronetHttpURLConnection.java',
219               '**/urlconnection/CronetHttpURLStreamHandler.java',
220               '**/urlconnection/CronetOutputStream.java',
221               '**/urlconnection/CronetURLStreamHandlerFactory.java',
222               '**/urlconnection/MessageLoop.java',
223             ],
224           },
225           'includes': [ '../build/java.gypi' ],
226         },
227         {
228           'target_name': 'cronet_sample_apk',
229           'type': 'none',
230           'dependencies': [
231             'cronet_java',
232             'cronet_api',
233           ],
234           'variables': {
235             'apk_name': 'CronetSample',
236             'java_in_dir': 'cronet/android/sample',
237             'resource_dir': 'cronet/android/sample/res',
238             'native_lib_target': 'libcronet',
239             'proguard_enabled': 'true',
240             'proguard_flags_paths': [
241               'cronet/android/proguard.cfg',
242               'cronet/android/sample/javatests/proguard.cfg',
243             ],
244           },
245           'includes': [ '../build/java_apk.gypi' ],
246         },
247         {
248           # cronet_sample_apk creates a .jar as a side effect. Any java targets
249           # that need that .jar in their classpath should depend on this target,
250           # cronet_sample_apk_java. Dependents of cronet_sample_apk receive its
251           # jar path in the variable 'apk_output_jar_path'. This target should
252           # only be used by targets which instrument cronet_sample_apk.
253           'target_name': 'cronet_sample_apk_java',
254           'type': 'none',
255           'dependencies': [
256             'cronet_sample_apk',
257           ],
258           'includes': [ '../build/apk_fake_jar.gypi' ],
259         },
260         {
261           'target_name': 'cronet_sample_test_apk',
262           'type': 'none',
263           'dependencies': [
264             'cronet_java',
265             'cronet_sample_apk_java',
266             'cronet_api',
267             '../base/base.gyp:base_java_test_support',
268           ],
269           'variables': {
270             'apk_name': 'CronetSampleTest',
271             'java_in_dir': 'cronet/android/sample/javatests',
272             'resource_dir': 'cronet/android/sample/res',
273             'is_test_apk': 1,
274           },
275           'includes': [ '../build/java_apk.gypi' ],
276         },
277         {
278           'target_name': 'cronet_tests_jni_headers',
279           'type': 'none',
280           'sources': [
281             'cronet/android/test/src/org/chromium/net/CronetTestUtil.java',
282             'cronet/android/test/src/org/chromium/net/MockUrlRequestJobFactory.java',
283             'cronet/android/test/src/org/chromium/net/NativeTestServer.java',
284             'cronet/android/test/src/org/chromium/net/NetworkChangeNotifierUtil.java',
285             'cronet/android/test/src/org/chromium/net/QuicTestServer.java',
286             'cronet/android/test/src/org/chromium/net/SdchObserver.java',
287             'cronet/android/test/src/org/chromium/net/TestUploadDataStreamHandler.java',
288           ],
289           'variables': {
290             'jni_gen_package': 'cronet_tests',
291           },
292           'includes': [ '../build/jni_generator.gypi' ],
293         },
294         {
295           'target_name': 'libcronet_tests',
296           'type': 'shared_library',
297           'sources': [
298             'cronet/android/test/cronet_test_jni.cc',
299             'cronet/android/test/mock_url_request_job_factory.cc',
300             'cronet/android/test/mock_url_request_job_factory.h',
301             'cronet/android/test/native_test_server.cc',
302             'cronet/android/test/native_test_server.h',
303             'cronet/android/test/quic_test_server.cc',
304             'cronet/android/test/quic_test_server.h',
305             'cronet/android/test/sdch_test_util.cc',
306             'cronet/android/test/sdch_test_util.h',
307             'cronet/android/test/test_upload_data_stream_handler.cc',
308             'cronet/android/test/test_upload_data_stream_handler.h',
309             'cronet/android/test/network_change_notifier_util.cc',
310             'cronet/android/test/network_change_notifier_util.h',
311           ],
312           'dependencies': [
313             'cronet_static',
314             'cronet_tests_jni_headers',
315             '../base/base.gyp:base',
316             '../net/net.gyp:net',
317             '../net/net.gyp:net_quic_proto',
318             '../net/net.gyp:net_test_support',
319             '../net/net.gyp:simple_quic_tools',
320             '../url/url.gyp:url_lib',
321             '../base/base.gyp:base_i18n',
322             '../third_party/icu/icu.gyp:icui18n',
323             '../third_party/icu/icu.gyp:icuuc',
324           ],
325           'conditions' : [
326             ['enable_data_reduction_proxy_support==1',
327               {
328                 'defines' : [
329                   'DATA_REDUCTION_PROXY_SUPPORT'
330                 ],
331               },
332             ],
333           ],
334         },
335         {
336           'target_name': 'cronet_test_apk',
337           'type': 'none',
338           'dependencies': [
339             'cronet_java',
340             '../net/net.gyp:net_java_test_support',
341           ],
342           'variables': {
343             'apk_name': 'CronetTest',
344             'java_in_dir': 'cronet/android/test',
345             'resource_dir': 'cronet/android/test/res',
346             'asset_location': 'cronet/android/test/assets',
347             'native_lib_target': 'libcronet_tests',
348           },
349           'includes': [ '../build/java_apk.gypi' ],
350         },
351         {
352           # cronet_test_apk creates a .jar as a side effect. Any java targets
353           # that need that .jar in their classpath should depend on this target,
354           # cronet_test_apk_java. Dependents of cronet_test_apk receive its
355           # jar path in the variable 'apk_output_jar_path'. This target should
356           # only be used by targets which instrument cronet_test_apk.
357           'target_name': 'cronet_test_apk_java',
358           'type': 'none',
359           'dependencies': [
360             'cronet_test_apk',
361           ],
362           'includes': [ '../build/apk_fake_jar.gypi' ],
363         },
364         {
365           'target_name': 'cronet_test_instrumentation_apk',
366           'type': 'none',
367           'dependencies': [
368             'cronet_test_apk_java',
369             '../base/base.gyp:base_java_test_support',
370           ],
371           'variables': {
372             'apk_name': 'CronetTestInstrumentation',
373             'java_in_dir': 'cronet/android/test/javatests',
374             'resource_dir': 'cronet/android/test/res',
375             'is_test_apk': 1,
376           },
377           'includes': [ '../build/java_apk.gypi' ],
378         },
379         {
380           'target_name': 'cronet_perf_test_apk',
381           'type': 'none',
382           'dependencies': [
383             'cronet_java',
384             'cronet_api',
385           ],
386           'variables': {
387             'apk_name': 'CronetPerfTest',
388             'java_in_dir': 'cronet/android/test/javaperftests',
389             'is_test_apk': 1,
390             'native_lib_target': 'libcronet',
391             'proguard_enabled': 'true',
392             'proguard_flags_paths': [
393               'cronet/android/proguard.cfg',
394             ],
395           },
396           'includes': [ '../build/java_apk.gypi' ],
397         },
398         {
399           'target_name': 'cronet_package',
400           'type': 'none',
401           'dependencies': [
402             'libcronet',
403             'cronet_java',
404             'cronet_api',
405             '../net/net.gyp:net_unittests_apk',
406           ],
407           'variables': {
408             'native_lib': 'libcronet.>(android_product_extension)',
409             'java_lib': 'cronet.jar',
410             'java_api_lib': 'cronet_api.jar',
411             'java_src_lib': 'cronet-src.jar',
412             'java_sample_src_lib': 'cronet-sample-src.jar',
413             'lib_java_dir': '<(PRODUCT_DIR)/lib.java',
414             'package_dir': '<(PRODUCT_DIR)/cronet',
415             'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/cronet',
416             'jar_extract_dir': '<(intermediate_dir)/cronet_jar_extract',
417             'jar_extract_stamp': '<(intermediate_dir)/jar_extract.stamp',
418             'cronet_jar_stamp': '<(intermediate_dir)/cronet_jar.stamp',
419           },
420           'actions': [
421             {
422               'action_name': 'strip libcronet',
423               'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
424               'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
425               'action': [
426                 '<(android_strip)',
427                 '--strip-unneeded',
428                 '<@(_inputs)',
429                 '-o',
430                 '<@(_outputs)',
431               ],
432             },
433             {
434               'action_name': 'extracting from jars',
435               'inputs':  [
436                 '<(lib_java_dir)/cronet_java.jar',
437                 '<(lib_java_dir)/base_java.jar',
438                 '<(lib_java_dir)/net_java.jar',
439                 '<(lib_java_dir)/url_java.jar',
440               ],
441               'outputs': ['<(jar_extract_stamp)', '<(jar_extract_dir)'],
442               'action': [
443                 'python',
444                 'cronet/tools/extract_from_jars.py',
445                 '--classes-dir=<(jar_extract_dir)',
446                 '--jars=<@(_inputs)',
447                 '--stamp=<(jar_extract_stamp)',
448               ],
449             },
450             {
451               'action_name': 'jar_<(_target_name)',
452               'message': 'Creating <(_target_name) jar',
453               'inputs': [
454                 '<(DEPTH)/build/android/gyp/util/build_utils.py',
455                 '<(DEPTH)/build/android/gyp/util/md5_check.py',
456                 '<(DEPTH)/build/android/gyp/jar.py',
457                 '<(jar_extract_stamp)',
458               ],
459               'outputs': [
460                 '<(package_dir)/<(java_lib)',
461                 '<(cronet_jar_stamp)',
462               ],
463               'action': [
464                 'python', '<(DEPTH)/build/android/gyp/jar.py',
465                 '--classes-dir=<(jar_extract_dir)',
466                 '--jar-path=<(package_dir)/<(java_lib)',
467                 '--stamp=<(cronet_jar_stamp)',
468               ]
469             },
470             {
471               'action_name': 'jar_src_<(_target_name)',
472               'inputs': ['cronet/tools/jar_src.py'] ,
473               'outputs': ['<(package_dir)/<(java_src_lib)'],
474               'action': [
475                 'python',
476                 '<@(_inputs)',
477                 '--src-dir=cronet/android/java/src',
478                 '--jar-path=<(package_dir)/<(java_src_lib)',
479               ],
480             },
481             {
482               'action_name': 'jar_sample_src_<(_target_name)',
483               'inputs': ['cronet/tools/jar_src.py'] ,
484               'outputs': ['<(package_dir)/<(java_sample_src_lib)'],
485               'action': [
486                 'python',
487                 '<@(_inputs)',
488                 '--src-dir=cronet/android/sample',
489                 '--jar-path=<(package_dir)/<(java_sample_src_lib)',
490               ],
491             },
492             {
493               'action_name': 'generate licenses',
494               'inputs': ['cronet/tools/cronet_licenses.py'] ,
495               'outputs': ['<(package_dir)/LICENSE'],
496               'action': [
497                 'python',
498                 '<@(_inputs)',
499                 'license',
500                 '<@(_outputs)',
501               ],
502             },
503           ],
504           'copies': [
505             {
506               'destination': '<(package_dir)',
507               'files': [
508                 '../AUTHORS',
509                 '../chrome/VERSION',
510                 'cronet/android/proguard.cfg',
511                 '<(lib_java_dir)/<(java_api_lib)'
512               ],
513             },
514             {
515               'destination': '<(package_dir)/symbols/<(android_app_abi)',
516               'files': [
517                 '<(SHARED_LIB_DIR)/<(native_lib)',
518               ],
519             },
520           ],
521         },
522       ],
523       'variables': {
524         'enable_data_reduction_proxy_support%': 0,
525       },
526     }],  # OS=="android"
527   ],