Disable firewall check. It takes signifficant time, need to be on FILE thread.
[chromium-blink-merge.git] / components / cronet.gypi
blob4c608037e8ec71de26b34b01e12aec40086a1f6f
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.
6   'conditions': [
7     ['OS=="android"', {
8       # TODO(mef): Consider moving all Cronet Android targets into separate
9       # file. Also figure out what needs to be done for gn script.
10       'targets': [
11         {
12           'target_name': 'cronet_jni_headers',
13           'type': 'none',
14           'sources': [
15             'cronet/android/java/src/org/chromium/net/UrlRequest.java',
16             'cronet/android/java/src/org/chromium/net/UrlRequestContext.java',
17           ],
18           'variables': {
19             'jni_gen_package': 'cronet',
20             'jni_generator_ptr_type': 'long',
21           },
22           'includes': [ '../build/jni_generator.gypi' ],
23         },
24         {
25           'target_name': 'cronet_url_request_error_list',
26           'type': 'none',
27           'sources': [
28             'cronet/android/java/src/org/chromium/net/UrlRequestError.template',
29           ],
30           'variables': {
31             'package_name': 'org/chromium/cronet',
32             'template_deps': ['cronet/android/org_chromium_net_UrlRequest_error_list.h'],
33           },
34           'includes': [ '../build/android/java_cpp_template.gypi' ],
35         },
36         {
37           'target_name': 'cronet_url_request_priority_list',
38           'type': 'none',
39           'sources': [
40             'cronet/android/java/src/org/chromium/net/UrlRequestPriority.template',
41           ],
42           'variables': {
43             'package_name': 'org/chromium/cronet',
44             'template_deps': ['cronet/android/org_chromium_net_UrlRequest_priority_list.h'],
45           },
46           'includes': [ '../build/android/java_cpp_template.gypi' ],
47         },
48         {
49           'target_name': 'libcronet',
50           'type': 'shared_library',
51           'dependencies': [
52             '../base/base.gyp:base',
53             '../base/base.gyp:base_i18n',
54             '../third_party/icu/icu.gyp:icui18n',
55             '../third_party/icu/icu.gyp:icuuc',
56             '../url/url.gyp:url_lib',
57             'cronet_jni_headers',
58             'cronet_url_request_error_list',
59             'cronet_url_request_priority_list',
60             '../net/net.gyp:net',
61           ],
62           'sources': [
63             'cronet/android/cronet_jni.cc',
64             'cronet/android/org_chromium_net_UrlRequest.cc',
65             'cronet/android/org_chromium_net_UrlRequest.h',
66             'cronet/android/org_chromium_net_UrlRequest_error_list.h',
67             'cronet/android/org_chromium_net_UrlRequest_priority_list.h',
68             'cronet/android/org_chromium_net_UrlRequestContext.cc',
69             'cronet/android/org_chromium_net_UrlRequestContext.h',
70             'cronet/android/url_request_context_peer.cc',
71             'cronet/android/url_request_context_peer.h',
72             'cronet/android/url_request_peer.cc',
73             'cronet/android/url_request_peer.h',
74           ],
75           'cflags': [
76             # TODO(mef): Figure out a good way to get version from chrome_version_info_posix.h.
77             '-DCHROMIUM_VERSION=\\"TBD\\"',
78             '-DLOGGING=1',
79             '-fdata-sections',
80             '-ffunction-sections',
81             '-fno-rtti',
82             '-fvisibility=hidden',
83             '-fvisibility-inlines-hidden',
84             '-Wno-sign-promo',
85             '-Wno-missing-field-initializers',
86           ],
87           'ldflags': [
88             '-llog',
89             '-landroid',
90             '-Wl,--gc-sections',
91             '-Wl,--exclude-libs,ALL'
92           ]
93         },
94         {
95           'target_name': 'cronet',
96           'type': 'none',
97           'dependencies': [
98             '../base/base.gyp:base',
99             'libcronet',
100             'cronet_url_request_error_list',
101             'cronet_url_request_priority_list',
102           ],
103           'variables': {
104             'java_in_dir': 'cronet/android/java',
105           },
106           'includes': [ '../build/java.gypi' ],
107         },
108         {
109           'target_name': 'cronet_package',
110           'type': 'none',
111           'dependencies': [
112             'libcronet',
113             'cronet',
114           ],
115           'variables': {
116               'native_lib': 'libcronet.>(android_product_extension)',
117               'java_lib': 'cronet.jar',
118               'package_dir': '<(PRODUCT_DIR)/cronet',
119           },
120           'actions': [
121             {
122               'action_name': 'strip libcronet',
123               'inputs': ['<(SHARED_LIB_DIR)/<(native_lib)'],
124               'outputs': ['<(package_dir)/libs/<(android_app_abi)/<(native_lib)'],
125               'action': [
126                 '<(android_strip)',
127                 '--strip-unneeded',
128                 '<@(_inputs)',
129                 '-o',
130                 '<@(_outputs)',
131               ],
132             },
133           ],
134           'copies': [
135             {
136               'destination': '<(package_dir)',
137               'files': [
138                 '<(PRODUCT_DIR)/lib.java/<(java_lib)',
139               ],
140             },
141           ],
142         },
143         {
144           'target_name': 'cronet_sample_apk',
145           'type': 'none',
146           'dependencies': [
147             'cronet',
148           ],
149           'variables': {
150             'apk_name': 'CronetSample',
151             'java_in_dir': 'cronet/android/sample',
152             'resource_dir': 'cronet/android/sample/res',
153             'native_lib_target': 'libcronet',
154           },
155           'includes': [ '../build/java_apk.gypi' ],
156         },
157         {
158           # cronet_sample_apk creates a .jar as a side effect. Any java targets
159           # that need that .jar in their classpath should depend on this target,
160           # cronet_sample_apk_java. Dependents of cronet_sample_apk receive its
161           # jar path in the variable 'apk_output_jar_path'. This target should
162           # only be used by targets which instrument cronet_sample_apk.
163           'target_name': 'cronet_sample_apk_java',
164           'type': 'none',
165           'dependencies': [
166             'cronet_sample_apk',
167           ],
168           'includes': [ '../build/apk_fake_jar.gypi' ],
169         },
170         {
171           'target_name': 'cronet_sample_test_apk',
172           'type': 'none',
173           'dependencies': [
174             'cronet_sample_apk_java',
175             '../base/base.gyp:base_java',
176             '../base/base.gyp:base_javatests',
177             '../base/base.gyp:base_java_test_support',
178             # TODO(mef): Figure out why some tests are failing.
179             #'../net/net.gyp:net_javatests',
180             #'../net/net.gyp:net_java_test_support',
181           ],
182           'variables': {
183             'apk_name': 'CronetSampleTest',
184             'java_in_dir': 'cronet/android/sample/javatests',
185             'resource_dir': 'cronet/android/sample/res',
186             'is_test_apk': 1,
187           },
188           'includes': [ '../build/java_apk.gypi' ],
189         },
190       ],
191     }],  # OS=="android"
192   ],