Revert Disable Rotation on Login Pages
[chromium-blink-merge.git] / components / cronet.gypi
blob977aa27ee670605bae61b039f149ed616cb4364f
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_stub.jar defines HttpUrlRequest interface and provides its
156           # its implementation using HttpUrlConnection (not the Chromium stack).
157           'target_name': 'cronet_stub',
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_stub',
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_stub',
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_stub',
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/TestUploadDataStreamHandler.java',
287           ],
288           'variables': {
289             'jni_gen_package': 'cronet_tests',
290           },
291           'includes': [ '../build/jni_generator.gypi' ],
292         },
293         {
294           'target_name': 'libcronet_tests',
295           'type': 'shared_library',
296           'sources': [
297             'cronet/android/test/cronet_test_jni.cc',
298             'cronet/android/test/mock_url_request_job_factory.cc',
299             'cronet/android/test/mock_url_request_job_factory.h',
300             'cronet/android/test/native_test_server.cc',
301             'cronet/android/test/native_test_server.h',
302             'cronet/android/test/quic_test_server.cc',
303             'cronet/android/test/quic_test_server.h',
304             'cronet/android/test/test_upload_data_stream_handler.cc',
305             'cronet/android/test/test_upload_data_stream_handler.h',
306             'cronet/android/test/network_change_notifier_util.cc',
307             'cronet/android/test/network_change_notifier_util.h',
308           ],
309           'dependencies': [
310             'cronet_static',
311             'cronet_tests_jni_headers',
312             '../base/base.gyp:base',
313             '../net/net.gyp:net',
314             '../net/net.gyp:net_quic_proto',
315             '../net/net.gyp:net_test_support',
316             '../net/net.gyp:simple_quic_tools',
317             '../url/url.gyp:url_lib',
318             '../base/base.gyp:base_i18n',
319             '../third_party/icu/icu.gyp:icui18n',
320             '../third_party/icu/icu.gyp:icuuc',
321           ],
322           'conditions' : [
323             ['enable_data_reduction_proxy_support==1',
324               {
325                 'defines' : [
326                   'DATA_REDUCTION_PROXY_SUPPORT'
327                 ],
328               },
329             ],
330           ],
331         },
332         {
333           'target_name': 'cronet_test_apk',
334           'type': 'none',
335           'dependencies': [
336             'cronet_java',
337             '../net/net.gyp:net_java_test_support',
338           ],
339           'variables': {
340             'apk_name': 'CronetTest',
341             'java_in_dir': 'cronet/android/test',
342             'resource_dir': 'cronet/android/test/res',
343             'asset_location': 'cronet/android/test/assets',
344             'native_lib_target': 'libcronet_tests',
345           },
346           'includes': [ '../build/java_apk.gypi' ],
347         },
348         {
349           # cronet_test_apk creates a .jar as a side effect. Any java targets
350           # that need that .jar in their classpath should depend on this target,
351           # cronet_test_apk_java. Dependents of cronet_test_apk receive its
352           # jar path in the variable 'apk_output_jar_path'. This target should
353           # only be used by targets which instrument cronet_test_apk.
354           'target_name': 'cronet_test_apk_java',
355           'type': 'none',
356           'dependencies': [
357             'cronet_test_apk',
358           ],
359           'includes': [ '../build/apk_fake_jar.gypi' ],
360         },
361         {
362           'target_name': 'cronet_test_instrumentation_apk',
363           'type': 'none',
364           'dependencies': [
365             'cronet_test_apk_java',
366             '../base/base.gyp:base_java_test_support',
367           ],
368           'variables': {
369             'apk_name': 'CronetTestInstrumentation',
370             'java_in_dir': 'cronet/android/test/javatests',
371             'resource_dir': 'cronet/android/test/res',
372             'is_test_apk': 1,
373           },
374           'includes': [ '../build/java_apk.gypi' ],
375         },
376         {
377           'target_name': 'cronet_package',
378           'type': 'none',
379           'dependencies': [
380             'libcronet',
381             'cronet_java',
382             'cronet_stub',
383             '../net/net.gyp:net_unittests_apk',
384           ],
385           'variables': {
386             'native_lib': 'libcronet.>(android_product_extension)',
387             'java_lib': 'cronet.jar',
388             'java_stub_lib': 'cronet_stub.jar',
389             'java_src_lib': 'cronet-src.jar',
390             'java_sample_src_lib': 'cronet-sample-src.jar',
391             'lib_java_dir': '<(PRODUCT_DIR)/lib.java',
392             'package_dir': '<(PRODUCT_DIR)/cronet',
393             'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/cronet',
394             'jar_extract_dir': '<(intermediate_dir)/cronet_jar_extract',
395             'jar_extract_stamp': '<(intermediate_dir)/jar_extract.stamp',
396             'cronet_jar_stamp': '<(intermediate_dir)/cronet_jar.stamp',
397           },
398           'actions': [
399             {
400               'action_name': 'strip libcronet',
401               'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
402               'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
403               'action': [
404                 '<(android_strip)',
405                 '--strip-unneeded',
406                 '<@(_inputs)',
407                 '-o',
408                 '<@(_outputs)',
409               ],
410             },
411             {
412               'action_name': 'extracting from jars',
413               'inputs':  [
414                 '<(lib_java_dir)/cronet_java.jar',
415                 '<(lib_java_dir)/base_java.jar',
416                 '<(lib_java_dir)/net_java.jar',
417                 '<(lib_java_dir)/url_java.jar',
418               ],
419               'outputs': ['<(jar_extract_stamp)', '<(jar_extract_dir)'],
420               'action': [
421                 'python',
422                 'cronet/tools/extract_from_jars.py',
423                 '--classes-dir=<(jar_extract_dir)',
424                 '--jars=<@(_inputs)',
425                 '--stamp=<(jar_extract_stamp)',
426               ],
427             },
428             {
429               'action_name': 'jar_<(_target_name)',
430               'message': 'Creating <(_target_name) jar',
431               'inputs': [
432                 '<(DEPTH)/build/android/gyp/util/build_utils.py',
433                 '<(DEPTH)/build/android/gyp/util/md5_check.py',
434                 '<(DEPTH)/build/android/gyp/jar.py',
435                 '<(jar_extract_stamp)',
436               ],
437               'outputs': [
438                 '<(package_dir)/<(java_lib)',
439                 '<(cronet_jar_stamp)',
440               ],
441               'action': [
442                 'python', '<(DEPTH)/build/android/gyp/jar.py',
443                 '--classes-dir=<(jar_extract_dir)',
444                 '--jar-path=<(package_dir)/<(java_lib)',
445                 '--stamp=<(cronet_jar_stamp)',
446               ]
447             },
448             {
449               'action_name': 'jar_src_<(_target_name)',
450               'inputs': ['cronet/tools/jar_src.py'] ,
451               'outputs': ['<(package_dir)/<(java_src_lib)'],
452               'action': [
453                 'python',
454                 '<@(_inputs)',
455                 '--src-dir=cronet/android/java/src',
456                 '--jar-path=<(package_dir)/<(java_src_lib)',
457               ],
458             },
459             {
460               'action_name': 'jar_sample_src_<(_target_name)',
461               'inputs': ['cronet/tools/jar_src.py'] ,
462               'outputs': ['<(package_dir)/<(java_sample_src_lib)'],
463               'action': [
464                 'python',
465                 '<@(_inputs)',
466                 '--src-dir=cronet/android/sample',
467                 '--jar-path=<(package_dir)/<(java_sample_src_lib)',
468               ],
469             },
470             {
471               'action_name': 'generate licenses',
472               'inputs': ['cronet/tools/cronet_licenses.py'] ,
473               'outputs': ['<(package_dir)/LICENSE'],
474               'action': [
475                 'python',
476                 '<@(_inputs)',
477                 'license',
478                 '<@(_outputs)',
479               ],
480             },
481           ],
482           'copies': [
483             {
484               'destination': '<(package_dir)',
485               'files': [
486                 '../AUTHORS',
487                 '../chrome/VERSION',
488                 'cronet/android/proguard.cfg',
489                 '<(lib_java_dir)/<(java_stub_lib)'
490               ],
491             },
492             {
493               'destination': '<(package_dir)/symbols/<(android_app_abi)',
494               'files': [
495                 '<(SHARED_LIB_DIR)/<(native_lib)',
496               ],
497             },
498           ],
499         },
500       ],
501       'variables': {
502         'enable_data_reduction_proxy_support%': 0,
503       },
504     }],  # OS=="android"
505   ],