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.
7 ['OS=="android" and use_icu_alternatives_on_android==1', {
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/ChromiumUrlRequest.java',
15 'cronet/android/java/src/org/chromium/net/ChromiumUrlRequestContext.java',
18 'jni_gen_package': 'cronet',
20 'includes': [ '../build/jni_generator.gypi' ],
23 'target_name': 'cronet_url_request_error_list',
26 'cronet/android/java/src/org/chromium/net/ChromiumUrlRequestError.template',
29 'package_name': 'org/chromium/cronet',
30 'template_deps': ['cronet/android/chromium_url_request_error_list.h'],
32 'includes': [ '../build/android/java_cpp_template.gypi' ],
35 'target_name': 'cronet_url_request_priority_list',
38 'cronet/android/java/src/org/chromium/net/ChromiumUrlRequestPriority.template',
41 'package_name': 'org/chromium/cronet',
42 'template_deps': ['cronet/android/chromium_url_request_priority_list.h'],
44 'includes': [ '../build/android/java_cpp_template.gypi' ],
47 'target_name': 'cronet_url_request_context_config_list',
50 'cronet/android/java/src/org/chromium/net/UrlRequestContextConfig.template',
53 'package_name': 'org/chromium/cronet',
54 'template_deps': ['cronet/url_request_context_config_list.h'],
56 'includes': [ '../build/android/java_cpp_template.gypi' ],
59 'target_name': 'cronet_version',
61 # Because cronet_version generates a header, we must set the
62 # hard_dependency flag.
66 'action_name': 'cronet_version',
68 'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
69 'version_py_path': '<(DEPTH)/build/util/version.py',
70 'version_path': '<(DEPTH)/chrome/VERSION',
71 'template_input_path': 'cronet/android/java/src/org/chromium/net/Version.template',
74 '<(template_input_path)',
79 '<(SHARED_INTERMEDIATE_DIR)/templates/org/chromium/cronet/Version.java',
84 '-f', '<(version_path)',
85 '-f', '<(lastchange_path)',
86 '<(template_input_path)',
89 'message': 'Generating version information',
94 'target_name': 'cronet_static',
95 'type': 'static_library',
97 '../base/base.gyp:base',
98 '../base/base.gyp:base_i18n',
99 '../third_party/icu/icu.gyp:icui18n',
100 '../third_party/icu/icu.gyp:icuuc',
101 'cronet_jni_headers',
102 'cronet_url_request_context_config_list',
103 'cronet_url_request_error_list',
104 'cronet_url_request_priority_list',
106 '../net/net.gyp:net',
109 'cronet/url_request_context_config.cc',
110 'cronet/url_request_context_config.h',
111 'cronet/url_request_context_config_list.h',
112 'cronet/android/chromium_url_request.cc',
113 'cronet/android/chromium_url_request.h',
114 'cronet/android/chromium_url_request_error_list.h',
115 'cronet/android/chromium_url_request_priority_list.h',
116 'cronet/android/chromium_url_request_context.cc',
117 'cronet/android/chromium_url_request_context.h',
118 'cronet/android/cronet_loader.cc',
119 'cronet/android/cronet_loader.h',
120 'cronet/android/url_request_adapter.cc',
121 'cronet/android/url_request_adapter.h',
122 'cronet/android/url_request_context_adapter.cc',
123 'cronet/android/url_request_context_adapter.h',
124 'cronet/android/wrapped_channel_upload_element_reader.cc',
125 'cronet/android/wrapped_channel_upload_element_reader.h',
130 '-ffunction-sections',
132 '-fvisibility=hidden',
133 '-fvisibility-inlines-hidden',
135 '-Wno-missing-field-initializers',
141 '-Wl,--exclude-libs,ALL'
144 [ 'use_icu_alternatives_on_android == 1', {
146 '../base/base.gyp:base_i18n',
147 '../third_party/icu/icu.gyp:icui18n',
148 '../third_party/icu/icu.gyp:icuuc',
155 'target_name': 'libcronet',
156 'type': 'shared_library',
158 'cronet/android/cronet_jni.cc',
162 '../base/base.gyp:base',
163 '../net/net.gyp:net',
164 '../url/url.gyp:url_lib',
167 { # cronet_stub.jar defines HttpUrlRequest interface and provides its
168 # its implementation using HttpUrlConnection (not the Chromium stack).
169 'target_name': 'cronet_stub',
172 'cronet_url_request_context_config_list',
176 'java_in_dir': 'cronet/android/java',
178 '**/AsyncUrlRequest.java',
179 '**/AsyncUrlRequestException.java',
180 '**/AsyncUrlRequestFactory.java',
181 '**/AsyncUrlRequestListener.java',
182 '**/ResponseInfo.java',
183 '**/ChunkedWritableByteChannel.java',
184 '**/HttpUrlConnection*.java',
185 '**/HttpUrlRequest*.java',
186 '**/ResponseTooLargeException.java',
188 # TODO(mef): Consider moving this into HttpUrlRequestConfig.
189 '**/UrlRequestContextConfig.java',
193 'includes': [ '../build/java.gypi' ],
195 { # cronet.jar implements HttpUrlRequest interface using Chromium stack
196 # in native libcronet.so library.
197 'target_name': 'cronet',
200 '../base/base.gyp:base',
202 'cronet_url_request_error_list',
203 'cronet_url_request_priority_list',
207 'java_in_dir': 'cronet/android/java',
209 '**/ChromiumAsyncUrlRequest.java',
210 '**/ChromiumUrlRequest.java',
211 '**/ChromiumUrlRequestContext.java',
212 '**/ChromiumUrlRequestError.java',
213 '**/ChromiumUrlRequestFactory.java',
214 '**/ChromiumUrlRequestPriority.java',
215 '**/UsedByReflection.java',
218 'includes': [ '../build/java.gypi' ],
221 'target_name': 'cronet_package',
229 'native_lib': 'libcronet.>(android_product_extension)',
230 'java_lib': 'cronet.jar',
231 'java_stub_lib': 'cronet_stub.jar',
232 'java_src_lib': 'cronet-src.jar',
233 'java_sample_src_lib': 'cronet-sample-src.jar',
234 'lib_java_dir': '<(PRODUCT_DIR)/lib.java',
235 'package_dir': '<(PRODUCT_DIR)/cronet',
236 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/cronet',
237 'jar_extract_dir': '<(intermediate_dir)/cronet_jar_extract',
238 'jar_excluded_classes': [
239 '*/library_loader/*',
241 'jar_extract_stamp': '<(intermediate_dir)/jar_extract.stamp',
242 'cronet_jar_stamp': '<(intermediate_dir)/cronet_jar.stamp',
246 'action_name': 'strip libcronet',
247 'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
248 'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
258 'action_name': 'extracting from jars',
260 '<(lib_java_dir)/<(java_lib)',
261 '<(lib_java_dir)/base_java.jar',
262 '<(lib_java_dir)/net_java.jar',
263 '<(lib_java_dir)/url_java.jar',
265 'outputs': ['<(jar_extract_stamp)', '<(jar_extract_dir)'],
268 'cronet/tools/extract_from_jars.py',
269 '--classes-dir=<(jar_extract_dir)',
270 '--jars=<@(_inputs)',
271 '--stamp=<(jar_extract_stamp)',
275 'action_name': 'jar_<(_target_name)',
276 'message': 'Creating <(_target_name) jar',
278 '<(DEPTH)/build/android/gyp/util/build_utils.py',
279 '<(DEPTH)/build/android/gyp/util/md5_check.py',
280 '<(DEPTH)/build/android/gyp/jar.py',
281 '<(jar_extract_stamp)',
284 '<(package_dir)/<(java_lib)',
285 '<(cronet_jar_stamp)',
288 'python', '<(DEPTH)/build/android/gyp/jar.py',
289 '--classes-dir=<(jar_extract_dir)',
290 '--jar-path=<(package_dir)/<(java_lib)',
291 '--excluded-classes=<@(jar_excluded_classes)',
292 '--stamp=<(cronet_jar_stamp)',
296 'action_name': 'jar_src_<(_target_name)',
297 'inputs': ['cronet/tools/jar_src.py'] ,
298 'outputs': ['<(package_dir)/<(java_src_lib)'],
302 '--src-dir=cronet/android/java/src',
303 '--jar-path=<(package_dir)/<(java_src_lib)',
307 'action_name': 'jar_sample_src_<(_target_name)',
308 'inputs': ['cronet/tools/jar_src.py'] ,
309 'outputs': ['<(package_dir)/<(java_sample_src_lib)'],
313 '--src-dir=cronet/android/sample',
314 '--jar-path=<(package_dir)/<(java_sample_src_lib)',
318 'action_name': 'generate licenses',
319 'inputs': ['cronet/tools/cronet_licenses.py'] ,
320 'outputs': ['<(package_dir)/LICENSE'],
331 'destination': '<(package_dir)',
335 'cronet/android/proguard.cfg',
336 '<(lib_java_dir)/<(java_stub_lib)'
340 'destination': '<(package_dir)/symbols/<(android_app_abi)',
342 '<(SHARED_LIB_DIR)/<(native_lib)',
348 'target_name': 'cronet_sample_apk',
355 'apk_name': 'CronetSample',
356 'java_in_dir': 'cronet/android/sample',
357 'resource_dir': 'cronet/android/sample/res',
358 'native_lib_target': 'libcronet',
359 'proguard_enabled': 'true',
360 'proguard_flags_paths': [
361 'cronet/android/proguard.cfg',
362 'cronet/android/sample/javatests/proguard.cfg',
365 'includes': [ '../build/java_apk.gypi' ],
368 # cronet_sample_apk creates a .jar as a side effect. Any java targets
369 # that need that .jar in their classpath should depend on this target,
370 # cronet_sample_apk_java. Dependents of cronet_sample_apk receive its
371 # jar path in the variable 'apk_output_jar_path'. This target should
372 # only be used by targets which instrument cronet_sample_apk.
373 'target_name': 'cronet_sample_apk_java',
378 'includes': [ '../build/apk_fake_jar.gypi' ],
381 'target_name': 'cronet_sample_test_apk',
385 'cronet_sample_apk_java',
387 '../base/base.gyp:base_java',
388 '../base/base.gyp:base_java_test_support',
391 'apk_name': 'CronetSampleTest',
392 'java_in_dir': 'cronet/android/sample/javatests',
393 'resource_dir': 'cronet/android/sample/res',
396 'includes': [ '../build/java_apk.gypi' ],
399 'target_name': 'cronet_tests_jni_headers',
402 'cronet/android/test/src/org/chromium/cronet_test_apk/CronetTestUtil.java',
403 'cronet/android/test/src/org/chromium/cronet_test_apk/MockUrlRequestJobUtil.java',
406 'jni_gen_package': 'cronet_tests',
408 'includes': [ '../build/jni_generator.gypi' ],
411 'target_name': 'libcronet_tests',
412 'type': 'shared_library',
414 'cronet/android/test/cronet_test_jni.cc',
415 'cronet/android/test/mock_url_request_job_util.cc',
416 'cronet/android/test/mock_url_request_job_util.h',
417 '../net/base/directory_lister.cc',
418 '../net/base/directory_lister.h',
419 '../net/url_request/url_request_file_job.cc',
420 '../net/url_request/url_request_file_job.h',
424 'cronet_tests_jni_headers',
425 '../base/base.gyp:base',
426 '../net/net.gyp:net',
427 '../net/net.gyp:net_test_support',
428 '../net/net.gyp:quic_tools',
429 '../url/url.gyp:url_lib',
430 '../base/base.gyp:base_i18n',
431 '../third_party/icu/icu.gyp:icui18n',
432 '../third_party/icu/icu.gyp:icuuc',
436 'target_name': 'cronet_test_apk',
442 'apk_name': 'CronetTest',
443 'java_in_dir': 'cronet/android/test',
444 'resource_dir': 'cronet/android/test/res',
445 'asset_location': 'cronet/android/test/assets',
446 'native_lib_target': 'libcronet_tests',
448 'includes': [ '../build/java_apk.gypi' ],
451 # cronet_test_apk creates a .jar as a side effect. Any java targets
452 # that need that .jar in their classpath should depend on this target,
453 # cronet_sample_apk_java. Dependents of cronet_test_apk receive its
454 # jar path in the variable 'apk_output_jar_path'. This target should
455 # only be used by targets which instrument cronet_test_apk.
456 'target_name': 'cronet_test_apk_java',
461 'includes': [ '../build/apk_fake_jar.gypi' ],
464 'target_name': 'cronet_test_instrumentation_apk',
467 'cronet_test_apk_java',
468 '../base/base.gyp:base_java',
469 '../base/base.gyp:base_javatests',
470 '../base/base.gyp:base_java_test_support',
473 'apk_name': 'CronetTestInstrumentation',
474 'java_in_dir': 'cronet/android/test/javatests',
475 'resource_dir': 'cronet/android/test/res',
478 'includes': [ '../build/java_apk.gypi' ],