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 '**/ChunkedWritableByteChannel.java',
166 '**/HttpUrlConnection*.java',
167 '**/HttpUrlRequest*.java',
168 '**/ResponseTooLargeException.java',
170 # TODO(mef): Consider moving this into HttpUrlRequestConfig.
171 '**/UrlRequestContextConfig.java',
175 'includes': [ '../build/java.gypi' ],
177 { # cronet.jar implements HttpUrlRequest interface using Chromium stack
178 # in native libcronet.so library.
179 'target_name': 'cronet',
182 '../base/base.gyp:base',
184 'cronet_url_request_error_list',
185 'cronet_url_request_priority_list',
189 'java_in_dir': 'cronet/android/java',
191 '**/ChromiumUrlRequest.java',
192 '**/ChromiumUrlRequestContext.java',
193 '**/ChromiumUrlRequestError.java',
194 '**/ChromiumUrlRequestFactory.java',
195 '**/ChromiumUrlRequestPriority.java',
196 '**/LibraryLoader.java',
197 '**/UsedByReflection.java',
200 'includes': [ '../build/java.gypi' ],
203 'target_name': 'cronet_package',
211 'native_lib': 'libcronet.>(android_product_extension)',
212 'java_lib': 'cronet.jar',
213 'java_stub_lib': 'cronet_stub.jar',
214 'java_src_lib': 'cronet-src.jar',
215 'java_sample_src_lib': 'cronet-sample-src.jar',
216 'lib_java_dir': '<(PRODUCT_DIR)/lib.java',
217 'package_dir': '<(PRODUCT_DIR)/cronet',
218 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/cronet',
219 'jar_extract_dir': '<(intermediate_dir)/cronet_jar_extract',
220 'jar_excluded_classes': [
221 '*/library_loader/*',
223 'jar_extract_stamp': '<(intermediate_dir)/jar_extract.stamp',
224 'cronet_jar_stamp': '<(intermediate_dir)/cronet_jar.stamp',
228 'action_name': 'strip libcronet',
229 'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
230 'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
240 'action_name': 'extracting from jars',
242 '<(lib_java_dir)/<(java_lib)',
243 '<(lib_java_dir)/base_java.jar',
244 '<(lib_java_dir)/net_java.jar',
245 '<(lib_java_dir)/url_java.jar',
247 'outputs': ['<(jar_extract_stamp)', '<(jar_extract_dir)'],
250 'cronet/tools/extract_from_jars.py',
251 '--classes-dir=<(jar_extract_dir)',
252 '--jars=<@(_inputs)',
253 '--stamp=<(jar_extract_stamp)',
257 'action_name': 'jar_<(_target_name)',
258 'message': 'Creating <(_target_name) jar',
260 '<(DEPTH)/build/android/gyp/util/build_utils.py',
261 '<(DEPTH)/build/android/gyp/util/md5_check.py',
262 '<(DEPTH)/build/android/gyp/jar.py',
263 '<(jar_extract_stamp)',
266 '<(package_dir)/<(java_lib)',
267 '<(cronet_jar_stamp)',
270 'python', '<(DEPTH)/build/android/gyp/jar.py',
271 '--classes-dir=<(jar_extract_dir)',
272 '--jar-path=<(package_dir)/<(java_lib)',
273 '--excluded-classes=<@(jar_excluded_classes)',
274 '--stamp=<(cronet_jar_stamp)',
278 'action_name': 'jar_src_<(_target_name)',
279 'inputs': ['cronet/tools/jar_src.py'] ,
280 'outputs': ['<(package_dir)/<(java_src_lib)'],
284 '--src-dir=cronet/android/java/src',
285 '--jar-path=<(package_dir)/<(java_src_lib)',
289 'action_name': 'jar_sample_src_<(_target_name)',
290 'inputs': ['cronet/tools/jar_src.py'] ,
291 'outputs': ['<(package_dir)/<(java_sample_src_lib)'],
295 '--src-dir=cronet/android/sample',
296 '--jar-path=<(package_dir)/<(java_sample_src_lib)',
300 'action_name': 'generate licenses',
301 'inputs': ['cronet/tools/cronet_licenses.py'] ,
302 'outputs': ['<(package_dir)/LICENSE'],
313 'destination': '<(package_dir)',
317 'cronet/android/proguard.cfg',
318 '<(lib_java_dir)/<(java_stub_lib)'
322 'destination': '<(package_dir)/symbols/<(android_app_abi)',
324 '<(SHARED_LIB_DIR)/<(native_lib)',
330 'target_name': 'cronet_sample_apk',
336 'apk_name': 'CronetSample',
337 'java_in_dir': 'cronet/android/sample',
338 'resource_dir': 'cronet/android/sample/res',
339 'native_lib_target': 'libcronet',
341 'includes': [ '../build/java_apk.gypi' ],
344 # cronet_sample_apk creates a .jar as a side effect. Any java targets
345 # that need that .jar in their classpath should depend on this target,
346 # cronet_sample_apk_java. Dependents of cronet_sample_apk receive its
347 # jar path in the variable 'apk_output_jar_path'. This target should
348 # only be used by targets which instrument cronet_sample_apk.
349 'target_name': 'cronet_sample_apk_java',
354 'includes': [ '../build/apk_fake_jar.gypi' ],
357 'target_name': 'cronet_sample_test_apk',
360 'cronet_sample_apk_java',
361 '../base/base.gyp:base_java',
362 '../base/base.gyp:base_javatests',
363 '../base/base.gyp:base_java_test_support',
364 # TODO(mef): Figure out why some tests are failing.
365 #'../net/net.gyp:net_javatests',
366 #'../net/net.gyp:net_java_test_support',
369 'apk_name': 'CronetSampleTest',
370 'java_in_dir': 'cronet/android/sample/javatests',
371 'resource_dir': 'cronet/android/sample/res',
374 'includes': [ '../build/java_apk.gypi' ],