[Android] Mark EnhancedBookmarksModelTest.testMoveBookmarks as flaky.
[chromium-blink-merge.git] / components / cronet.gypi
blobb445fbbbadc2d9bc6c36d4a0c183c3ca6047bd3f
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             'is_test_apk': 1,
325           },
326           'includes': [ '../build/java_apk.gypi' ],
327         },
328         {
329           'target_name': 'cronet_tests_jni_headers',
330           'type': 'none',
331           'sources': [
332             'cronet/android/test/src/org/chromium/net/CronetTestUtil.java',
333             'cronet/android/test/src/org/chromium/net/MockUrlRequestJobFactory.java',
334             'cronet/android/test/src/org/chromium/net/NativeTestServer.java',
335             'cronet/android/test/src/org/chromium/net/NetworkChangeNotifierUtil.java',
336             'cronet/android/test/src/org/chromium/net/QuicTestServer.java',
337             'cronet/android/test/src/org/chromium/net/SdchObserver.java',
338             'cronet/android/test/src/org/chromium/net/TestUploadDataStreamHandler.java',
339           ],
340           'variables': {
341             'jni_gen_package': 'cronet_tests',
342           },
343           'includes': [ '../build/jni_generator.gypi' ],
344         },
345         {
346           'target_name': 'libcronet_tests',
347           'type': 'shared_library',
348           'sources': [
349             'cronet/android/test/cronet_test_jni.cc',
350             'cronet/android/test/mock_url_request_job_factory.cc',
351             'cronet/android/test/mock_url_request_job_factory.h',
352             'cronet/android/test/native_test_server.cc',
353             'cronet/android/test/native_test_server.h',
354             'cronet/android/test/quic_test_server.cc',
355             'cronet/android/test/quic_test_server.h',
356             'cronet/android/test/sdch_test_util.cc',
357             'cronet/android/test/sdch_test_util.h',
358             'cronet/android/test/test_upload_data_stream_handler.cc',
359             'cronet/android/test/test_upload_data_stream_handler.h',
360             'cronet/android/test/network_change_notifier_util.cc',
361             'cronet/android/test/network_change_notifier_util.h',
362           ],
363           'dependencies': [
364             'cronet_static',
365             'cronet_tests_jni_headers',
366             '../base/base.gyp:base',
367             '../net/net.gyp:net',
368             '../net/net.gyp:net_quic_proto',
369             '../net/net.gyp:net_test_support',
370             '../net/net.gyp:simple_quic_tools',
371             '../url/url.gyp:url_lib',
372             '../base/base.gyp:base_i18n',
373             '../third_party/icu/icu.gyp:icui18n',
374             '../third_party/icu/icu.gyp:icuuc',
375           ],
376           'conditions' : [
377             ['enable_data_reduction_proxy_support==1',
378               {
379                 'defines' : [
380                   'DATA_REDUCTION_PROXY_SUPPORT'
381                 ],
382               },
383             ],
384           ],
385         },
386         {
387           'target_name': 'cronet_test_apk',
388           'type': 'none',
389           'dependencies': [
390             'cronet_java',
391             '../net/net.gyp:net_java_test_support',
392           ],
393           'variables': {
394             'apk_name': 'CronetTest',
395             'java_in_dir': 'cronet/android/test',
396             'resource_dir': 'cronet/android/test/res',
397             'asset_location': 'cronet/android/test/assets',
398             'native_lib_target': 'libcronet_tests',
399           },
400           'includes': [ '../build/java_apk.gypi' ],
401         },
402         {
403           # cronet_test_apk creates a .jar as a side effect. Any java targets
404           # that need that .jar in their classpath should depend on this target,
405           # cronet_test_apk_java. Dependents of cronet_test_apk receive its
406           # jar path in the variable 'apk_output_jar_path'. This target should
407           # only be used by targets which instrument cronet_test_apk.
408           'target_name': 'cronet_test_apk_java',
409           'type': 'none',
410           'dependencies': [
411             'cronet_test_apk',
412           ],
413           'includes': [ '../build/apk_fake_jar.gypi' ],
414         },
415         {
416           'target_name': 'cronet_test_instrumentation_apk',
417           'type': 'none',
418           'dependencies': [
419             'cronet_test_apk_java',
420             '../base/base.gyp:base_java_test_support',
421           ],
422           'variables': {
423             'apk_name': 'CronetTestInstrumentation',
424             'java_in_dir': 'cronet/android/test/javatests',
425             'resource_dir': 'cronet/android/test/res',
426             'is_test_apk': 1,
427           },
428           'includes': [ '../build/java_apk.gypi' ],
429         },
430         {
431           'target_name': 'cronet_perf_test_apk',
432           'type': 'none',
433           'dependencies': [
434             'cronet_java',
435             'cronet_api',
436           ],
437           'variables': {
438             'apk_name': 'CronetPerfTest',
439             'java_in_dir': 'cronet/android/test/javaperftests',
440             'is_test_apk': 1,
441             'native_lib_target': 'libcronet',
442             'proguard_enabled': 'true',
443             'proguard_flags_paths': [
444               'cronet/android/proguard.cfg',
445             ],
446           },
447           'includes': [ '../build/java_apk.gypi' ],
448         },
449         {
450           'target_name': 'cronet_package',
451           'type': 'none',
452           'dependencies': [
453             'libcronet',
454             'cronet_java',
455             'cronet_api',
456             '../net/net.gyp:net_unittests_apk',
457           ],
458           'variables': {
459             'native_lib': 'libcronet.>(android_product_extension)',
460             'java_lib': 'cronet.jar',
461             'java_api_lib': 'cronet_api.jar',
462             'java_src_lib': 'cronet-src.jar',
463             'java_sample_src_lib': 'cronet-sample-src.jar',
464             'lib_java_dir': '<(PRODUCT_DIR)/lib.java',
465             'package_dir': '<(PRODUCT_DIR)/cronet',
466             'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/cronet',
467             'jar_extract_dir': '<(intermediate_dir)/cronet_jar_extract',
468             'jar_extract_stamp': '<(intermediate_dir)/jar_extract.stamp',
469             'cronet_jar_stamp': '<(intermediate_dir)/cronet_jar.stamp',
470           },
471           'actions': [
472             {
473               'action_name': 'strip libcronet',
474               'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
475               'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
476               'action': [
477                 '<(android_strip)',
478                 '--strip-unneeded',
479                 '<@(_inputs)',
480                 '-o',
481                 '<@(_outputs)',
482               ],
483             },
484             {
485               'action_name': 'extracting from jars',
486               'inputs':  [
487                 '<(lib_java_dir)/cronet_java.jar',
488                 '<(lib_java_dir)/base_java.jar',
489                 '<(lib_java_dir)/net_java.jar',
490                 '<(lib_java_dir)/url_java.jar',
491               ],
492               'outputs': ['<(jar_extract_stamp)', '<(jar_extract_dir)'],
493               'action': [
494                 'python',
495                 'cronet/tools/extract_from_jars.py',
496                 '--classes-dir=<(jar_extract_dir)',
497                 '--jars=<@(_inputs)',
498                 '--stamp=<(jar_extract_stamp)',
499               ],
500             },
501             {
502               'action_name': 'jar_<(_target_name)',
503               'message': 'Creating <(_target_name) jar',
504               'inputs': [
505                 '<(DEPTH)/build/android/gyp/util/build_utils.py',
506                 '<(DEPTH)/build/android/gyp/util/md5_check.py',
507                 '<(DEPTH)/build/android/gyp/jar.py',
508                 '<(jar_extract_stamp)',
509               ],
510               'outputs': [
511                 '<(package_dir)/<(java_lib)',
512                 '<(cronet_jar_stamp)',
513               ],
514               'action': [
515                 'python', '<(DEPTH)/build/android/gyp/jar.py',
516                 '--classes-dir=<(jar_extract_dir)',
517                 '--jar-path=<(package_dir)/<(java_lib)',
518                 '--stamp=<(cronet_jar_stamp)',
519               ]
520             },
521             {
522               'action_name': 'jar_src_<(_target_name)',
523               'inputs': ['cronet/tools/jar_src.py'] ,
524               'outputs': ['<(package_dir)/<(java_src_lib)'],
525               'action': [
526                 'python',
527                 '<@(_inputs)',
528                 '--src-dir=cronet/android/java/src',
529                 '--jar-path=<(package_dir)/<(java_src_lib)',
530               ],
531             },
532             {
533               'action_name': 'jar_sample_src_<(_target_name)',
534               'inputs': ['cronet/tools/jar_src.py'] ,
535               'outputs': ['<(package_dir)/<(java_sample_src_lib)'],
536               'action': [
537                 'python',
538                 '<@(_inputs)',
539                 '--src-dir=cronet/android/sample',
540                 '--jar-path=<(package_dir)/<(java_sample_src_lib)',
541               ],
542             },
543             {
544               'action_name': 'generate licenses',
545               'inputs': ['cronet/tools/cronet_licenses.py'] ,
546               'outputs': ['<(package_dir)/LICENSE'],
547               'action': [
548                 'python',
549                 '<@(_inputs)',
550                 'license',
551                 '<@(_outputs)',
552               ],
553             },
554             {
555               'action_name': 'generate javadoc',
556               'inputs': ['cronet/tools/generate_javadoc.py'] ,
557               'outputs': ['<(package_dir)/javadoc'],
558               'action': [
559                 'python',
560                 '<@(_inputs)',
561                 '--source-dir=src',
562                 '--output-dir=<(package_dir)/javadoc',
563                 '--working-dir=cronet/android/java',
564               ],
565               'message': 'Generating Javadoc',
566             },
567           ],
568           'copies': [
569             {
570               'destination': '<(package_dir)',
571               'files': [
572                 '../AUTHORS',
573                 '../chrome/VERSION',
574                 'cronet/android/proguard.cfg',
575                 '<(lib_java_dir)/<(java_api_lib)'
576               ],
577             },
578             {
579               'destination': '<(package_dir)/symbols/<(android_app_abi)',
580               'files': [
581                 '<(SHARED_LIB_DIR)/<(native_lib)',
582               ],
583             },
584           ],
585         },
586       ],
587       'variables': {
588         'enable_data_reduction_proxy_support%': 0,
589       },
590     }],  # OS=="android"
591   ],