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