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': 'libcronet',
48 'type': 'shared_library',
50 '../base/base.gyp:base',
51 '../base/base.gyp:base_i18n',
52 '../third_party/icu/icu.gyp:icui18n',
53 '../third_party/icu/icu.gyp:icuuc',
54 '../url/url.gyp:url_lib',
56 'cronet_url_request_error_list',
57 'cronet_url_request_priority_list',
61 'cronet/android/cronet_jni.cc',
62 'cronet/android/org_chromium_net_UrlRequest.cc',
63 'cronet/android/org_chromium_net_UrlRequest.h',
64 'cronet/android/org_chromium_net_UrlRequest_error_list.h',
65 'cronet/android/org_chromium_net_UrlRequest_priority_list.h',
66 'cronet/android/org_chromium_net_UrlRequestContext.cc',
67 'cronet/android/org_chromium_net_UrlRequestContext.h',
68 'cronet/android/url_request_context_peer.cc',
69 'cronet/android/url_request_context_peer.h',
70 'cronet/android/url_request_peer.cc',
71 'cronet/android/url_request_peer.h',
74 # TODO(mef): Figure out a good way to get version from chrome_version_info_posix.h.
75 '-DCHROMIUM_VERSION=\\"TBD\\"',
78 '-ffunction-sections',
80 '-fvisibility=hidden',
81 '-fvisibility-inlines-hidden',
83 '-Wno-missing-field-initializers',
89 '-Wl,--exclude-libs,ALL'
92 [ 'use_icu_alternatives_on_android == 1', {
94 '../base/base.gyp:base_i18n',
95 '../third_party/icu/icu.gyp:icui18n',
96 '../third_party/icu/icu.gyp:icuuc',
103 'target_name': 'cronet',
106 '../base/base.gyp:base',
108 'cronet_url_request_error_list',
109 'cronet_url_request_priority_list',
112 'java_in_dir': 'cronet/android/java',
114 'includes': [ '../build/java.gypi' ],
117 'target_name': 'cronet_package',
124 'native_lib': 'libcronet.>(android_product_extension)',
125 'java_lib': 'cronet.jar',
126 'package_dir': '<(PRODUCT_DIR)/cronet',
127 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/cronet',
128 'jar_extract_dir': '<(intermediate_dir)/cronet_jar_extract',
129 'jar_excluded_classes': [
130 '*/BaseChromiumApp*.class',
132 'jar_extract_stamp': '<(intermediate_dir)/jar_extract.stamp',
133 'cronet_jar_stamp': '<(intermediate_dir)/cronet_jar.stamp',
137 'action_name': 'strip libcronet',
138 'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
139 'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
149 'action_name': 'extracting from jars',
151 '<(PRODUCT_DIR)/lib.java/<(java_lib)',
152 '<(PRODUCT_DIR)/lib.java/base_java.jar',
153 '<(PRODUCT_DIR)/lib.java/net_java.jar',
154 '<(PRODUCT_DIR)/lib.java/url_java.jar',
156 'outputs': ['<(jar_extract_stamp)', '<(jar_extract_dir)'],
159 'cronet/tools/extract_from_jars.py',
160 '--classes-dir=<(jar_extract_dir)',
161 '--jars=<@(_inputs)',
162 '--stamp=<(jar_extract_stamp)',
166 'action_name': 'jar_<(_target_name)',
167 'message': 'Creating <(_target_name) jar',
169 '<(DEPTH)/build/android/gyp/util/build_utils.py',
170 '<(DEPTH)/build/android/gyp/util/md5_check.py',
171 '<(DEPTH)/build/android/gyp/jar.py',
172 '<(jar_extract_stamp)',
175 '<(package_dir)/<(java_lib)',
176 '<(cronet_jar_stamp)',
179 'python', '<(DEPTH)/build/android/gyp/jar.py',
180 '--classes-dir=<(jar_extract_dir)',
181 '--jar-path=<(package_dir)/<(java_lib)',
182 '--excluded-classes=<@(jar_excluded_classes)',
183 '--stamp=<(cronet_jar_stamp)',
187 'action_name': 'generate licenses',
188 'inputs': ['cronet/tools/cronet_licenses.py'] ,
189 'outputs': ['<(package_dir)/LICENSE'],
200 'destination': '<(package_dir)',
209 'target_name': 'cronet_sample_apk',
215 'apk_name': 'CronetSample',
216 'java_in_dir': 'cronet/android/sample',
217 'resource_dir': 'cronet/android/sample/res',
218 'native_lib_target': 'libcronet',
220 'includes': [ '../build/java_apk.gypi' ],
223 # cronet_sample_apk creates a .jar as a side effect. Any java targets
224 # that need that .jar in their classpath should depend on this target,
225 # cronet_sample_apk_java. Dependents of cronet_sample_apk receive its
226 # jar path in the variable 'apk_output_jar_path'. This target should
227 # only be used by targets which instrument cronet_sample_apk.
228 'target_name': 'cronet_sample_apk_java',
233 'includes': [ '../build/apk_fake_jar.gypi' ],
236 'target_name': 'cronet_sample_test_apk',
239 'cronet_sample_apk_java',
240 '../base/base.gyp:base_java',
241 '../base/base.gyp:base_javatests',
242 '../base/base.gyp:base_java_test_support',
243 # TODO(mef): Figure out why some tests are failing.
244 #'../net/net.gyp:net_javatests',
245 #'../net/net.gyp:net_java_test_support',
248 'apk_name': 'CronetSampleTest',
249 'java_in_dir': 'cronet/android/sample/javatests',
250 'resource_dir': 'cronet/android/sample/res',
253 'includes': [ '../build/java_apk.gypi' ],