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.
8 # TODO(mef): Figure out what needs to be done for gn script.
11 'target_name': 'cronet_jni_headers',
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',
23 'jni_gen_package': 'cronet',
25 'includes': [ '../build/jni_generator.gypi' ],
28 'target_name': 'cronet_url_request_java',
31 'source_file': 'cronet/android/chromium_url_request.h',
33 'includes': [ '../build/android/java_cpp_enum.gypi' ],
36 'target_name': 'net_request_priority_java',
39 'source_file': '../net/base/request_priority.h',
41 'includes': [ '../build/android/java_cpp_enum.gypi' ],
44 'target_name': 'cronet_url_request_context_config_list',
47 'cronet/android/java/src/org/chromium/net/UrlRequestContextConfigList.template',
50 'package_name': 'org/chromium/cronet',
51 'template_deps': ['cronet/url_request_context_config_list.h'],
53 'includes': [ '../build/android/java_cpp_template.gypi' ],
56 'target_name': 'cronet_version',
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',
65 'direct_dependent_settings': {
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)',
72 # Ensure dependents are rebuilt when the generated Java file changes.
73 'additional_input_paths': [
80 'action_name': 'cronet_version',
82 '<(template_input_path)',
92 '-f', '<(version_path)',
93 '-f', '<(lastchange_path)',
94 '<(template_input_path)',
97 'message': 'Generating version information',
102 'target_name': 'cronet_static',
103 'type': 'static_library',
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',
115 '../net/net.gyp:net',
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',
151 '-ffunction-sections',
153 '-fvisibility=hidden',
154 '-fvisibility-inlines-hidden',
156 '-Wno-missing-field-initializers',
162 '-Wl,--exclude-libs,ALL'
165 [ 'use_icu_alternatives_on_android == 1', {
167 '../base/base.gyp:base_i18n',
168 '../third_party/icu/icu.gyp:icui18n',
169 '../third_party/icu/icu.gyp:icuuc',
176 'target_name': 'libcronet',
177 'type': 'shared_library',
179 'cronet/android/cronet_jni.cc',
183 '../base/base.gyp:base',
184 '../net/net.gyp:net',
185 '../url/url.gyp:url_lib',
188 { # cronet_stub.jar defines HttpUrlRequest interface and provides its
189 # its implementation using HttpUrlConnection (not the Chromium stack).
190 'target_name': 'cronet_stub',
193 'cronet_url_request_context_config_list',
197 'java_in_dir': 'cronet/android/java',
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',
218 'includes': [ '../build/java.gypi' ],
220 { # cronet.jar implements HttpUrlRequest interface using Chromium stack
221 # in native libcronet.so library.
222 'target_name': 'cronet',
225 '../base/base.gyp:base',
227 'cronet_url_request_java',
229 'net_request_priority_java',
232 'java_in_dir': 'cronet/android/java',
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',
255 'includes': [ '../build/java.gypi' ],
258 'target_name': 'cronet_sample_apk',
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',
275 'includes': [ '../build/java_apk.gypi' ],
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',
288 'includes': [ '../build/apk_fake_jar.gypi' ],
291 'target_name': 'cronet_sample_test_apk',
295 'cronet_sample_apk_java',
297 '../base/base.gyp:base_java_test_support',
300 'apk_name': 'CronetSampleTest',
301 'java_in_dir': 'cronet/android/sample/javatests',
302 'resource_dir': 'cronet/android/sample/res',
305 'includes': [ '../build/java_apk.gypi' ],
308 'target_name': 'cronet_tests_jni_headers',
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',
318 'jni_gen_package': 'cronet_tests',
320 'includes': [ '../build/jni_generator.gypi' ],
323 'target_name': 'libcronet_tests',
324 'type': 'shared_library',
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',
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',
349 ['use_icu_alternatives_on_android==1',
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',
362 'target_name': 'cronet_test_apk',
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',
374 'includes': [ '../build/java_apk.gypi' ],
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',
387 'includes': [ '../build/apk_fake_jar.gypi' ],
390 'target_name': 'cronet_test_instrumentation_apk',
393 'cronet_test_apk_java',
394 '../base/base.gyp:base_java_test_support',
397 'apk_name': 'CronetTestInstrumentation',
398 'java_in_dir': 'cronet/android/test/javatests',
399 'resource_dir': 'cronet/android/test/res',
402 'includes': [ '../build/java_apk.gypi' ],
406 ['OS=="android" and use_icu_alternatives_on_android==1', {
409 'target_name': 'cronet_package',
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/*',
429 'jar_extract_stamp': '<(intermediate_dir)/jar_extract.stamp',
430 'cronet_jar_stamp': '<(intermediate_dir)/cronet_jar.stamp',
434 'action_name': 'strip libcronet',
435 'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
436 'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
446 'action_name': 'extracting from jars',
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',
453 'outputs': ['<(jar_extract_stamp)', '<(jar_extract_dir)'],
456 'cronet/tools/extract_from_jars.py',
457 '--classes-dir=<(jar_extract_dir)',
458 '--jars=<@(_inputs)',
459 '--stamp=<(jar_extract_stamp)',
463 'action_name': 'jar_<(_target_name)',
464 'message': 'Creating <(_target_name) jar',
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)',
472 '<(package_dir)/<(java_lib)',
473 '<(cronet_jar_stamp)',
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)',
484 'action_name': 'jar_src_<(_target_name)',
485 'inputs': ['cronet/tools/jar_src.py'] ,
486 'outputs': ['<(package_dir)/<(java_src_lib)'],
490 '--src-dir=cronet/android/java/src',
491 '--jar-path=<(package_dir)/<(java_src_lib)',
495 'action_name': 'jar_sample_src_<(_target_name)',
496 'inputs': ['cronet/tools/jar_src.py'] ,
497 'outputs': ['<(package_dir)/<(java_sample_src_lib)'],
501 '--src-dir=cronet/android/sample',
502 '--jar-path=<(package_dir)/<(java_sample_src_lib)',
506 'action_name': 'generate licenses',
507 'inputs': ['cronet/tools/cronet_licenses.py'] ,
508 'outputs': ['<(package_dir)/LICENSE'],
519 'destination': '<(package_dir)',
523 'cronet/android/proguard.cfg',
524 '<(lib_java_dir)/<(java_stub_lib)'
528 'destination': '<(package_dir)/symbols/<(android_app_abi)',
530 '<(SHARED_LIB_DIR)/<(native_lib)',
536 }], # OS=="android" and use_icu_alternatives_on_android==1