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/UrlRequest.java',
15 'cronet/android/java/src/org/chromium/net/UrlRequestContext.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/UrlRequestError.template',
29 'package_name': 'org/chromium/cronet',
30 'template_deps': ['cronet/android/org_chromium_net_UrlRequest_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/UrlRequestPriority.template',
41 'package_name': 'org/chromium/cronet',
42 'template_deps': ['cronet/android/org_chromium_net_UrlRequest_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/cronet_jni.cc',
114 'cronet/android/org_chromium_net_UrlRequest.cc',
115 'cronet/android/org_chromium_net_UrlRequest.h',
116 'cronet/android/org_chromium_net_UrlRequest_error_list.h',
117 'cronet/android/org_chromium_net_UrlRequest_priority_list.h',
118 'cronet/android/org_chromium_net_UrlRequestContext.cc',
119 'cronet/android/org_chromium_net_UrlRequestContext.h',
120 'cronet/android/org_chromium_net_UrlRequestContext_config_list.h',
121 'cronet/android/url_request_adapter.cc',
122 'cronet/android/url_request_adapter.h',
123 'cronet/android/url_request_context_adapter.cc',
124 'cronet/android/url_request_context_adapter.h',
125 'cronet/android/wrapped_channel_upload_element_reader.cc',
126 'cronet/android/wrapped_channel_upload_element_reader.h',
131 '-ffunction-sections',
133 '-fvisibility=hidden',
134 '-fvisibility-inlines-hidden',
136 '-Wno-missing-field-initializers',
142 '-Wl,--exclude-libs,ALL'
145 [ 'use_icu_alternatives_on_android == 1', {
147 '../base/base.gyp:base_i18n',
148 '../third_party/icu/icu.gyp:icui18n',
149 '../third_party/icu/icu.gyp:icuuc',
156 'target_name': 'cronet',
159 '../base/base.gyp:base',
161 'cronet_url_request_error_list',
162 'cronet_url_request_priority_list',
165 'java_in_dir': 'cronet/android/java',
167 'includes': [ '../build/java.gypi' ],
170 'target_name': 'cronet_package',
177 'native_lib': 'libcronet.>(android_product_extension)',
178 'java_lib': 'cronet.jar',
179 'java_src_lib': 'cronet-src.jar',
180 'java_sample_src_lib': 'cronet-sample-src.jar',
181 'package_dir': '<(PRODUCT_DIR)/cronet',
182 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/cronet',
183 'jar_extract_dir': '<(intermediate_dir)/cronet_jar_extract',
184 'jar_excluded_classes': [
185 '*/library_loader/*',
187 'jar_extract_stamp': '<(intermediate_dir)/jar_extract.stamp',
188 'cronet_jar_stamp': '<(intermediate_dir)/cronet_jar.stamp',
192 'action_name': 'strip libcronet',
193 'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
194 'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
204 'action_name': 'extracting from jars',
206 '<(PRODUCT_DIR)/lib.java/<(java_lib)',
207 '<(PRODUCT_DIR)/lib.java/base_java.jar',
208 '<(PRODUCT_DIR)/lib.java/net_java.jar',
209 '<(PRODUCT_DIR)/lib.java/url_java.jar',
211 'outputs': ['<(jar_extract_stamp)', '<(jar_extract_dir)'],
214 'cronet/tools/extract_from_jars.py',
215 '--classes-dir=<(jar_extract_dir)',
216 '--jars=<@(_inputs)',
217 '--stamp=<(jar_extract_stamp)',
221 'action_name': 'jar_<(_target_name)',
222 'message': 'Creating <(_target_name) jar',
224 '<(DEPTH)/build/android/gyp/util/build_utils.py',
225 '<(DEPTH)/build/android/gyp/util/md5_check.py',
226 '<(DEPTH)/build/android/gyp/jar.py',
227 '<(jar_extract_stamp)',
230 '<(package_dir)/<(java_lib)',
231 '<(cronet_jar_stamp)',
234 'python', '<(DEPTH)/build/android/gyp/jar.py',
235 '--classes-dir=<(jar_extract_dir)',
236 '--jar-path=<(package_dir)/<(java_lib)',
237 '--excluded-classes=<@(jar_excluded_classes)',
238 '--stamp=<(cronet_jar_stamp)',
242 'action_name': 'jar_src_<(_target_name)',
243 'inputs': ['cronet/tools/jar_src.py'] ,
244 'outputs': ['<(package_dir)/<(java_src_lib)'],
248 '--src-dir=cronet/android/java/src',
249 '--jar-path=<(package_dir)/<(java_src_lib)',
253 'action_name': 'jar_sample_src_<(_target_name)',
254 'inputs': ['cronet/tools/jar_src.py'] ,
255 'outputs': ['<(package_dir)/<(java_sample_src_lib)'],
259 '--src-dir=cronet/android/sample',
260 '--jar-path=<(package_dir)/<(java_sample_src_lib)',
264 'action_name': 'generate licenses',
265 'inputs': ['cronet/tools/cronet_licenses.py'] ,
266 'outputs': ['<(package_dir)/LICENSE'],
277 'destination': '<(package_dir)',
281 'cronet/android/proguard.cfg',
287 'target_name': 'cronet_sample_apk',
293 'apk_name': 'CronetSample',
294 'java_in_dir': 'cronet/android/sample',
295 'resource_dir': 'cronet/android/sample/res',
296 'native_lib_target': 'libcronet',
298 'includes': [ '../build/java_apk.gypi' ],
301 # cronet_sample_apk creates a .jar as a side effect. Any java targets
302 # that need that .jar in their classpath should depend on this target,
303 # cronet_sample_apk_java. Dependents of cronet_sample_apk receive its
304 # jar path in the variable 'apk_output_jar_path'. This target should
305 # only be used by targets which instrument cronet_sample_apk.
306 'target_name': 'cronet_sample_apk_java',
311 'includes': [ '../build/apk_fake_jar.gypi' ],
314 'target_name': 'cronet_sample_test_apk',
317 'cronet_sample_apk_java',
318 '../base/base.gyp:base_java',
319 '../base/base.gyp:base_javatests',
320 '../base/base.gyp:base_java_test_support',
321 # TODO(mef): Figure out why some tests are failing.
322 #'../net/net.gyp:net_javatests',
323 #'../net/net.gyp:net_java_test_support',
326 'apk_name': 'CronetSampleTest',
327 'java_in_dir': 'cronet/android/sample/javatests',
328 'resource_dir': 'cronet/android/sample/res',
331 'includes': [ '../build/java_apk.gypi' ],