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': 'libcronet',
95 'type': 'shared_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 '../url/url.gyp:url_lib',
102 'cronet_jni_headers',
103 'cronet_url_request_context_config_list',
104 'cronet_url_request_error_list',
105 'cronet_url_request_priority_list',
107 '../net/net.gyp:net',
110 'cronet/url_request_context_config.cc',
111 'cronet/url_request_context_config.h',
112 'cronet/url_request_context_config_list.h',
113 'cronet/android/chromium_url_request.cc',
114 'cronet/android/chromium_url_request.h',
115 'cronet/android/chromium_url_request_error_list.h',
116 'cronet/android/chromium_url_request_priority_list.h',
117 'cronet/android/chromium_url_request_context.cc',
118 'cronet/android/chromium_url_request_context.h',
119 'cronet/android/cronet_jni.cc',
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',
154 { # cronet_stub.jar defines HttpUrlRequest interface and provides its
155 # its implementation using HttpUrlConnection (not the Chromium stack).
156 'target_name': 'cronet_stub',
159 'cronet_url_request_context_config_list',
163 'java_in_dir': 'cronet/android/java',
165 '**/AsyncUrlRequest.java',
166 '**/AsyncUrlRequestException.java',
167 '**/AsyncUrlRequestFactory.java',
168 '**/AsyncUrlRequestListener.java',
169 '**/ResponseInfo.java',
170 '**/ChunkedWritableByteChannel.java',
171 '**/HttpUrlConnection*.java',
172 '**/HttpUrlRequest*.java',
173 '**/ResponseTooLargeException.java',
175 # TODO(mef): Consider moving this into HttpUrlRequestConfig.
176 '**/UrlRequestContextConfig.java',
180 'includes': [ '../build/java.gypi' ],
182 { # cronet.jar implements HttpUrlRequest interface using Chromium stack
183 # in native libcronet.so library.
184 'target_name': 'cronet',
187 '../base/base.gyp:base',
189 'cronet_url_request_error_list',
190 'cronet_url_request_priority_list',
194 'java_in_dir': 'cronet/android/java',
196 '**/ChromiumAsyncUrlRequest.java',
197 '**/ChromiumUrlRequest.java',
198 '**/ChromiumUrlRequestContext.java',
199 '**/ChromiumUrlRequestError.java',
200 '**/ChromiumUrlRequestFactory.java',
201 '**/ChromiumUrlRequestPriority.java',
202 '**/LibraryLoader.java',
203 '**/UsedByReflection.java',
206 'includes': [ '../build/java.gypi' ],
209 'target_name': 'cronet_package',
217 'native_lib': 'libcronet.>(android_product_extension)',
218 'java_lib': 'cronet.jar',
219 'java_stub_lib': 'cronet_stub.jar',
220 'java_src_lib': 'cronet-src.jar',
221 'java_sample_src_lib': 'cronet-sample-src.jar',
222 'lib_java_dir': '<(PRODUCT_DIR)/lib.java',
223 'package_dir': '<(PRODUCT_DIR)/cronet',
224 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/cronet',
225 'jar_extract_dir': '<(intermediate_dir)/cronet_jar_extract',
226 'jar_excluded_classes': [
227 '*/library_loader/*',
229 'jar_extract_stamp': '<(intermediate_dir)/jar_extract.stamp',
230 'cronet_jar_stamp': '<(intermediate_dir)/cronet_jar.stamp',
234 'action_name': 'strip libcronet',
235 'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
236 'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
246 'action_name': 'extracting from jars',
248 '<(lib_java_dir)/<(java_lib)',
249 '<(lib_java_dir)/base_java.jar',
250 '<(lib_java_dir)/net_java.jar',
251 '<(lib_java_dir)/url_java.jar',
253 'outputs': ['<(jar_extract_stamp)', '<(jar_extract_dir)'],
256 'cronet/tools/extract_from_jars.py',
257 '--classes-dir=<(jar_extract_dir)',
258 '--jars=<@(_inputs)',
259 '--stamp=<(jar_extract_stamp)',
263 'action_name': 'jar_<(_target_name)',
264 'message': 'Creating <(_target_name) jar',
266 '<(DEPTH)/build/android/gyp/util/build_utils.py',
267 '<(DEPTH)/build/android/gyp/util/md5_check.py',
268 '<(DEPTH)/build/android/gyp/jar.py',
269 '<(jar_extract_stamp)',
272 '<(package_dir)/<(java_lib)',
273 '<(cronet_jar_stamp)',
276 'python', '<(DEPTH)/build/android/gyp/jar.py',
277 '--classes-dir=<(jar_extract_dir)',
278 '--jar-path=<(package_dir)/<(java_lib)',
279 '--excluded-classes=<@(jar_excluded_classes)',
280 '--stamp=<(cronet_jar_stamp)',
284 'action_name': 'jar_src_<(_target_name)',
285 'inputs': ['cronet/tools/jar_src.py'] ,
286 'outputs': ['<(package_dir)/<(java_src_lib)'],
290 '--src-dir=cronet/android/java/src',
291 '--jar-path=<(package_dir)/<(java_src_lib)',
295 'action_name': 'jar_sample_src_<(_target_name)',
296 'inputs': ['cronet/tools/jar_src.py'] ,
297 'outputs': ['<(package_dir)/<(java_sample_src_lib)'],
301 '--src-dir=cronet/android/sample',
302 '--jar-path=<(package_dir)/<(java_sample_src_lib)',
306 'action_name': 'generate licenses',
307 'inputs': ['cronet/tools/cronet_licenses.py'] ,
308 'outputs': ['<(package_dir)/LICENSE'],
319 'destination': '<(package_dir)',
323 'cronet/android/proguard.cfg',
324 '<(lib_java_dir)/<(java_stub_lib)'
328 'destination': '<(package_dir)/symbols/<(android_app_abi)',
330 '<(SHARED_LIB_DIR)/<(native_lib)',
336 'target_name': 'cronet_sample_apk',
342 'apk_name': 'CronetSample',
343 'java_in_dir': 'cronet/android/sample',
344 'resource_dir': 'cronet/android/sample/res',
345 'native_lib_target': 'libcronet',
347 'includes': [ '../build/java_apk.gypi' ],
350 # cronet_sample_apk creates a .jar as a side effect. Any java targets
351 # that need that .jar in their classpath should depend on this target,
352 # cronet_sample_apk_java. Dependents of cronet_sample_apk receive its
353 # jar path in the variable 'apk_output_jar_path'. This target should
354 # only be used by targets which instrument cronet_sample_apk.
355 'target_name': 'cronet_sample_apk_java',
360 'includes': [ '../build/apk_fake_jar.gypi' ],
363 'target_name': 'cronet_sample_test_apk',
366 'cronet_sample_apk_java',
367 '../base/base.gyp:base_java',
368 '../base/base.gyp:base_javatests',
369 '../base/base.gyp:base_java_test_support',
370 # TODO(mef): Figure out why some tests are failing.
371 #'../net/net.gyp:net_javatests',
372 #'../net/net.gyp:net_java_test_support',
375 'apk_name': 'CronetSampleTest',
376 'java_in_dir': 'cronet/android/sample/javatests',
377 'resource_dir': 'cronet/android/sample/res',
380 'includes': [ '../build/java_apk.gypi' ],