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_java',
26 'source_file': 'cronet/android/chromium_url_request.h',
28 'includes': [ '../build/android/java_cpp_enum.gypi' ],
31 'target_name': 'cronet_url_request_context_config_list',
34 'cronet/android/java/src/org/chromium/net/UrlRequestContextConfig.template',
37 'package_name': 'org/chromium/cronet',
38 'template_deps': ['cronet/url_request_context_config_list.h'],
40 'includes': [ '../build/android/java_cpp_template.gypi' ],
43 'target_name': 'cronet_version',
46 'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
47 'version_py_path': '<(DEPTH)/build/util/version.py',
48 'version_path': '<(DEPTH)/chrome/VERSION',
49 'template_input_path': 'cronet/android/java/src/org/chromium/net/Version.template',
50 'output_path': '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)/org/chromium/cronet/Version.java',
52 'direct_dependent_settings': {
54 # Ensure that the output directory is used in the class path
55 # when building targets that depend on this one.
56 'generated_src_dirs': [
57 '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)',
59 # Ensure dependents are rebuilt when the generated Java file changes.
60 'additional_input_paths': [
67 'action_name': 'cronet_version',
69 '<(template_input_path)',
79 '-f', '<(version_path)',
80 '-f', '<(lastchange_path)',
81 '<(template_input_path)',
84 'message': 'Generating version information',
89 'target_name': 'cronet_static',
90 'type': 'static_library',
92 '../base/base.gyp:base',
93 '../base/base.gyp:base_i18n',
94 '../third_party/icu/icu.gyp:icui18n',
95 '../third_party/icu/icu.gyp:icuuc',
97 'cronet_url_request_context_config_list',
98 'cronet_url_request_java',
100 '../net/net.gyp:net',
103 'cronet/url_request_context_config.cc',
104 'cronet/url_request_context_config.h',
105 'cronet/url_request_context_config_list.h',
106 'cronet/android/chromium_url_request.cc',
107 'cronet/android/chromium_url_request.h',
108 'cronet/android/chromium_url_request_error_list.h',
109 'cronet/android/chromium_url_request_priority_list.h',
110 'cronet/android/chromium_url_request_context.cc',
111 'cronet/android/chromium_url_request_context.h',
112 'cronet/android/cronet_loader.cc',
113 'cronet/android/cronet_loader.h',
114 'cronet/android/url_request_adapter.cc',
115 'cronet/android/url_request_adapter.h',
116 'cronet/android/url_request_context_adapter.cc',
117 'cronet/android/url_request_context_adapter.h',
118 'cronet/android/wrapped_channel_upload_element_reader.cc',
119 'cronet/android/wrapped_channel_upload_element_reader.h',
124 '-ffunction-sections',
126 '-fvisibility=hidden',
127 '-fvisibility-inlines-hidden',
129 '-Wno-missing-field-initializers',
135 '-Wl,--exclude-libs,ALL'
138 [ 'use_icu_alternatives_on_android == 1', {
140 '../base/base.gyp:base_i18n',
141 '../third_party/icu/icu.gyp:icui18n',
142 '../third_party/icu/icu.gyp:icuuc',
149 'target_name': 'libcronet',
150 'type': 'shared_library',
152 'cronet/android/cronet_jni.cc',
156 '../base/base.gyp:base',
157 '../net/net.gyp:net',
158 '../url/url.gyp:url_lib',
161 { # cronet_stub.jar defines HttpUrlRequest interface and provides its
162 # its implementation using HttpUrlConnection (not the Chromium stack).
163 'target_name': 'cronet_stub',
166 'cronet_url_request_context_config_list',
170 'java_in_dir': 'cronet/android/java',
172 '**/AsyncUrlRequest.java',
173 '**/AsyncUrlRequestException.java',
174 '**/AsyncUrlRequestFactory.java',
175 '**/AsyncUrlRequestListener.java',
176 '**/ResponseInfo.java',
177 '**/ChunkedWritableByteChannel.java',
178 '**/HttpUrlConnection*.java',
179 '**/HttpUrlRequest*.java',
180 '**/ResponseTooLargeException.java',
182 # TODO(mef): Consider moving this into HttpUrlRequestConfig.
183 '**/UrlRequestContextConfig.java',
187 'includes': [ '../build/java.gypi' ],
189 { # cronet.jar implements HttpUrlRequest interface using Chromium stack
190 # in native libcronet.so library.
191 'target_name': 'cronet',
194 '../base/base.gyp:base',
196 'cronet_url_request_java',
200 'java_in_dir': 'cronet/android/java',
202 '**/ChromiumAsyncUrlRequest.java',
203 '**/ChromiumUrlRequest.java',
204 '**/ChromiumUrlRequestContext.java',
205 '**/ChromiumUrlRequestError.java',
206 '**/ChromiumUrlRequestFactory.java',
207 '**/ChromiumUrlRequestPriority.java',
208 '**/UsedByReflection.java',
211 'includes': [ '../build/java.gypi' ],
214 'target_name': 'cronet_package',
222 'native_lib': 'libcronet.>(android_product_extension)',
223 'java_lib': 'cronet.jar',
224 'java_stub_lib': 'cronet_stub.jar',
225 'java_src_lib': 'cronet-src.jar',
226 'java_sample_src_lib': 'cronet-sample-src.jar',
227 'lib_java_dir': '<(PRODUCT_DIR)/lib.java',
228 'package_dir': '<(PRODUCT_DIR)/cronet',
229 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/cronet',
230 'jar_extract_dir': '<(intermediate_dir)/cronet_jar_extract',
231 'jar_excluded_classes': [
232 '*/library_loader/*',
234 'jar_extract_stamp': '<(intermediate_dir)/jar_extract.stamp',
235 'cronet_jar_stamp': '<(intermediate_dir)/cronet_jar.stamp',
239 'action_name': 'strip libcronet',
240 'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
241 'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
251 'action_name': 'extracting from jars',
253 '<(lib_java_dir)/<(java_lib)',
254 '<(lib_java_dir)/base_java.jar',
255 '<(lib_java_dir)/net_java.jar',
256 '<(lib_java_dir)/url_java.jar',
258 'outputs': ['<(jar_extract_stamp)', '<(jar_extract_dir)'],
261 'cronet/tools/extract_from_jars.py',
262 '--classes-dir=<(jar_extract_dir)',
263 '--jars=<@(_inputs)',
264 '--stamp=<(jar_extract_stamp)',
268 'action_name': 'jar_<(_target_name)',
269 'message': 'Creating <(_target_name) jar',
271 '<(DEPTH)/build/android/gyp/util/build_utils.py',
272 '<(DEPTH)/build/android/gyp/util/md5_check.py',
273 '<(DEPTH)/build/android/gyp/jar.py',
274 '<(jar_extract_stamp)',
277 '<(package_dir)/<(java_lib)',
278 '<(cronet_jar_stamp)',
281 'python', '<(DEPTH)/build/android/gyp/jar.py',
282 '--classes-dir=<(jar_extract_dir)',
283 '--jar-path=<(package_dir)/<(java_lib)',
284 '--excluded-classes=<@(jar_excluded_classes)',
285 '--stamp=<(cronet_jar_stamp)',
289 'action_name': 'jar_src_<(_target_name)',
290 'inputs': ['cronet/tools/jar_src.py'] ,
291 'outputs': ['<(package_dir)/<(java_src_lib)'],
295 '--src-dir=cronet/android/java/src',
296 '--jar-path=<(package_dir)/<(java_src_lib)',
300 'action_name': 'jar_sample_src_<(_target_name)',
301 'inputs': ['cronet/tools/jar_src.py'] ,
302 'outputs': ['<(package_dir)/<(java_sample_src_lib)'],
306 '--src-dir=cronet/android/sample',
307 '--jar-path=<(package_dir)/<(java_sample_src_lib)',
311 'action_name': 'generate licenses',
312 'inputs': ['cronet/tools/cronet_licenses.py'] ,
313 'outputs': ['<(package_dir)/LICENSE'],
324 'destination': '<(package_dir)',
328 'cronet/android/proguard.cfg',
329 '<(lib_java_dir)/<(java_stub_lib)'
333 'destination': '<(package_dir)/symbols/<(android_app_abi)',
335 '<(SHARED_LIB_DIR)/<(native_lib)',
341 'target_name': 'cronet_sample_apk',
348 'apk_name': 'CronetSample',
349 'java_in_dir': 'cronet/android/sample',
350 'resource_dir': 'cronet/android/sample/res',
351 'native_lib_target': 'libcronet',
352 'proguard_enabled': 'true',
353 'proguard_flags_paths': [
354 'cronet/android/proguard.cfg',
355 'cronet/android/sample/javatests/proguard.cfg',
358 'includes': [ '../build/java_apk.gypi' ],
361 # cronet_sample_apk creates a .jar as a side effect. Any java targets
362 # that need that .jar in their classpath should depend on this target,
363 # cronet_sample_apk_java. Dependents of cronet_sample_apk receive its
364 # jar path in the variable 'apk_output_jar_path'. This target should
365 # only be used by targets which instrument cronet_sample_apk.
366 'target_name': 'cronet_sample_apk_java',
371 'includes': [ '../build/apk_fake_jar.gypi' ],
374 'target_name': 'cronet_sample_test_apk',
378 'cronet_sample_apk_java',
380 '../base/base.gyp:base_java_test_support',
383 'apk_name': 'CronetSampleTest',
384 'java_in_dir': 'cronet/android/sample/javatests',
385 'resource_dir': 'cronet/android/sample/res',
388 'includes': [ '../build/java_apk.gypi' ],
391 'target_name': 'cronet_tests_jni_headers',
394 'cronet/android/test/src/org/chromium/cronet_test_apk/CronetTestUtil.java',
395 'cronet/android/test/src/org/chromium/cronet_test_apk/MockUrlRequestJobUtil.java',
396 'cronet/android/test/src/org/chromium/cronet_test_apk/UploadTestServer.java',
399 'jni_gen_package': 'cronet_tests',
401 'includes': [ '../build/jni_generator.gypi' ],
404 'target_name': 'libcronet_tests',
405 'type': 'shared_library',
407 'cronet/android/test/cronet_test_jni.cc',
408 'cronet/android/test/mock_url_request_job_util.cc',
409 'cronet/android/test/mock_url_request_job_util.h',
410 'cronet/android/test/upload_test_server.cc',
411 'cronet/android/test/upload_test_server.h',
412 '../net/base/directory_lister.cc',
413 '../net/base/directory_lister.h',
414 '../net/url_request/url_request_file_job.cc',
415 '../net/url_request/url_request_file_job.h',
419 'cronet_tests_jni_headers',
420 '../base/base.gyp:base',
421 '../net/net.gyp:net',
422 '../net/net.gyp:net_test_support',
423 '../net/net.gyp:quic_tools',
424 '../url/url.gyp:url_lib',
425 '../base/base.gyp:base_i18n',
426 '../third_party/icu/icu.gyp:icui18n',
427 '../third_party/icu/icu.gyp:icuuc',
431 'target_name': 'cronet_test_apk',
437 'apk_name': 'CronetTest',
438 'java_in_dir': 'cronet/android/test',
439 'resource_dir': 'cronet/android/test/res',
440 'asset_location': 'cronet/android/test/assets',
441 'native_lib_target': 'libcronet_tests',
443 'includes': [ '../build/java_apk.gypi' ],
446 # cronet_test_apk creates a .jar as a side effect. Any java targets
447 # that need that .jar in their classpath should depend on this target,
448 # cronet_test_apk_java. Dependents of cronet_test_apk receive its
449 # jar path in the variable 'apk_output_jar_path'. This target should
450 # only be used by targets which instrument cronet_test_apk.
451 'target_name': 'cronet_test_apk_java',
456 'includes': [ '../build/apk_fake_jar.gypi' ],
459 'target_name': 'cronet_test_instrumentation_apk',
462 'cronet_test_apk_java',
463 '../base/base.gyp:base_java_test_support',
466 'apk_name': 'CronetTestInstrumentation',
467 'java_in_dir': 'cronet/android/test/javatests',
468 'resource_dir': 'cronet/android/test/res',
471 'includes': [ '../build/java_apk.gypi' ],