| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/buildflag_header.gni") | 5 import("//build/buildflag_header.gni") |
| 6 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
| 7 import("//build/config/android/rules.gni") | 7 import("//build/config/android/rules.gni") |
| 8 import("//build/util/version.gni") | 8 import("//build/util/version.gni") |
| 9 import("//chrome/version.gni") | 9 import("//chrome/version.gni") |
| 10 import("//testing/test.gni") | 10 import("//testing/test.gni") |
| 11 import("//url/features.gni") |
| 11 | 12 |
| 12 assert(!is_component_build, "Cronet requires static library build.") | 13 assert(!is_component_build, "Cronet requires static library build.") |
| 13 | 14 |
| 14 declare_args() { | 15 declare_args() { |
| 15 cronet_enable_data_reduction_proxy_support = false | 16 cronet_enable_data_reduction_proxy_support = false |
| 16 } | 17 } |
| 17 | 18 |
| 19 buildflag_header("features") { |
| 20 header = "features.h" |
| 21 flags = [ "USE_PLATFORM_ICU_ALTERNATIVES=$use_platform_icu_alternatives" ] |
| 22 } |
| 23 |
| 18 generate_jni("cronet_jni_headers") { | 24 generate_jni("cronet_jni_headers") { |
| 19 sources = [ | 25 sources = [ |
| 20 "java/src/org/chromium/net/ChromiumUrlRequest.java", | 26 "java/src/org/chromium/net/ChromiumUrlRequest.java", |
| 21 "java/src/org/chromium/net/ChromiumUrlRequestContext.java", | 27 "java/src/org/chromium/net/ChromiumUrlRequestContext.java", |
| 22 "java/src/org/chromium/net/CronetBidirectionalStream.java", | 28 "java/src/org/chromium/net/CronetBidirectionalStream.java", |
| 23 "java/src/org/chromium/net/CronetLibraryLoader.java", | 29 "java/src/org/chromium/net/CronetLibraryLoader.java", |
| 24 "java/src/org/chromium/net/CronetUploadDataStream.java", | 30 "java/src/org/chromium/net/CronetUploadDataStream.java", |
| 25 "java/src/org/chromium/net/CronetUrlRequest.java", | 31 "java/src/org/chromium/net/CronetUrlRequest.java", |
| 26 "java/src/org/chromium/net/CronetUrlRequestContext.java", | 32 "java/src/org/chromium/net/CronetUrlRequestContext.java", |
| 27 ] | 33 ] |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 # defines: Extra defines. | 114 # defines: Extra defines. |
| 109 # deps: Extra dependencies. | 115 # deps: Extra dependencies. |
| 110 template("cronet_static_tmpl") { | 116 template("cronet_static_tmpl") { |
| 111 source_set(target_name) { | 117 source_set(target_name) { |
| 112 defines = [] | 118 defines = [] |
| 113 | 119 |
| 114 deps = [ | 120 deps = [ |
| 115 ":chromium_url_request_java", | 121 ":chromium_url_request_java", |
| 116 ":cronet_jni_headers", | 122 ":cronet_jni_headers", |
| 117 ":cronet_version_header", | 123 ":cronet_version_header", |
| 124 ":features", |
| 118 "//base", | 125 "//base", |
| 119 "//base:i18n", | 126 "//base:i18n", |
| 120 "//base/third_party/dynamic_annotations", | 127 "//base/third_party/dynamic_annotations", |
| 121 "//components/metrics", | 128 "//components/metrics", |
| 122 "//components/prefs", | 129 "//components/prefs", |
| 123 ] | 130 ] |
| 124 sources = [ | 131 sources = [ |
| 125 "//components/cronet/android/chromium_url_request.cc", | 132 "//components/cronet/android/chromium_url_request.cc", |
| 126 "//components/cronet/android/chromium_url_request.h", | 133 "//components/cronet/android/chromium_url_request.h", |
| 127 "//components/cronet/android/chromium_url_request_context.cc", | 134 "//components/cronet/android/chromium_url_request_context.cc", |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 if (defined(invoker.defines)) { | 186 if (defined(invoker.defines)) { |
| 180 defines += invoker.defines | 187 defines += invoker.defines |
| 181 } | 188 } |
| 182 | 189 |
| 183 if (defined(invoker.deps)) { | 190 if (defined(invoker.deps)) { |
| 184 deps += invoker.deps | 191 deps += invoker.deps |
| 185 } | 192 } |
| 186 } | 193 } |
| 187 } | 194 } |
| 188 | 195 |
| 189 # cronet_static_small target has reduced binary size through using | |
| 190 # ICU alternatives which requires file and ftp support be disabled. | |
| 191 cronet_static_tmpl("cronet_static_small") { | |
| 192 defines = [ | |
| 193 "USE_ICU_ALTERNATIVES_ON_ANDROID=1", | |
| 194 "DISABLE_FILE_SUPPORT=1", | |
| 195 "DISABLE_FTP_SUPPORT=1", | |
| 196 ] | |
| 197 | |
| 198 deps = [ | |
| 199 "//net:net_small", | |
| 200 "//url:url_lib_use_icu_alternatives_on_android", | |
| 201 ] | |
| 202 | |
| 203 if (cronet_enable_data_reduction_proxy_support) { | |
| 204 deps += [ | |
| 205 "//components/data_reduction_proxy/core/browser:browser_small", | |
| 206 "//components/data_reduction_proxy/core/common:common_small", | |
| 207 ] | |
| 208 } | |
| 209 } | |
| 210 | |
| 211 # cronet_static target depends on ICU and includes file and ftp support. | |
| 212 cronet_static_tmpl("cronet_static") { | 196 cronet_static_tmpl("cronet_static") { |
| 213 deps = [ | 197 deps = [ |
| 214 "//base:i18n", | |
| 215 "//net", | 198 "//net", |
| 216 "//url", | 199 "//url", |
| 217 ] | 200 ] |
| 218 | 201 |
| 219 if (cronet_enable_data_reduction_proxy_support) { | 202 if (cronet_enable_data_reduction_proxy_support) { |
| 220 deps += [ | 203 deps += [ |
| 221 "//components/data_reduction_proxy/core/browser", | 204 "//components/data_reduction_proxy/core/browser:browser_small", |
| 222 "//components/data_reduction_proxy/core/common", | 205 "//components/data_reduction_proxy/core/common", |
| 223 ] | 206 ] |
| 224 } | 207 } |
| 208 |
| 209 if (!use_platform_icu_alternatives) { |
| 210 deps += [ "//base:i18n" ] |
| 211 } |
| 225 } | 212 } |
| 226 | 213 |
| 227 shared_library("cronet") { | 214 shared_library("cronet") { |
| 228 sources = [ | 215 sources = [ |
| 229 "cronet_jni.cc", | 216 "cronet_jni.cc", |
| 230 ] | 217 ] |
| 231 deps = [ | 218 deps = [ |
| 232 ":cronet_static_small", | 219 ":cronet_static", |
| 233 "//base", | 220 "//base", |
| 234 "//net:net_small", | 221 "//net:net", |
| 235 ] | 222 ] |
| 236 ldflags = [ "-Wl,--version-script=" + | 223 ldflags = [ "-Wl,--version-script=" + |
| 237 rebase_path("//components/cronet/android/only_jni_exports.lst") ] | 224 rebase_path("//components/cronet/android/only_jni_exports.lst") ] |
| 238 | 225 |
| 239 # Avoid hide_native_jni_exports as it adds another version script, and the | 226 # Avoid hide_native_jni_exports as it adds another version script, and the |
| 240 # ARM64 linker throws an error for multiple version scripts with anonymous | 227 # ARM64 linker throws an error for multiple version scripts with anonymous |
| 241 # version tags. | 228 # version tags. |
| 242 configs -= [ "//build/config/android:hide_native_jni_exports" ] | 229 configs -= [ "//build/config/android:hide_native_jni_exports" ] |
| 243 } | 230 } |
| 244 | 231 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 | 445 |
| 459 ldflags = [ "-Wl,--version-script=" + | 446 ldflags = [ "-Wl,--version-script=" + |
| 460 rebase_path("//components/cronet/android/only_jni_exports.lst") ] | 447 rebase_path("//components/cronet/android/only_jni_exports.lst") ] |
| 461 | 448 |
| 462 # Avoid hide_native_jni_exports as it adds another version script, and the | 449 # Avoid hide_native_jni_exports as it adds another version script, and the |
| 463 # ARM64 linker throws an error for multiple version scripts with anonymous | 450 # ARM64 linker throws an error for multiple version scripts with anonymous |
| 464 # version tags. | 451 # version tags. |
| 465 configs -= [ "//build/config/android:hide_native_jni_exports" ] | 452 configs -= [ "//build/config/android:hide_native_jni_exports" ] |
| 466 | 453 |
| 467 if (cronet_enable_data_reduction_proxy_support) { | 454 if (cronet_enable_data_reduction_proxy_support) { |
| 468 deps += [ "//components/data_reduction_proxy/core/browser" ] | 455 deps += [ "//components/data_reduction_proxy/core/browser:browser_small" ] |
| 469 } | 456 } |
| 470 } | 457 } |
| 471 | 458 |
| 472 android_resources("cronet_test_apk_resources") { | 459 android_resources("cronet_test_apk_resources") { |
| 473 testonly = true | 460 testonly = true |
| 474 resource_dirs = [ "test/res" ] | 461 resource_dirs = [ "test/res" ] |
| 475 android_manifest = "test/AndroidManifest.xml" | 462 android_manifest = "test/AndroidManifest.xml" |
| 476 } | 463 } |
| 477 | 464 |
| 478 android_library("cronet_test_apk_java") { | 465 android_library("cronet_test_apk_java") { |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 ":cronet_package_copy_native_lib", | 870 ":cronet_package_copy_native_lib", |
| 884 ":cronet_package_copy_native_lib_unstripped", | 871 ":cronet_package_copy_native_lib_unstripped", |
| 885 ":generate_javadoc", | 872 ":generate_javadoc", |
| 886 ":generate_licenses", | 873 ":generate_licenses", |
| 887 ":jar_cronet_api_source", | 874 ":jar_cronet_api_source", |
| 888 ":jar_cronet_other_source", | 875 ":jar_cronet_other_source", |
| 889 ":jar_cronet_sample_source", | 876 ":jar_cronet_sample_source", |
| 890 ":repackage_extracted_jars", | 877 ":repackage_extracted_jars", |
| 891 ] | 878 ] |
| 892 } | 879 } |
| OLD | NEW |