ExtensionInstallDialogView: fix scrolling behavior on Views (Win,Linux)
[chromium-blink-merge.git] / components / cronet.gypi
blob019e11968ed83dc457027be641eacbbe8f1c257a
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': 'load_states_list',
57           'type': 'none',
58           'sources': [
59             'cronet/android/java/src/org/chromium/net/LoadState.template',
60           ],
61           'variables': {
62             'package_name': 'org/chromium/cronet',
63             'template_deps': ['../net/base/load_states_list.h'],
64           },
65           'includes': [ '../build/android/java_cpp_template.gypi' ],
66         },
67         {
68           'target_name': 'cronet_version',
69           'type': 'none',
70           'variables': {
71             'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
72             'version_py_path': '<(DEPTH)/build/util/version.py',
73             'version_path': '<(DEPTH)/chrome/VERSION',
74             'template_input_path': 'cronet/android/java/src/org/chromium/net/Version.template',
75             'output_path': '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)/org/chromium/cronet/Version.java',
76           },
77           'direct_dependent_settings': {
78             'variables': {
79               # Ensure that the output directory is used in the class path
80               # when building targets that depend on this one.
81               'generated_src_dirs': [
82                 '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)',
83               ],
84               # Ensure dependents are rebuilt when the generated Java file changes.
85               'additional_input_paths': [
86                 '<(output_path)',
87               ],
88             },
89           },
90           'actions': [
91             {
92               'action_name': 'cronet_version',
93               'inputs': [
94                 '<(template_input_path)',
95                 '<(version_path)',
96                 '<(lastchange_path)',
97               ],
98               'outputs': [
99                 '<(output_path)',
100               ],
101               'action': [
102                 'python',
103                 '<(version_py_path)',
104                 '-f', '<(version_path)',
105                 '-f', '<(lastchange_path)',
106                 '<(template_input_path)',
107                 '<(output_path)',
108               ],
109               'message': 'Generating version information',
110             },
111           ],
112         },
113         {
114           'target_name': 'cronet_version_header',
115           'type': 'none',
116           # Need to set hard_depency flag because cronet_version generates a
117           # header.
118           'hard_dependency': 1,
119           'direct_dependent_settings': {
120             'include_dirs': [
121               '<(SHARED_INTERMEDIATE_DIR)/',
122             ],
123           },
124           'actions': [
125             {
126               'action_name': 'version_header',
127               'message': 'Generating version header file: <@(_outputs)',
128               'inputs': [
129                 '<(version_path)',
130                 'cronet/version.h.in',
131               ],
132               'outputs': [
133                 '<(SHARED_INTERMEDIATE_DIR)/components/cronet/version.h',
134               ],
135               'action': [
136                 'python',
137                 '<(version_py_path)',
138                 '-e', 'VERSION_FULL="<(version_full)"',
139                 'cronet/version.h.in',
140                 '<@(_outputs)',
141               ],
142               'includes': [
143                 '../build/util/version.gypi',
144               ],
145             },
146           ],
147         },
148         {
149           # cronet_static_small target has reduced binary size through using
150           # ICU alternatives which requires file and ftp support be disabled.
151           'target_name': 'cronet_static_small',
152           'defines': [
153             'USE_ICU_ALTERNATIVES_ON_ANDROID=1',
154             'DISABLE_FILE_SUPPORT=1',
155             'DISABLE_FTP_SUPPORT=1',
156           ],
157           'dependencies': [
158             '../net/net.gyp:net_small',
159           ],
160           'includes': [ 'cronet/cronet_static.gypi' ],
161           'conditions': [
162             ['enable_data_reduction_proxy_support==1',
163               {
164                 'dependencies': [
165                   '../components/components.gyp:data_reduction_proxy_core_browser_small',
166                 ],
167               },
168             ],
169           ],
170         },
171         {
172           # cronet_static target depends on ICU and includes file and ftp support.
173           'target_name': 'cronet_static',
174           'dependencies': [
175             '../base/base.gyp:base_i18n',
176             '../net/net.gyp:net',
177           ],
178           'includes': [ 'cronet/cronet_static.gypi' ],
179           'conditions': [
180             ['enable_data_reduction_proxy_support==1',
181               {
182                 'dependencies': [
183                   '../components/components.gyp:data_reduction_proxy_core_browser',
184                 ],
185               },
186             ],
187           ],
188         },
189         {
190           'target_name': 'libcronet',
191           'type': 'shared_library',
192           'sources': [
193             'cronet/android/cronet_jni.cc',
194           ],
195           'dependencies': [
196             'cronet_static_small',
197             '../base/base.gyp:base',
198             '../net/net.gyp:net_small',
199             '../url/url.gyp:url_lib_use_icu_alternatives_on_android',
200           ],
201         },
202         { # cronet_api.jar defines Cronet API and provides implementation of
203           # legacy api using HttpUrlConnection (not the Chromium stack).
204           'target_name': 'cronet_api',
205           'type': 'none',
206           'dependencies': [
207             'cronet_url_request_context_config_list',
208             'cronet_version',
209             'load_states_list',
210           ],
211           'variables': {
212             'java_in_dir': 'cronet/android/java',
213             'javac_includes': [
214               '**/ChunkedWritableByteChannel.java',
215               '**/ExtendedResponseInfo.java',
216               '**/HistogramManager.java',
217               '**/HttpUrlConnection*.java',
218               '**/HttpUrlRequest*.java',
219               '**/LoadState.java',
220               '**/RequestStatus.java',
221               '**/ResponseInfo.java',
222               '**/ResponseTooLargeException.java',
223               '**/StatusListener.java',
224               '**/UploadDataProvider.java',
225               '**/UploadDataSink.java',
226               '**/UrlRequest.java',
227               '**/UrlRequestContext.java',
228               '**/UrlRequestContextConfig.java',
229               '**/UrlRequestContextConfigList.java',
230               '**/UrlRequestException.java',
231               '**/UrlRequestListener.java',
232               '**/UserAgent.java',
233               '**/Version.java',
234             ],
235           },
236           'includes': [ '../build/java.gypi' ],
237         },
238         { # cronet.jar implements HttpUrlRequest interface using Chromium stack
239           # in native libcronet.so library.
240           'target_name': 'cronet_java',
241           'type': 'none',
242           'dependencies': [
243             '../base/base.gyp:base',
244             'cronet_api',
245             'cronet_url_request_java',
246             'libcronet',
247             'net_request_priority_java',
248           ],
249           'variables': {
250             'java_in_dir': 'cronet/android/java',
251             'javac_includes': [
252               '**/ChromiumAsyncUrlRequest.java',
253               '**/ChromiumUrlRequest.java',
254               '**/ChromiumUrlRequestContext.java',
255               '**/ChromiumUrlRequestError.java',
256               '**/ChromiumUrlRequestFactory.java',
257               '**/ChromiumUrlRequestPriority.java',
258               '**/CronetHistogramManager.java',
259               '**/CronetResponseInfo.java',
260               '**/CronetLibraryLoader.java',
261               '**/CronetUploadDataStream.java',
262               '**/CronetUrlRequest.java',
263               '**/CronetUrlRequestContext.java',
264               '**/CronetUrlRequestFactory.java',
265               '**/RequestPriority.java',
266               '**/urlconnection/CronetBufferedOutputStream.java',
267               '**/urlconnection/CronetChunkedOutputStream.java',
268               '**/urlconnection/CronetFixedModeOutputStream.java',
269               '**/urlconnection/CronetInputStream.java',
270               '**/urlconnection/CronetHttpURLConnection.java',
271               '**/urlconnection/CronetHttpURLStreamHandler.java',
272               '**/urlconnection/CronetOutputStream.java',
273               '**/urlconnection/CronetURLStreamHandlerFactory.java',
274               '**/urlconnection/MessageLoop.java',
275             ],
276           },
277           'includes': [ '../build/java.gypi' ],
278         },
279         {
280           'target_name': 'cronet_sample_apk',
281           'type': 'none',
282           'dependencies': [
283             'cronet_java',
284             'cronet_api',
285           ],
286           'variables': {
287             'apk_name': 'CronetSample',
288             'java_in_dir': 'cronet/android/sample',
289             'resource_dir': 'cronet/android/sample/res',
290             'native_lib_target': 'libcronet',
291             'proguard_enabled': 'true',
292             'proguard_flags_paths': [
293               'cronet/android/proguard.cfg',
294               'cronet/android/sample/javatests/proguard.cfg',
295             ],
296           },
297           'includes': [ '../build/java_apk.gypi' ],
298         },
299         {
300           # cronet_sample_apk creates a .jar as a side effect. Any java targets
301           # that need that .jar in their classpath should depend on this target,
302           # cronet_sample_apk_java. Dependents of cronet_sample_apk receive its
303           # jar path in the variable 'apk_output_jar_path'. This target should
304           # only be used by targets which instrument cronet_sample_apk.
305           'target_name': 'cronet_sample_apk_java',
306           'type': 'none',
307           'dependencies': [
308             'cronet_sample_apk',
309           ],
310           'includes': [ '../build/apk_fake_jar.gypi' ],
311         },
312         {
313           'target_name': 'cronet_sample_test_apk',
314           'type': 'none',
315           'dependencies': [
316             'cronet_java',
317             'cronet_sample_apk_java',
318             'cronet_api',
319             '../base/base.gyp:base_java_test_support',
320           ],
321           'variables': {
322             'apk_name': 'CronetSampleTest',
323             'java_in_dir': 'cronet/android/sample/javatests',
324             'resource_dir': 'cronet/android/sample/res',
325             'is_test_apk': 1,
326           },
327           'includes': [ '../build/java_apk.gypi' ],
328         },
329         {
330           'target_name': 'cronet_tests_jni_headers',
331           'type': 'none',
332           'sources': [
333             'cronet/android/test/src/org/chromium/net/CronetTestUtil.java',
334             'cronet/android/test/src/org/chromium/net/MockUrlRequestJobFactory.java',
335             'cronet/android/test/src/org/chromium/net/NativeTestServer.java',
336             'cronet/android/test/src/org/chromium/net/NetworkChangeNotifierUtil.java',
337             'cronet/android/test/src/org/chromium/net/QuicTestServer.java',
338             'cronet/android/test/src/org/chromium/net/SdchObserver.java',
339             'cronet/android/test/src/org/chromium/net/TestUploadDataStreamHandler.java',
340           ],
341           'variables': {
342             'jni_gen_package': 'cronet_tests',
343           },
344           'includes': [ '../build/jni_generator.gypi' ],
345         },
346         {
347           'target_name': 'libcronet_tests',
348           'type': 'shared_library',
349           'sources': [
350             'cronet/android/test/cronet_test_jni.cc',
351             'cronet/android/test/mock_url_request_job_factory.cc',
352             'cronet/android/test/mock_url_request_job_factory.h',
353             'cronet/android/test/native_test_server.cc',
354             'cronet/android/test/native_test_server.h',
355             'cronet/android/test/quic_test_server.cc',
356             'cronet/android/test/quic_test_server.h',
357             'cronet/android/test/sdch_test_util.cc',
358             'cronet/android/test/sdch_test_util.h',
359             'cronet/android/test/test_upload_data_stream_handler.cc',
360             'cronet/android/test/test_upload_data_stream_handler.h',
361             'cronet/android/test/network_change_notifier_util.cc',
362             'cronet/android/test/network_change_notifier_util.h',
363           ],
364           'dependencies': [
365             'cronet_static',
366             'cronet_tests_jni_headers',
367             '../base/base.gyp:base',
368             '../net/net.gyp:net',
369             '../net/net.gyp:net_quic_proto',
370             '../net/net.gyp:net_test_support',
371             '../net/net.gyp:simple_quic_tools',
372             '../url/url.gyp:url_lib',
373             '../base/base.gyp:base_i18n',
374             '../third_party/icu/icu.gyp:icui18n',
375             '../third_party/icu/icu.gyp:icuuc',
376           ],
377           'conditions' : [
378             ['enable_data_reduction_proxy_support==1',
379               {
380                 'defines' : [
381                   'DATA_REDUCTION_PROXY_SUPPORT'
382                 ],
383               },
384             ],
385           ],
386         },
387         {
388           'target_name': 'cronet_test_apk',
389           'type': 'none',
390           'dependencies': [
391             'cronet_java',
392             '../net/net.gyp:net_java_test_support',
393           ],
394           'variables': {
395             'apk_name': 'CronetTest',
396             'java_in_dir': 'cronet/android/test',
397             'resource_dir': 'cronet/android/test/res',
398             'asset_location': 'cronet/android/test/assets',
399             'native_lib_target': 'libcronet_tests',
400           },
401           'includes': [ '../build/java_apk.gypi' ],
402         },
403         {
404           # cronet_test_apk creates a .jar as a side effect. Any java targets
405           # that need that .jar in their classpath should depend on this target,
406           # cronet_test_apk_java. Dependents of cronet_test_apk receive its
407           # jar path in the variable 'apk_output_jar_path'. This target should
408           # only be used by targets which instrument cronet_test_apk.
409           'target_name': 'cronet_test_apk_java',
410           'type': 'none',
411           'dependencies': [
412             'cronet_test_apk',
413           ],
414           'includes': [ '../build/apk_fake_jar.gypi' ],
415         },
416         {
417           'target_name': 'cronet_test_instrumentation_apk',
418           'type': 'none',
419           'dependencies': [
420             'cronet_test_apk_java',
421             '../base/base.gyp:base_java_test_support',
422           ],
423           'variables': {
424             'apk_name': 'CronetTestInstrumentation',
425             'java_in_dir': 'cronet/android/test/javatests',
426             'resource_dir': 'cronet/android/test/res',
427             'is_test_apk': 1,
428           },
429           'includes': [ '../build/java_apk.gypi' ],
430         },
431         {
432           'target_name': 'cronet_perf_test_apk',
433           'type': 'none',
434           'dependencies': [
435             'cronet_java',
436             'cronet_api',
437           ],
438           'variables': {
439             'apk_name': 'CronetPerfTest',
440             'java_in_dir': 'cronet/android/test/javaperftests',
441             'is_test_apk': 1,
442             'native_lib_target': 'libcronet',
443             'proguard_enabled': 'true',
444             'proguard_flags_paths': [
445               'cronet/android/proguard.cfg',
446             ],
447           },
448           'includes': [ '../build/java_apk.gypi' ],
449         },
450         {
451           'target_name': 'cronet_package',
452           'type': 'none',
453           'dependencies': [
454             'libcronet',
455             'cronet_java',
456             'cronet_api',
457             '../net/net.gyp:net_unittests_apk',
458           ],
459           'variables': {
460             'native_lib': 'libcronet.>(android_product_extension)',
461             'java_lib': 'cronet.jar',
462             'java_api_lib': 'cronet_api.jar',
463             'java_src_lib': 'cronet-src.jar',
464             'java_sample_src_lib': 'cronet-sample-src.jar',
465             'lib_java_dir': '<(PRODUCT_DIR)/lib.java',
466             'package_dir': '<(PRODUCT_DIR)/cronet',
467             'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/cronet',
468             'jar_extract_dir': '<(intermediate_dir)/cronet_jar_extract',
469             'jar_extract_stamp': '<(intermediate_dir)/jar_extract.stamp',
470             'cronet_jar_stamp': '<(intermediate_dir)/cronet_jar.stamp',
471           },
472           'actions': [
473             {
474               'action_name': 'strip libcronet',
475               'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
476               'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
477               'action': [
478                 '<(android_strip)',
479                 '--strip-unneeded',
480                 '<@(_inputs)',
481                 '-o',
482                 '<@(_outputs)',
483               ],
484             },
485             {
486               'action_name': 'extracting from jars',
487               'inputs':  [
488                 '<(lib_java_dir)/cronet_java.jar',
489                 '<(lib_java_dir)/base_java.jar',
490                 '<(lib_java_dir)/net_java.jar',
491                 '<(lib_java_dir)/url_java.jar',
492               ],
493               'outputs': ['<(jar_extract_stamp)', '<(jar_extract_dir)'],
494               'action': [
495                 'python',
496                 'cronet/tools/extract_from_jars.py',
497                 '--classes-dir=<(jar_extract_dir)',
498                 '--jars=<@(_inputs)',
499                 '--stamp=<(jar_extract_stamp)',
500               ],
501             },
502             {
503               'action_name': 'jar_<(_target_name)',
504               'message': 'Creating <(_target_name) jar',
505               'inputs': [
506                 '<(DEPTH)/build/android/gyp/util/build_utils.py',
507                 '<(DEPTH)/build/android/gyp/util/md5_check.py',
508                 '<(DEPTH)/build/android/gyp/jar.py',
509                 '<(jar_extract_stamp)',
510               ],
511               'outputs': [
512                 '<(package_dir)/<(java_lib)',
513                 '<(cronet_jar_stamp)',
514               ],
515               'action': [
516                 'python', '<(DEPTH)/build/android/gyp/jar.py',
517                 '--classes-dir=<(jar_extract_dir)',
518                 '--jar-path=<(package_dir)/<(java_lib)',
519                 '--stamp=<(cronet_jar_stamp)',
520               ]
521             },
522             {
523               'action_name': 'jar_src_<(_target_name)',
524               'inputs': ['cronet/tools/jar_src.py'] ,
525               'outputs': ['<(package_dir)/<(java_src_lib)'],
526               'action': [
527                 'python',
528                 '<@(_inputs)',
529                 '--src-dir=cronet/android/java/src',
530                 '--jar-path=<(package_dir)/<(java_src_lib)',
531               ],
532             },
533             {
534               'action_name': 'jar_sample_src_<(_target_name)',
535               'inputs': ['cronet/tools/jar_src.py'] ,
536               'outputs': ['<(package_dir)/<(java_sample_src_lib)'],
537               'action': [
538                 'python',
539                 '<@(_inputs)',
540                 '--src-dir=cronet/android/sample',
541                 '--jar-path=<(package_dir)/<(java_sample_src_lib)',
542               ],
543             },
544             {
545               'action_name': 'generate licenses',
546               'inputs': ['cronet/tools/cronet_licenses.py'] ,
547               'outputs': ['<(package_dir)/LICENSE'],
548               'action': [
549                 'python',
550                 '<@(_inputs)',
551                 'license',
552                 '<@(_outputs)',
553               ],
554             },
555             {
556               'action_name': 'generate javadoc',
557               'inputs': ['cronet/tools/generate_javadoc.py'] ,
558               'outputs': ['<(package_dir)/javadoc'],
559               'action': [
560                 'python',
561                 '<@(_inputs)',
562                 '--source-dir=src',
563                 '--output-dir=<(package_dir)/javadoc',
564                 '--working-dir=cronet/android/java',
565               ],
566               'message': 'Generating Javadoc',
567             },
568           ],
569           'copies': [
570             {
571               'destination': '<(package_dir)',
572               'files': [
573                 '../AUTHORS',
574                 '../chrome/VERSION',
575                 'cronet/android/proguard.cfg',
576                 '<(lib_java_dir)/<(java_api_lib)'
577               ],
578             },
579             {
580               'destination': '<(package_dir)/symbols/<(android_app_abi)',
581               'files': [
582                 '<(SHARED_LIB_DIR)/<(native_lib)',
583               ],
584             },
585           ],
586         },
587       ],
588       'variables': {
589         'enable_data_reduction_proxy_support%': 0,
590       },
591     }],  # OS=="android"
592   ],