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/CronetUrlRequest.java',
16 'cronet/android/java/src/org/chromium/net/CronetUrlRequestContext.java',
17 'cronet/android/java/src/org/chromium/net/ChromiumUrlRequest.java',
18 'cronet/android/java/src/org/chromium/net/ChromiumUrlRequestContext.java',
21 'jni_gen_package': 'cronet',
23 'includes': [ '../build/jni_generator.gypi' ],
26 'target_name': 'cronet_url_request_java',
29 'source_file': 'cronet/android/chromium_url_request.h',
31 'includes': [ '../build/android/java_cpp_enum.gypi' ],
34 'target_name': 'net_request_priority_java',
37 'source_file': '../net/base/request_priority.h',
39 'includes': [ '../build/android/java_cpp_enum.gypi' ],
42 'target_name': 'cronet_url_request_context_config_list',
45 'cronet/android/java/src/org/chromium/net/UrlRequestContextConfigList.template',
48 'package_name': 'org/chromium/cronet',
49 'template_deps': ['cronet/url_request_context_config_list.h'],
51 'includes': [ '../build/android/java_cpp_template.gypi' ],
54 'target_name': 'cronet_version',
57 'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
58 'version_py_path': '<(DEPTH)/build/util/version.py',
59 'version_path': '<(DEPTH)/chrome/VERSION',
60 'template_input_path': 'cronet/android/java/src/org/chromium/net/Version.template',
61 'output_path': '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)/org/chromium/cronet/Version.java',
63 'direct_dependent_settings': {
65 # Ensure that the output directory is used in the class path
66 # when building targets that depend on this one.
67 'generated_src_dirs': [
68 '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)',
70 # Ensure dependents are rebuilt when the generated Java file changes.
71 'additional_input_paths': [
78 'action_name': 'cronet_version',
80 '<(template_input_path)',
90 '-f', '<(version_path)',
91 '-f', '<(lastchange_path)',
92 '<(template_input_path)',
95 'message': 'Generating version information',
100 'target_name': 'cronet_static',
101 'type': 'static_library',
103 '../base/base.gyp:base',
104 '../base/base.gyp:base_i18n',
105 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
106 '../third_party/icu/icu.gyp:icui18n',
107 '../third_party/icu/icu.gyp:icuuc',
108 'cronet_jni_headers',
109 'cronet_url_request_context_config_list',
110 'cronet_url_request_java',
113 '../net/net.gyp:net',
116 'cronet/url_request_context_config.cc',
117 'cronet/url_request_context_config.h',
118 'cronet/url_request_context_config_list.h',
119 'cronet/android/chromium_url_request.cc',
120 'cronet/android/chromium_url_request.h',
121 'cronet/android/chromium_url_request_error_list.h',
122 'cronet/android/chromium_url_request_priority_list.h',
123 'cronet/android/chromium_url_request_context.cc',
124 'cronet/android/chromium_url_request_context.h',
125 'cronet/android/cronet_histogram_manager.cc',
126 'cronet/android/cronet_histogram_manager.h',
127 'cronet/android/cronet_loader.cc',
128 'cronet/android/cronet_loader.h',
129 'cronet/android/cronet_url_request.cc',
130 'cronet/android/cronet_url_request.h',
131 'cronet/android/cronet_url_request_adapter.cc',
132 'cronet/android/cronet_url_request_adapter.h',
133 'cronet/android/cronet_url_request_context.cc',
134 'cronet/android/cronet_url_request_context.h',
135 'cronet/android/cronet_url_request_context_adapter.cc',
136 'cronet/android/cronet_url_request_context_adapter.h',
137 'cronet/android/url_request_adapter.cc',
138 'cronet/android/url_request_adapter.h',
139 'cronet/android/url_request_context_adapter.cc',
140 'cronet/android/url_request_context_adapter.h',
141 'cronet/android/wrapped_channel_upload_element_reader.cc',
142 'cronet/android/wrapped_channel_upload_element_reader.h',
147 '-ffunction-sections',
149 '-fvisibility=hidden',
150 '-fvisibility-inlines-hidden',
152 '-Wno-missing-field-initializers',
158 '-Wl,--exclude-libs,ALL'
161 [ 'use_icu_alternatives_on_android == 1', {
163 '../base/base.gyp:base_i18n',
164 '../third_party/icu/icu.gyp:icui18n',
165 '../third_party/icu/icu.gyp:icuuc',
172 'target_name': 'libcronet',
173 'type': 'shared_library',
175 'cronet/android/cronet_jni.cc',
179 '../base/base.gyp:base',
180 '../net/net.gyp:net',
181 '../url/url.gyp:url_lib',
184 { # cronet_stub.jar defines HttpUrlRequest interface and provides its
185 # its implementation using HttpUrlConnection (not the Chromium stack).
186 'target_name': 'cronet_stub',
189 'cronet_url_request_context_config_list',
193 'java_in_dir': 'cronet/android/java',
195 '**/ChunkedWritableByteChannel.java',
196 '**/ExtendedResponseInfo.java',
197 '**/HistogramManager.java',
198 '**/HttpUrlConnection*.java',
199 '**/HttpUrlRequest*.java',
200 '**/ResponseInfo.java',
201 '**/ResponseTooLargeException.java',
202 '**/UrlRequest.java',
203 '**/UrlRequestContext.java',
204 '**/UrlRequestContextConfig.java',
205 '**/UrlRequestContextConfigList.java',
206 '**/UrlRequestException.java',
207 '**/UrlRequestListener.java',
212 'includes': [ '../build/java.gypi' ],
214 { # cronet.jar implements HttpUrlRequest interface using Chromium stack
215 # in native libcronet.so library.
216 'target_name': 'cronet',
219 '../base/base.gyp:base',
221 'cronet_url_request_java',
223 'net_request_priority_java',
226 'java_in_dir': 'cronet/android/java',
228 '**/ChromiumAsyncUrlRequest.java',
229 '**/ChromiumUrlRequest.java',
230 '**/ChromiumUrlRequestContext.java',
231 '**/ChromiumUrlRequestError.java',
232 '**/ChromiumUrlRequestFactory.java',
233 '**/ChromiumUrlRequestPriority.java',
234 '**/CronetHistogramManager.java',
235 '**/CronetResponseInfo.java',
236 '**/CronetUrlRequest.java',
237 '**/CronetUrlRequestContext.java',
238 '**/CronetUrlRequestFactory.java',
239 '**/RequestPriority.java',
240 '**/urlconnection/CronetInputStream.java',
241 '**/urlconnection/CronetHttpURLConnection.java',
242 '**/urlconnection/CronetHttpURLStreamHandler.java',
243 '**/urlconnection/CronetURLStreamHandlerFactory.java',
244 '**/urlconnection/MessageLoop.java',
247 'includes': [ '../build/java.gypi' ],
250 'target_name': 'cronet_sample_apk',
257 'apk_name': 'CronetSample',
258 'java_in_dir': 'cronet/android/sample',
259 'resource_dir': 'cronet/android/sample/res',
260 'native_lib_target': 'libcronet',
261 'proguard_enabled': 'true',
262 'proguard_flags_paths': [
263 'cronet/android/proguard.cfg',
264 'cronet/android/sample/javatests/proguard.cfg',
267 'includes': [ '../build/java_apk.gypi' ],
270 # cronet_sample_apk creates a .jar as a side effect. Any java targets
271 # that need that .jar in their classpath should depend on this target,
272 # cronet_sample_apk_java. Dependents of cronet_sample_apk receive its
273 # jar path in the variable 'apk_output_jar_path'. This target should
274 # only be used by targets which instrument cronet_sample_apk.
275 'target_name': 'cronet_sample_apk_java',
280 'includes': [ '../build/apk_fake_jar.gypi' ],
283 'target_name': 'cronet_sample_test_apk',
287 'cronet_sample_apk_java',
289 '../base/base.gyp:base_java_test_support',
292 'apk_name': 'CronetSampleTest',
293 'java_in_dir': 'cronet/android/sample/javatests',
294 'resource_dir': 'cronet/android/sample/res',
297 'includes': [ '../build/java_apk.gypi' ],
300 'target_name': 'cronet_tests_jni_headers',
303 'cronet/android/test/src/org/chromium/cronet_test_apk/CronetTestUtil.java',
304 'cronet/android/test/src/org/chromium/cronet_test_apk/MockUrlRequestJobFactory.java',
305 'cronet/android/test/src/org/chromium/cronet_test_apk/NativeTestServer.java',
306 'cronet/android/test/src/org/chromium/cronet_test_apk/NetworkChangeNotifierUtil.java',
309 'jni_gen_package': 'cronet_tests',
311 'includes': [ '../build/jni_generator.gypi' ],
314 'target_name': 'libcronet_tests',
315 'type': 'shared_library',
317 'cronet/android/test/cronet_test_jni.cc',
318 'cronet/android/test/mock_url_request_job_factory.cc',
319 'cronet/android/test/mock_url_request_job_factory.h',
320 'cronet/android/test/native_test_server.cc',
321 'cronet/android/test/native_test_server.h',
322 'cronet/android/test/network_change_notifier_util.cc',
323 'cronet/android/test/network_change_notifier_util.h',
327 'cronet_tests_jni_headers',
328 '../base/base.gyp:base',
329 '../net/net.gyp:net',
330 '../net/net.gyp:net_test_support',
331 '../net/net.gyp:quic_tools',
332 '../url/url.gyp:url_lib',
333 '../base/base.gyp:base_i18n',
334 '../third_party/icu/icu.gyp:icui18n',
335 '../third_party/icu/icu.gyp:icuuc',
338 ['use_icu_alternatives_on_android==1',
341 '../net/base/directory_lister.cc',
342 '../net/base/directory_lister.h',
343 '../net/url_request/url_request_file_job.cc',
344 '../net/url_request/url_request_file_job.h',
351 'target_name': 'cronet_test_apk',
357 'apk_name': 'CronetTest',
358 'java_in_dir': 'cronet/android/test',
359 'resource_dir': 'cronet/android/test/res',
360 'asset_location': 'cronet/android/test/assets',
361 'native_lib_target': 'libcronet_tests',
363 'includes': [ '../build/java_apk.gypi' ],
366 # cronet_test_apk creates a .jar as a side effect. Any java targets
367 # that need that .jar in their classpath should depend on this target,
368 # cronet_test_apk_java. Dependents of cronet_test_apk receive its
369 # jar path in the variable 'apk_output_jar_path'. This target should
370 # only be used by targets which instrument cronet_test_apk.
371 'target_name': 'cronet_test_apk_java',
376 'includes': [ '../build/apk_fake_jar.gypi' ],
379 'target_name': 'cronet_test_instrumentation_apk',
382 'cronet_test_apk_java',
383 '../base/base.gyp:base_java_test_support',
386 'apk_name': 'CronetTestInstrumentation',
387 'java_in_dir': 'cronet/android/test/javatests',
388 'resource_dir': 'cronet/android/test/res',
391 'includes': [ '../build/java_apk.gypi' ],
395 ['OS=="android" and use_icu_alternatives_on_android==1', {
398 'target_name': 'cronet_package',
406 'native_lib': 'libcronet.>(android_product_extension)',
407 'java_lib': 'cronet.jar',
408 'java_stub_lib': 'cronet_stub.jar',
409 'java_src_lib': 'cronet-src.jar',
410 'java_sample_src_lib': 'cronet-sample-src.jar',
411 'lib_java_dir': '<(PRODUCT_DIR)/lib.java',
412 'package_dir': '<(PRODUCT_DIR)/cronet',
413 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/cronet',
414 'jar_extract_dir': '<(intermediate_dir)/cronet_jar_extract',
415 'jar_excluded_classes': [
416 '*/library_loader/*',
418 'jar_extract_stamp': '<(intermediate_dir)/jar_extract.stamp',
419 'cronet_jar_stamp': '<(intermediate_dir)/cronet_jar.stamp',
423 'action_name': 'strip libcronet',
424 'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
425 'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
435 'action_name': 'extracting from jars',
437 '<(lib_java_dir)/<(java_lib)',
438 '<(lib_java_dir)/base_java.jar',
439 '<(lib_java_dir)/net_java.jar',
440 '<(lib_java_dir)/url_java.jar',
442 'outputs': ['<(jar_extract_stamp)', '<(jar_extract_dir)'],
445 'cronet/tools/extract_from_jars.py',
446 '--classes-dir=<(jar_extract_dir)',
447 '--jars=<@(_inputs)',
448 '--stamp=<(jar_extract_stamp)',
452 'action_name': 'jar_<(_target_name)',
453 'message': 'Creating <(_target_name) jar',
455 '<(DEPTH)/build/android/gyp/util/build_utils.py',
456 '<(DEPTH)/build/android/gyp/util/md5_check.py',
457 '<(DEPTH)/build/android/gyp/jar.py',
458 '<(jar_extract_stamp)',
461 '<(package_dir)/<(java_lib)',
462 '<(cronet_jar_stamp)',
465 'python', '<(DEPTH)/build/android/gyp/jar.py',
466 '--classes-dir=<(jar_extract_dir)',
467 '--jar-path=<(package_dir)/<(java_lib)',
468 '--excluded-classes=<@(jar_excluded_classes)',
469 '--stamp=<(cronet_jar_stamp)',
473 'action_name': 'jar_src_<(_target_name)',
474 'inputs': ['cronet/tools/jar_src.py'] ,
475 'outputs': ['<(package_dir)/<(java_src_lib)'],
479 '--src-dir=cronet/android/java/src',
480 '--jar-path=<(package_dir)/<(java_src_lib)',
484 'action_name': 'jar_sample_src_<(_target_name)',
485 'inputs': ['cronet/tools/jar_src.py'] ,
486 'outputs': ['<(package_dir)/<(java_sample_src_lib)'],
490 '--src-dir=cronet/android/sample',
491 '--jar-path=<(package_dir)/<(java_sample_src_lib)',
495 'action_name': 'generate licenses',
496 'inputs': ['cronet/tools/cronet_licenses.py'] ,
497 'outputs': ['<(package_dir)/LICENSE'],
508 'destination': '<(package_dir)',
512 'cronet/android/proguard.cfg',
513 '<(lib_java_dir)/<(java_stub_lib)'
517 'destination': '<(package_dir)/symbols/<(android_app_abi)',
519 '<(SHARED_LIB_DIR)/<(native_lib)',
525 }], # OS=="android" and use_icu_alternatives_on_android==1