mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-24 22:36:09 +03:00
1527 lines
47 KiB
Plaintext
1527 lines
47 KiB
Plaintext
|
# Copyright 2015 The Chromium Authors. All rights reserved.
|
||
|
# Use of this source code is governed by a BSD-style license that can be
|
||
|
# found in the LICENSE file.
|
||
|
|
||
|
import("//base/android/jni_generator/jni_exception_list.gni")
|
||
|
import("//build/buildflag_header.gni")
|
||
|
import("//build/config/android/config.gni")
|
||
|
import("//build/config/android/rules.gni")
|
||
|
import("//build/util/process_version.gni")
|
||
|
import("//build/util/version.gni")
|
||
|
import("//testing/test.gni")
|
||
|
import("//third_party/netty4/netty4.gni")
|
||
|
import("//third_party/protobuf/proto_library.gni")
|
||
|
import("//url/features.gni")
|
||
|
|
||
|
assert(!is_component_build, "Cronet requires static library build.")
|
||
|
|
||
|
generate_jni("cronet_jni_headers") {
|
||
|
sources = [
|
||
|
"java/src/org/chromium/net/impl/CronetBidirectionalStream.java",
|
||
|
"java/src/org/chromium/net/impl/CronetLibraryLoader.java",
|
||
|
"java/src/org/chromium/net/impl/CronetUploadDataStream.java",
|
||
|
"java/src/org/chromium/net/impl/CronetUrlRequest.java",
|
||
|
"java/src/org/chromium/net/impl/CronetUrlRequestContext.java",
|
||
|
]
|
||
|
jni_package = "cronet"
|
||
|
}
|
||
|
|
||
|
generate_jni_registration("cronet_jni_registration") {
|
||
|
target = ":cronet_sample_apk"
|
||
|
output = "$root_gen_dir/components/cronet/android/${target_name}.h"
|
||
|
exception_files = jni_exception_files
|
||
|
}
|
||
|
|
||
|
java_cpp_enum("effective_connection_type_java") {
|
||
|
sources = [
|
||
|
"//net/nqe/effective_connection_type.h",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
java_cpp_enum("rtt_throughput_values_java") {
|
||
|
sources = [
|
||
|
"//net/nqe/network_quality.h",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
java_cpp_enum("net_request_priority_java") {
|
||
|
sources = [
|
||
|
"//net/base/request_priority.h",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
java_cpp_enum("network_quality_observation_source_java") {
|
||
|
sources = [
|
||
|
"//net/nqe/network_quality_observation_source.h",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
java_cpp_enum("url_request_error_java") {
|
||
|
sources = [
|
||
|
"url_request_error.h",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
java_cpp_enum("http_cache_type_java") {
|
||
|
sources = [
|
||
|
"//components/cronet/url_request_context_config.h",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
java_cpp_template("load_states_list") {
|
||
|
sources = [
|
||
|
"java/src/org/chromium/net/impl/LoadState.template",
|
||
|
]
|
||
|
inputs = [
|
||
|
"//net/base/load_states_list.h",
|
||
|
]
|
||
|
package_path = "org/chromium/net/impl"
|
||
|
}
|
||
|
|
||
|
_generated_api_version_java_dir =
|
||
|
"$target_gen_dir/templates/cronet_api_version_java"
|
||
|
_generated_api_version_java =
|
||
|
"$_generated_api_version_java_dir/org/chromium/net/ApiVersion.java"
|
||
|
|
||
|
process_version("cronet_api_version_java") {
|
||
|
_api_level = read_file("api_version.txt", "value")
|
||
|
template_file = "api/src/org/chromium/net/ApiVersion.template"
|
||
|
sources = [
|
||
|
"//build/util/LASTCHANGE",
|
||
|
"//chrome/VERSION",
|
||
|
]
|
||
|
extra_args = [
|
||
|
"-e",
|
||
|
"API_LEVEL=$_api_level",
|
||
|
]
|
||
|
output = _generated_api_version_java
|
||
|
}
|
||
|
|
||
|
zip("cronet_api_version_srcjar") {
|
||
|
inputs = [
|
||
|
_generated_api_version_java,
|
||
|
]
|
||
|
output = "$target_gen_dir/$target_name.srcjar"
|
||
|
base_dir = _generated_api_version_java_dir
|
||
|
deps = [
|
||
|
":cronet_api_version_java",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
_generated_impl_version_java_dir =
|
||
|
"$target_gen_dir/templates/cronet_impl_version_java"
|
||
|
_generated_impl_version_java =
|
||
|
"$_generated_impl_version_java_dir/org/chromium/net/impl/ImplVersion.java"
|
||
|
|
||
|
process_version("cronet_impl_version_java") {
|
||
|
_api_level = read_file("api_version.txt", "value")
|
||
|
template_file = "java/src/org/chromium/net/impl/ImplVersion.template"
|
||
|
sources = [
|
||
|
"//build/util/LASTCHANGE",
|
||
|
"//chrome/VERSION",
|
||
|
]
|
||
|
extra_args = [
|
||
|
"-e",
|
||
|
"API_LEVEL=$_api_level",
|
||
|
]
|
||
|
output = _generated_impl_version_java
|
||
|
}
|
||
|
|
||
|
zip("cronet_impl_version_srcjar") {
|
||
|
inputs = [
|
||
|
_generated_impl_version_java,
|
||
|
]
|
||
|
output = "$target_gen_dir/$target_name.srcjar"
|
||
|
base_dir = _generated_impl_version_java_dir
|
||
|
deps = [
|
||
|
":cronet_impl_version_java",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
_cronet_version_header_include_dir = "$target_gen_dir/cronet_version_header"
|
||
|
process_version("cronet_version_header") {
|
||
|
template_file = "//components/cronet/version.h.in"
|
||
|
output = "$_cronet_version_header_include_dir/components/cronet/version.h"
|
||
|
extra_args = [
|
||
|
"-e",
|
||
|
"VERSION_FULL=\"$chrome_version_full\"",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
proto_library("cronet_android_cert_proto") {
|
||
|
visibility = [ "//components/cronet/android/*" ]
|
||
|
|
||
|
sources = [
|
||
|
"//components/cronet/android/cert/proto/cert_verification.proto",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
"//third_party/protobuf:protobuf_lite",
|
||
|
]
|
||
|
|
||
|
extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
|
||
|
}
|
||
|
|
||
|
source_set("cronet_static") {
|
||
|
deps = [
|
||
|
":cronet_android_cert_proto",
|
||
|
":cronet_jni_headers",
|
||
|
":cronet_jni_registration",
|
||
|
":cronet_version_header",
|
||
|
"//base",
|
||
|
"//base/third_party/dynamic_annotations",
|
||
|
"//components/metrics",
|
||
|
"//components/prefs",
|
||
|
"//net",
|
||
|
"//url",
|
||
|
"//url:url_features",
|
||
|
]
|
||
|
sources = [
|
||
|
"//components/cronet/android/cert/cert_verifier_cache_serializer.cc",
|
||
|
"//components/cronet/android/cert/cert_verifier_cache_serializer.h",
|
||
|
"//components/cronet/android/cronet_bidirectional_stream_adapter.cc",
|
||
|
"//components/cronet/android/cronet_bidirectional_stream_adapter.h",
|
||
|
"//components/cronet/android/cronet_library_loader.cc",
|
||
|
"//components/cronet/android/cronet_library_loader.h",
|
||
|
"//components/cronet/android/cronet_upload_data_stream.cc",
|
||
|
"//components/cronet/android/cronet_upload_data_stream.h",
|
||
|
"//components/cronet/android/cronet_upload_data_stream_adapter.cc",
|
||
|
"//components/cronet/android/cronet_upload_data_stream_adapter.h",
|
||
|
"//components/cronet/android/cronet_url_request_adapter.cc",
|
||
|
"//components/cronet/android/cronet_url_request_adapter.h",
|
||
|
"//components/cronet/android/cronet_url_request_context_adapter.cc",
|
||
|
"//components/cronet/android/cronet_url_request_context_adapter.h",
|
||
|
"//components/cronet/android/io_buffer_with_byte_buffer.cc",
|
||
|
"//components/cronet/android/io_buffer_with_byte_buffer.h",
|
||
|
"//components/cronet/android/metrics_util.cc",
|
||
|
"//components/cronet/android/metrics_util.h",
|
||
|
"//components/cronet/android/url_request_error.cc",
|
||
|
"//components/cronet/android/url_request_error.h",
|
||
|
"//components/cronet/cronet_prefs_manager.cc",
|
||
|
"//components/cronet/cronet_prefs_manager.h",
|
||
|
"//components/cronet/histogram_manager.cc",
|
||
|
"//components/cronet/histogram_manager.h",
|
||
|
"//components/cronet/host_cache_persistence_manager.cc",
|
||
|
"//components/cronet/host_cache_persistence_manager.h",
|
||
|
"//components/cronet/stale_host_resolver.cc",
|
||
|
"//components/cronet/stale_host_resolver.h",
|
||
|
"//components/cronet/url_request_context_config.cc",
|
||
|
"//components/cronet/url_request_context_config.h",
|
||
|
]
|
||
|
|
||
|
include_dirs = [ _cronet_version_header_include_dir ]
|
||
|
|
||
|
cflags = [
|
||
|
"-DLOGGING=1",
|
||
|
"-Wno-sign-promo",
|
||
|
]
|
||
|
|
||
|
libs = [
|
||
|
"android",
|
||
|
"log",
|
||
|
]
|
||
|
|
||
|
if (!use_platform_icu_alternatives) {
|
||
|
deps += [ "//base:i18n" ]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
_cronet_shared_lib_name = "cronet.$chrome_version_full"
|
||
|
_cronet_shared_lib_file_name = "lib" + _cronet_shared_lib_name + ".so"
|
||
|
|
||
|
shared_library("cronet") {
|
||
|
output_name = _cronet_shared_lib_name
|
||
|
sources = [
|
||
|
"cronet_jni.cc",
|
||
|
]
|
||
|
deps = [
|
||
|
":cronet_static",
|
||
|
"//base",
|
||
|
"//net:net",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
cronet_api_srcjar_deps = [ ":cronet_api_version_srcjar" ]
|
||
|
|
||
|
# cronet_api_java.jar defines Cronet API.
|
||
|
android_library("cronet_api_java") {
|
||
|
output_name = "cronet_api"
|
||
|
java_files = [
|
||
|
"api/src/org/chromium/net/BidirectionalStream.java",
|
||
|
"api/src/org/chromium/net/CronetEngine.java",
|
||
|
"api/src/org/chromium/net/CallbackException.java",
|
||
|
"api/src/org/chromium/net/CronetException.java",
|
||
|
"api/src/org/chromium/net/CronetProvider.java",
|
||
|
"api/src/org/chromium/net/ExperimentalBidirectionalStream.java",
|
||
|
"api/src/org/chromium/net/ExperimentalCronetEngine.java",
|
||
|
"api/src/org/chromium/net/ExperimentalUrlRequest.java",
|
||
|
"api/src/org/chromium/net/ICronetEngineBuilder.java",
|
||
|
"api/src/org/chromium/net/InlineExecutionProhibitedException.java",
|
||
|
"api/src/org/chromium/net/NetworkException.java",
|
||
|
"api/src/org/chromium/net/NetworkQualityRttListener.java",
|
||
|
"api/src/org/chromium/net/NetworkQualityThroughputListener.java",
|
||
|
"api/src/org/chromium/net/QuicException.java",
|
||
|
"api/src/org/chromium/net/RequestFinishedInfo.java",
|
||
|
"api/src/org/chromium/net/UploadDataProvider.java",
|
||
|
"api/src/org/chromium/net/UploadDataProviders.java",
|
||
|
"api/src/org/chromium/net/UploadDataSink.java",
|
||
|
"api/src/org/chromium/net/UrlRequest.java",
|
||
|
"api/src/org/chromium/net/UrlResponseInfo.java",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
"//third_party/android_tools:android_support_annotations_java",
|
||
|
]
|
||
|
|
||
|
srcjar_deps = cronet_api_srcjar_deps
|
||
|
|
||
|
run_findbugs_override = true
|
||
|
}
|
||
|
|
||
|
cronet_impl_common_java_srcjar_deps = [
|
||
|
":cronet_impl_version_srcjar",
|
||
|
":effective_connection_type_java",
|
||
|
":http_cache_type_java",
|
||
|
":load_states_list",
|
||
|
":rtt_throughput_values_java",
|
||
|
]
|
||
|
|
||
|
# cronet_impl_common_java.jar - common Cronet code that is shared
|
||
|
# by all Cronet engine implementations.
|
||
|
android_library("cronet_impl_common_java") {
|
||
|
java_files = [
|
||
|
"java/src/org/chromium/net/impl/CallbackExceptionImpl.java",
|
||
|
"java/src/org/chromium/net/impl/CronetExceptionImpl.java",
|
||
|
"java/src/org/chromium/net/impl/CronetEngineBase.java",
|
||
|
"java/src/org/chromium/net/impl/CronetEngineBuilderImpl.java",
|
||
|
"java/src/org/chromium/net/impl/NetworkExceptionImpl.java",
|
||
|
"java/src/org/chromium/net/impl/Preconditions.java",
|
||
|
"java/src/org/chromium/net/impl/QuicExceptionImpl.java",
|
||
|
"java/src/org/chromium/net/impl/RequestFinishedInfoImpl.java",
|
||
|
"java/src/org/chromium/net/impl/UrlRequestBase.java",
|
||
|
"java/src/org/chromium/net/impl/UrlRequestBuilderImpl.java",
|
||
|
"java/src/org/chromium/net/impl/UrlResponseInfoImpl.java",
|
||
|
"java/src/org/chromium/net/impl/UserAgent.java",
|
||
|
"java/src/org/chromium/net/impl/VersionSafeCallbacks.java",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
"//third_party/android_tools:android_support_annotations_java",
|
||
|
]
|
||
|
|
||
|
srcjar_deps = cronet_impl_common_java_srcjar_deps
|
||
|
}
|
||
|
|
||
|
# cronet_impl_platform_java.jar - Java platform based implementation of the Cronet engine.
|
||
|
android_library("cronet_impl_platform_java") {
|
||
|
java_files = [
|
||
|
"java/src/org/chromium/net/impl/InputStreamChannel.java",
|
||
|
"java/src/org/chromium/net/impl/JavaCronetEngine.java",
|
||
|
"java/src/org/chromium/net/impl/JavaCronetEngineBuilderImpl.java",
|
||
|
"java/src/org/chromium/net/impl/JavaCronetProvider.java",
|
||
|
"java/src/org/chromium/net/impl/JavaUrlRequest.java",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_impl_common_java",
|
||
|
"//third_party/android_tools:android_support_annotations_java",
|
||
|
"//third_party/jsr-305:jsr_305_javalib",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
cronet_impl_native_java_srcjar_deps = [
|
||
|
":net_request_priority_java",
|
||
|
":network_quality_observation_source_java",
|
||
|
":url_request_error_java",
|
||
|
]
|
||
|
|
||
|
# cronet_impl_native_java.jar - native implementation of the Cronet engine.
|
||
|
android_library("cronet_impl_native_java") {
|
||
|
java_files = [
|
||
|
"java/src/org/chromium/net/impl/BidirectionalStreamBuilderImpl.java",
|
||
|
"java/src/org/chromium/net/impl/BidirectionalStreamNetworkException.java",
|
||
|
"java/src/org/chromium/net/impl/CronetBidirectionalStream.java",
|
||
|
"java/src/org/chromium/net/impl/CronetLibraryLoader.java",
|
||
|
"java/src/org/chromium/net/impl/CronetMetrics.java",
|
||
|
"java/src/org/chromium/net/impl/CronetUploadDataStream.java",
|
||
|
"java/src/org/chromium/net/impl/CronetUrlRequest.java",
|
||
|
"java/src/org/chromium/net/impl/CronetUrlRequestContext.java",
|
||
|
"java/src/org/chromium/net/impl/NativeCronetEngineBuilderImpl.java",
|
||
|
"java/src/org/chromium/net/impl/NativeCronetEngineBuilderWithLibraryLoaderImpl.java",
|
||
|
"java/src/org/chromium/net/impl/NativeCronetProvider.java",
|
||
|
"java/src/org/chromium/net/urlconnection/CronetBufferedOutputStream.java",
|
||
|
"java/src/org/chromium/net/urlconnection/CronetChunkedOutputStream.java",
|
||
|
"java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java",
|
||
|
"java/src/org/chromium/net/urlconnection/CronetHttpURLConnection.java",
|
||
|
"java/src/org/chromium/net/urlconnection/CronetHttpURLStreamHandler.java",
|
||
|
"java/src/org/chromium/net/urlconnection/CronetInputStream.java",
|
||
|
"java/src/org/chromium/net/urlconnection/CronetOutputStream.java",
|
||
|
"java/src/org/chromium/net/urlconnection/CronetURLStreamHandlerFactory.java",
|
||
|
"java/src/org/chromium/net/urlconnection/MessageLoop.java",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_impl_common_java",
|
||
|
"//base:base_java",
|
||
|
"//net/android:net_java",
|
||
|
"//third_party/android_tools:android_support_annotations_java",
|
||
|
"//third_party/jsr-305:jsr_305_javalib",
|
||
|
]
|
||
|
|
||
|
srcjar_deps = cronet_impl_native_java_srcjar_deps
|
||
|
}
|
||
|
|
||
|
# Groups all Cronet implementations and the common code into a single Java dependency.
|
||
|
java_group("cronet_impl_all_java") {
|
||
|
deps = [
|
||
|
":cronet_impl_common_java",
|
||
|
":cronet_impl_native_java",
|
||
|
":cronet_impl_platform_java",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
android_resources("cronet_sample_apk_resources") {
|
||
|
resource_dirs = [ "sample/res" ]
|
||
|
android_manifest = "sample/AndroidManifest.xml"
|
||
|
deps = [
|
||
|
"//third_party/android_tools:android_support_v7_appcompat_java",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
android_library("cronet_sample_apk_java") {
|
||
|
java_files = [
|
||
|
"sample/src/org/chromium/cronet_sample_apk/CronetSampleActivity.java",
|
||
|
"sample/src/org/chromium/cronet_sample_apk/CronetSampleApplication.java",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_impl_all_java",
|
||
|
":cronet_sample_apk_resources",
|
||
|
"//base:base_java",
|
||
|
"//third_party/android_tools:android_support_v7_appcompat_java",
|
||
|
]
|
||
|
|
||
|
run_findbugs_override = true
|
||
|
}
|
||
|
|
||
|
android_apk("cronet_sample_apk") {
|
||
|
apk_name = "CronetSample"
|
||
|
android_manifest = "sample/AndroidManifest.xml"
|
||
|
shared_libraries = [ ":cronet" ]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_combine_proguard_flags",
|
||
|
":cronet_sample_apk_java",
|
||
|
":cronet_sample_apk_resources",
|
||
|
"//base:base_java",
|
||
|
"//third_party/jsr-305:jsr_305_javalib",
|
||
|
]
|
||
|
|
||
|
run_findbugs_override = true
|
||
|
proguard_enabled = true
|
||
|
proguard_configs = [
|
||
|
"$target_gen_dir/cronet_impl_native_proguard.cfg",
|
||
|
"cronet_impl_common_proguard.cfg",
|
||
|
"sample/javatests/proguard.cfg",
|
||
|
"//base/android/proguard/chromium_apk.flags",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
# cronet_sample_test_apk_resources is identical to
|
||
|
# cronet_sample_apk_resources. The two have to be different targets because
|
||
|
# targets which are common between the "instrumentation test apk" and the
|
||
|
# "tested apk" are removed from the "instrumentation test apk".
|
||
|
android_resources("cronet_sample_test_apk_resources") {
|
||
|
resource_dirs = [ "sample/res" ]
|
||
|
android_manifest = "sample/javatests/AndroidManifest.xml"
|
||
|
}
|
||
|
|
||
|
instrumentation_test_apk("cronet_sample_test_apk") {
|
||
|
apk_name = "CronetSampleTest"
|
||
|
apk_under_test = ":cronet_sample_apk"
|
||
|
android_manifest = "sample/javatests/AndroidManifest.xml"
|
||
|
java_files = [
|
||
|
"sample/javatests/src/org/chromium/cronet_sample_apk/Criteria.java",
|
||
|
"sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleTest.java",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_impl_all_java",
|
||
|
":cronet_sample_apk_java",
|
||
|
":cronet_sample_test_apk_resources",
|
||
|
"//base:base_java",
|
||
|
"//base:base_java_test_support",
|
||
|
"//net/android:net_java_test_support",
|
||
|
"//third_party/android_support_test_runner:rules_java",
|
||
|
"//third_party/android_support_test_runner:runner_java",
|
||
|
"//third_party/junit",
|
||
|
]
|
||
|
additional_apks = [ "//net/android:net_test_support_apk" ]
|
||
|
|
||
|
run_findbugs_override = true
|
||
|
proguard_enabled = true
|
||
|
}
|
||
|
|
||
|
generate_jni("cronet_tests_jni_headers") {
|
||
|
testonly = true
|
||
|
sources = [
|
||
|
"test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java",
|
||
|
"test/javatests/src/org/chromium/net/ExperimentalOptionsTest.java",
|
||
|
"test/src/org/chromium/net/CronetTestUtil.java",
|
||
|
"test/src/org/chromium/net/MockCertVerifier.java",
|
||
|
"test/src/org/chromium/net/MockUrlRequestJobFactory.java",
|
||
|
"test/src/org/chromium/net/NativeTestServer.java",
|
||
|
"test/src/org/chromium/net/QuicTestServer.java",
|
||
|
"test/src/org/chromium/net/TestUploadDataStreamHandler.java",
|
||
|
]
|
||
|
jni_package = "cronet_tests"
|
||
|
}
|
||
|
|
||
|
shared_library("cronet_tests") {
|
||
|
testonly = true
|
||
|
sources = [
|
||
|
# While "cronet_tests" cannot depend on "cronet_static", and hence cannot
|
||
|
# call any Cronet functions, it can access fields of Cronet objects, so add
|
||
|
# Cronet header files to facilitate accessing these fields.
|
||
|
"//components/cronet/android/cronet_url_request_adapter.h",
|
||
|
"//components/cronet/android/cronet_url_request_context_adapter.h",
|
||
|
"//components/cronet/url_request_context_config.h",
|
||
|
"test/cronet_test_jni.cc",
|
||
|
"test/cronet_test_util.cc",
|
||
|
"test/cronet_test_util.h",
|
||
|
"test/cronet_url_request_context_config_test.cc",
|
||
|
"test/cronet_url_request_context_config_test.h",
|
||
|
"test/experimental_options_test.cc",
|
||
|
"test/mock_cert_verifier.cc",
|
||
|
"test/mock_url_request_job_factory.cc",
|
||
|
"test/native_test_server.cc",
|
||
|
"test/quic_test_server.cc",
|
||
|
"test/test_upload_data_stream_handler.cc",
|
||
|
"test/test_upload_data_stream_handler.h",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_tests_jni_headers",
|
||
|
":cronet_version_header",
|
||
|
"//base",
|
||
|
"//base:i18n",
|
||
|
"//base/test:test_support",
|
||
|
"//components/prefs",
|
||
|
"//net",
|
||
|
"//net:simple_quic_tools",
|
||
|
"//net:test_support",
|
||
|
"//third_party/icu",
|
||
|
]
|
||
|
|
||
|
include_dirs = [ _cronet_version_header_include_dir ]
|
||
|
|
||
|
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
|
||
|
configs += [ "//build/config/android:hide_all_but_jni" ]
|
||
|
}
|
||
|
|
||
|
android_resources("cronet_test_apk_resources") {
|
||
|
testonly = true
|
||
|
resource_dirs = [
|
||
|
"test/res",
|
||
|
"test/smoketests/res/native",
|
||
|
]
|
||
|
android_manifest = "test/AndroidManifest.xml"
|
||
|
}
|
||
|
|
||
|
android_library("cronet_test_apk_java") {
|
||
|
testonly = true
|
||
|
|
||
|
java_files = [
|
||
|
"test/src/org/chromium/net/CronetTestApplication.java",
|
||
|
"test/src/org/chromium/net/CronetTestUtil.java",
|
||
|
"test/src/org/chromium/net/Http2TestHandler.java",
|
||
|
"test/src/org/chromium/net/Http2TestServer.java",
|
||
|
"test/src/org/chromium/net/MockCertVerifier.java",
|
||
|
"test/src/org/chromium/net/MockUrlRequestJobFactory.java",
|
||
|
"test/src/org/chromium/net/NativeTestServer.java",
|
||
|
"test/src/org/chromium/net/QuicTestServer.java",
|
||
|
"test/src/org/chromium/net/TestFilesInstaller.java",
|
||
|
"test/src/org/chromium/net/TestUploadDataStreamHandler.java",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_impl_all_java",
|
||
|
"//base:base_java",
|
||
|
"//base:base_java_test_support",
|
||
|
"//net/android:net_java_test_support",
|
||
|
"//third_party/netty4:netty_all_java",
|
||
|
]
|
||
|
|
||
|
run_findbugs_override = true
|
||
|
}
|
||
|
|
||
|
cronet_smoketests_platform_only_common_srcs = [
|
||
|
"test/smoketests/src/org/chromium/net/smoke/ChromiumPlatformOnlyTestSupport.java",
|
||
|
"test/smoketests/src/org/chromium/net/smoke/CronetSmokeTestRule.java",
|
||
|
"test/smoketests/src/org/chromium/net/smoke/HttpTestServer.java",
|
||
|
"test/smoketests/src/org/chromium/net/smoke/SmokeTestRequestCallback.java",
|
||
|
"test/smoketests/src/org/chromium/net/smoke/TestSupport.java",
|
||
|
]
|
||
|
|
||
|
cronet_smoketests_native_common_srcs = cronet_smoketests_platform_only_common_srcs + [
|
||
|
"test/smoketests/src/org/chromium/net/smoke/ChromiumNativeTestSupport.java",
|
||
|
"test/smoketests/src/org/chromium/net/smoke/NativeCronetTestRule.java",
|
||
|
]
|
||
|
|
||
|
android_library("cronet_smoketests_native_java") {
|
||
|
testonly = true
|
||
|
java_files = [
|
||
|
"test/smoketests/src/org/chromium/net/smoke/Http2Test.java",
|
||
|
"test/smoketests/src/org/chromium/net/smoke/QuicTest.java",
|
||
|
] + cronet_smoketests_native_common_srcs
|
||
|
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_test_apk_java",
|
||
|
"//base:base_java",
|
||
|
"//base:base_java_test_support",
|
||
|
"//third_party/android_support_test_runner:runner_java",
|
||
|
"//third_party/junit",
|
||
|
"//third_party/netty4:netty_all_java",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
android_assets("cronet_test_apk_assets") {
|
||
|
testonly = true
|
||
|
|
||
|
# Need to use renaming_sources to maintain subdirectories.
|
||
|
renaming_sources = [
|
||
|
"test/assets/test/cacheable.txt",
|
||
|
"test/assets/test/cacheable.txt.mock-http-headers",
|
||
|
"test/assets/test/content_length_mismatch.html",
|
||
|
"test/assets/test/content_length_mismatch.html.mock-http-headers",
|
||
|
"test/assets/test/gzipped.html",
|
||
|
"test/assets/test/gzipped.html.mock-http-headers",
|
||
|
"test/assets/test/multiredirect.html",
|
||
|
"test/assets/test/multiredirect.html.mock-http-headers",
|
||
|
"test/assets/test/notfound.html",
|
||
|
"test/assets/test/notfound.html.mock-http-headers",
|
||
|
"test/assets/test/quic_data/simple.txt",
|
||
|
"test/assets/test/redirect.html",
|
||
|
"test/assets/test/redirect.html.mock-http-headers",
|
||
|
"test/assets/test/redirect_invalid_scheme.html",
|
||
|
"test/assets/test/redirect_invalid_scheme.html.mock-http-headers",
|
||
|
"test/assets/test/set_cookie.html",
|
||
|
"test/assets/test/set_cookie.html.mock-http-headers",
|
||
|
"test/assets/test/secureproxychecksuccess.txt",
|
||
|
"test/assets/test/secureproxychecksuccess.txt.mock-http-headers",
|
||
|
"test/assets/test/success.txt",
|
||
|
"test/assets/test/success.txt.mock-http-headers",
|
||
|
]
|
||
|
|
||
|
# Maintain directory structure.
|
||
|
renaming_destinations = rebase_path(renaming_sources, "test/assets")
|
||
|
}
|
||
|
|
||
|
android_apk("cronet_test_apk") {
|
||
|
testonly = true
|
||
|
apk_name = "CronetTest"
|
||
|
android_manifest = "test/AndroidManifest.xml"
|
||
|
shared_libraries = [
|
||
|
":cronet",
|
||
|
":cronet_tests",
|
||
|
]
|
||
|
loadable_modules = [ "$root_out_dir/libnetty-tcnative.so" ]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_combine_proguard_flags",
|
||
|
":cronet_test_apk_assets",
|
||
|
":cronet_test_apk_resources",
|
||
|
"//base:base_java",
|
||
|
"//third_party/netty-tcnative:netty-tcnative-so",
|
||
|
]
|
||
|
|
||
|
proguard_enabled = true
|
||
|
|
||
|
proguard_configs = [
|
||
|
"$target_gen_dir/cronet_impl_native_proguard.cfg",
|
||
|
"cronet_impl_common_proguard.cfg",
|
||
|
"cronet_impl_platform_proguard.cfg",
|
||
|
]
|
||
|
|
||
|
run_findbugs_override = true
|
||
|
}
|
||
|
|
||
|
android_library("cronet_javatests") {
|
||
|
testonly = true
|
||
|
|
||
|
java_files = [
|
||
|
"test/javatests/src/org/chromium/net/BidirectionalStreamQuicTest.java",
|
||
|
"test/javatests/src/org/chromium/net/BidirectionalStreamTest.java",
|
||
|
"test/javatests/src/org/chromium/net/BrotliTest.java",
|
||
|
"test/javatests/src/org/chromium/net/Criteria.java",
|
||
|
"test/javatests/src/org/chromium/net/CronetEngineBuilderTest.java",
|
||
|
"test/javatests/src/org/chromium/net/CronetStressTest.java",
|
||
|
"test/javatests/src/org/chromium/net/CronetTestCommon.java",
|
||
|
"test/javatests/src/org/chromium/net/CronetTestRule.java",
|
||
|
"test/javatests/src/org/chromium/net/CronetTestRuleTest.java",
|
||
|
"test/javatests/src/org/chromium/net/CronetUploadTest.java",
|
||
|
"test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java",
|
||
|
"test/javatests/src/org/chromium/net/CronetUrlRequestTest.java",
|
||
|
"test/javatests/src/org/chromium/net/DiskStorageTest.java",
|
||
|
"test/javatests/src/org/chromium/net/ExperimentalOptionsTest.java",
|
||
|
"test/javatests/src/org/chromium/net/GetStatusTest.java",
|
||
|
"test/javatests/src/org/chromium/net/MetricsTestUtil.java",
|
||
|
"test/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java",
|
||
|
"test/javatests/src/org/chromium/net/NQETest.java",
|
||
|
"test/javatests/src/org/chromium/net/PkpTest.java",
|
||
|
"test/javatests/src/org/chromium/net/QuicTest.java",
|
||
|
"test/javatests/src/org/chromium/net/RequestFinishedInfoTest.java",
|
||
|
"test/javatests/src/org/chromium/net/TestBidirectionalStreamCallback.java",
|
||
|
"test/javatests/src/org/chromium/net/TestDrivenDataProvider.java",
|
||
|
"test/javatests/src/org/chromium/net/TestNetworkQualityRttListener.java",
|
||
|
"test/javatests/src/org/chromium/net/TestNetworkQualityThroughputListener.java",
|
||
|
"test/javatests/src/org/chromium/net/TestUploadDataProvider.java",
|
||
|
"test/javatests/src/org/chromium/net/TestUrlRequestCallback.java",
|
||
|
"test/javatests/src/org/chromium/net/UploadDataProvidersTest.java",
|
||
|
"test/javatests/src/org/chromium/net/urlconnection/CronetBufferedOutputStreamTest.java",
|
||
|
"test/javatests/src/org/chromium/net/urlconnection/CronetChunkedOutputStreamTest.java",
|
||
|
"test/javatests/src/org/chromium/net/urlconnection/CronetFixedModeOutputStreamTest.java",
|
||
|
"test/javatests/src/org/chromium/net/urlconnection/CronetHttpURLConnectionTest.java",
|
||
|
"test/javatests/src/org/chromium/net/urlconnection/CronetHttpURLStreamHandlerTest.java",
|
||
|
"test/javatests/src/org/chromium/net/urlconnection/CronetURLStreamHandlerFactoryTest.java",
|
||
|
"test/javatests/src/org/chromium/net/urlconnection/MessageLoopTest.java",
|
||
|
"test/javatests/src/org/chromium/net/urlconnection/QuicUploadTest.java",
|
||
|
"test/javatests/src/org/chromium/net/urlconnection/TestUtil.java",
|
||
|
"test/javatests/src/org/chromium/net/UrlResponseInfoTest.java",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_impl_all_java",
|
||
|
":cronet_test_apk_java",
|
||
|
"//base:base_java",
|
||
|
"//base:base_java_test_support",
|
||
|
"//net/android:net_java",
|
||
|
"//net/android:net_java_test_support",
|
||
|
"//third_party/android_support_test_runner:runner_java",
|
||
|
"//third_party/junit",
|
||
|
]
|
||
|
|
||
|
run_findbugs_override = true
|
||
|
}
|
||
|
|
||
|
instrumentation_test_apk("cronet_test_instrumentation_apk") {
|
||
|
apk_name = "CronetTestInstrumentation"
|
||
|
apk_under_test = ":cronet_test_apk"
|
||
|
android_manifest = "test/javatests/AndroidManifest.xml"
|
||
|
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_impl_all_java",
|
||
|
":cronet_javatests",
|
||
|
":cronet_smoketests_native_java",
|
||
|
":cronet_test_apk_java",
|
||
|
"//base:base_java",
|
||
|
"//base:base_java_test_support",
|
||
|
"//net/android:net_java",
|
||
|
"//net/android:net_java_test_support",
|
||
|
"//third_party/android_support_test_runner:runner_java",
|
||
|
]
|
||
|
additional_apks = [ "//net/android:net_test_support_apk" ]
|
||
|
|
||
|
data_deps = [
|
||
|
"//net:test_support",
|
||
|
]
|
||
|
|
||
|
proguard_enabled = true
|
||
|
|
||
|
proguard_configs = [ "test/proguard.cfg" ]
|
||
|
|
||
|
run_findbugs_override = true
|
||
|
}
|
||
|
|
||
|
android_resources("cronet_smoketests_platform_only_apk_resources") {
|
||
|
testonly = true
|
||
|
resource_dirs = [ "test/smoketests/res/platform_only" ]
|
||
|
android_manifest = "test/AndroidManifest.xml"
|
||
|
}
|
||
|
|
||
|
android_library("cronet_smoketests_platform_only_java") {
|
||
|
testonly = true
|
||
|
java_files = [ "test/smoketests/src/org/chromium/net/smoke/PlatformOnlyEngineTest.java" ] + cronet_smoketests_platform_only_common_srcs
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
"//base:base_java_test_support",
|
||
|
"//third_party/android_support_test_runner:runner_java",
|
||
|
"//third_party/junit",
|
||
|
"//third_party/netty4:netty_all_java",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
android_apk("cronet_smoketests_platform_only_apk") {
|
||
|
testonly = true
|
||
|
apk_name = "PlatformOnlyEngineSmokeTest"
|
||
|
android_manifest = "test/AndroidManifest.xml"
|
||
|
java_files = [ "test/src/org/chromium/net/CronetTestApplication.java" ]
|
||
|
|
||
|
proguard_enabled = true
|
||
|
proguard_configs = [
|
||
|
"cronet_impl_common_proguard.cfg",
|
||
|
"cronet_impl_platform_proguard.cfg",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_impl_common_java",
|
||
|
":cronet_impl_platform_java",
|
||
|
":cronet_smoketests_platform_only_apk_resources",
|
||
|
]
|
||
|
run_findbugs_override = true
|
||
|
}
|
||
|
|
||
|
instrumentation_test_apk(
|
||
|
"cronet_smoketests_platform_only_instrumentation_apk") {
|
||
|
apk_name = "PlatformOnlyEngineSmokeTestInstrumentation"
|
||
|
apk_under_test = ":cronet_smoketests_platform_only_apk"
|
||
|
android_manifest = "test/javatests/AndroidManifest.xml"
|
||
|
deps = [
|
||
|
":cronet_smoketests_platform_only_java",
|
||
|
"//base:base_java_test_support",
|
||
|
"//third_party/android_support_test_runner:runner_java",
|
||
|
]
|
||
|
|
||
|
proguard_enabled = true
|
||
|
|
||
|
proguard_configs = [ "test/proguard.cfg" ]
|
||
|
run_findbugs_override = true
|
||
|
}
|
||
|
|
||
|
android_library("cronet_smoketests_missing_native_library_java") {
|
||
|
testonly = true
|
||
|
java_files = [ "test/smoketests/src/org/chromium/net/smoke/MissingNativeLibraryTest.java" ] + cronet_smoketests_native_common_srcs
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_test_apk_java",
|
||
|
"//base:base_java",
|
||
|
"//base:base_java_test_support",
|
||
|
"//third_party/android_support_test_runner:runner_java",
|
||
|
"//third_party/junit",
|
||
|
"//third_party/netty4:netty_all_java",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
android_apk("cronet_smoketests_missing_native_library_apk") {
|
||
|
testonly = true
|
||
|
apk_name = "MissingNativeLibrarySmokeTest"
|
||
|
android_manifest = "test/AndroidManifest.xml"
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_combine_proguard_flags",
|
||
|
":cronet_impl_common_java",
|
||
|
":cronet_impl_platform_java",
|
||
|
":cronet_test_apk_resources",
|
||
|
]
|
||
|
|
||
|
proguard_enabled = true
|
||
|
proguard_configs = [
|
||
|
"$target_gen_dir/cronet_impl_native_proguard.cfg",
|
||
|
"cronet_impl_common_proguard.cfg",
|
||
|
"cronet_impl_platform_proguard.cfg",
|
||
|
]
|
||
|
|
||
|
run_findbugs_override = true
|
||
|
}
|
||
|
|
||
|
instrumentation_test_apk(
|
||
|
"cronet_smoketests_missing_native_library_instrumentation_apk") {
|
||
|
apk_name = "MissingNativeLibrarySmokeTestInstrumentation"
|
||
|
apk_under_test = ":cronet_smoketests_missing_native_library_apk"
|
||
|
android_manifest = "test/javatests/AndroidManifest.xml"
|
||
|
|
||
|
deps = [
|
||
|
":cronet_smoketests_missing_native_library_java",
|
||
|
]
|
||
|
|
||
|
proguard_enabled = true
|
||
|
|
||
|
proguard_configs = [ "test/proguard.cfg" ]
|
||
|
|
||
|
run_findbugs_override = true
|
||
|
}
|
||
|
|
||
|
android_library("cronet_perf_test_apk_java") {
|
||
|
testonly = true
|
||
|
android_manifest = "test/javaperftests/AndroidManifest.xml"
|
||
|
java_files =
|
||
|
[ "test/javaperftests/src/org/chromium/net/CronetPerfTestActivity.java" ]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_impl_all_java",
|
||
|
":cronet_javatests",
|
||
|
":cronet_test_apk_java",
|
||
|
"//base:base_java",
|
||
|
]
|
||
|
|
||
|
run_findbugs_override = true
|
||
|
}
|
||
|
|
||
|
android_apk("cronet_perf_test_apk") {
|
||
|
testonly = true
|
||
|
apk_name = "CronetPerfTest"
|
||
|
android_manifest = "test/javaperftests/AndroidManifest.xml"
|
||
|
shared_libraries = [
|
||
|
":cronet",
|
||
|
":cronet_tests",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_combine_proguard_flags",
|
||
|
":cronet_perf_test_apk_java",
|
||
|
":cronet_test_apk_java",
|
||
|
"//base:base_java",
|
||
|
]
|
||
|
|
||
|
run_findbugs_override = true
|
||
|
proguard_enabled = true
|
||
|
proguard_configs = [
|
||
|
"$target_gen_dir/cronet_impl_native_proguard.cfg",
|
||
|
"cronet_impl_common_proguard.cfg",
|
||
|
"test/proguard.cfg",
|
||
|
"//base/android/proguard/chromium_apk.flags",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
test("cronet_unittests") {
|
||
|
sources = [
|
||
|
"//components/cronet/android/cert/cert_verifier_cache_serializer_unittest.cc",
|
||
|
"//components/cronet/histogram_manager_unittest.cc",
|
||
|
"//components/cronet/host_cache_persistence_manager_unittest.cc",
|
||
|
"//components/cronet/run_all_unittests.cc",
|
||
|
"//components/cronet/stale_host_resolver_unittest.cc",
|
||
|
"//components/cronet/url_request_context_config_unittest.cc",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_android_cert_proto",
|
||
|
":cronet_static",
|
||
|
"//base",
|
||
|
"//base/test:test_support",
|
||
|
"//components/metrics",
|
||
|
"//components/prefs:test_support",
|
||
|
"//net",
|
||
|
"//net:test_support",
|
||
|
"//net/android:net_java",
|
||
|
"//testing/gtest",
|
||
|
]
|
||
|
|
||
|
if (is_android) {
|
||
|
shard_timeout = 180
|
||
|
}
|
||
|
}
|
||
|
|
||
|
_package_dir = "$root_out_dir/cronet"
|
||
|
_test_package_dir = "$root_out_dir/cronet/test"
|
||
|
_extract_cronet_jars_dir = "$target_gen_dir/cronet_jar_extract"
|
||
|
_extract_cronet_test_jars_dir = "$target_gen_dir/cronet_test_jar_extract"
|
||
|
|
||
|
action("extract_cronet_jars") {
|
||
|
# extract_from_jars.py deletes the target directory before extracting.
|
||
|
script = "//components/cronet/tools/extract_from_jars.py"
|
||
|
depfile = "$target_gen_dir/$target_name.d"
|
||
|
|
||
|
_stamp_file = "$target_gen_dir/$target_name.stamp"
|
||
|
outputs = [
|
||
|
_stamp_file,
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_impl_native_java",
|
||
|
"//base:base_java",
|
||
|
"//net/android:net_java",
|
||
|
"//url:url_java",
|
||
|
]
|
||
|
|
||
|
sources = []
|
||
|
foreach(dep, deps) {
|
||
|
sources += [ get_label_info(dep, "target_gen_dir") + "/" +
|
||
|
get_label_info(dep, "name") + "__compile_java.javac.jar" ]
|
||
|
}
|
||
|
|
||
|
_rebased_sources = rebase_path(sources, root_build_dir)
|
||
|
|
||
|
args = [
|
||
|
"--classes-dir",
|
||
|
rebase_path(_extract_cronet_jars_dir, root_build_dir),
|
||
|
"--jars=${_rebased_sources}",
|
||
|
"--depfile",
|
||
|
rebase_path(depfile, root_build_dir),
|
||
|
"--stamp",
|
||
|
rebase_path(_stamp_file, root_build_dir),
|
||
|
]
|
||
|
}
|
||
|
|
||
|
action("repackage_extracted_jars") {
|
||
|
_output_jar = "$_package_dir/cronet_impl_native_java.jar"
|
||
|
|
||
|
script = "//build/android/gyp/jar.py"
|
||
|
outputs = [
|
||
|
_output_jar,
|
||
|
]
|
||
|
|
||
|
args = [
|
||
|
"--classes-dir",
|
||
|
rebase_path(_extract_cronet_jars_dir, root_build_dir),
|
||
|
"--jar-path",
|
||
|
rebase_path(_output_jar, root_build_dir),
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":extract_cronet_jars",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
action("extract_cronet_test_jars") {
|
||
|
# extract_from_jars.py deletes the target directory before extracting.
|
||
|
script = "//components/cronet/tools/extract_from_jars.py"
|
||
|
depfile = "$target_gen_dir/$target_name.d"
|
||
|
testonly = true
|
||
|
|
||
|
sources = [
|
||
|
"$root_out_dir/lib.java/base/base_java.jar",
|
||
|
"$root_out_dir/lib.java/base/base_java_test_support.jar",
|
||
|
"$root_out_dir/lib.java/components/cronet/android/cronet_javatests.jar",
|
||
|
"$root_out_dir/lib.java/components/cronet/android/cronet_test_apk_java.jar",
|
||
|
"$root_out_dir/lib.java/net/android/embedded_test_server_aidl_java.jar",
|
||
|
"$root_out_dir/lib.java/net/android/net_java.jar",
|
||
|
"$root_out_dir/lib.java/net/android/net_java_test_support.jar",
|
||
|
"$root_out_dir/lib.java/url/url_java.jar",
|
||
|
NETTY4_JAR_FILE,
|
||
|
]
|
||
|
|
||
|
_stamp_file = "$target_gen_dir/$target_name.stamp"
|
||
|
outputs = [
|
||
|
_stamp_file,
|
||
|
]
|
||
|
|
||
|
_rebased_sources = rebase_path(sources, root_build_dir)
|
||
|
|
||
|
args = [
|
||
|
"--classes-dir",
|
||
|
rebase_path(_extract_cronet_test_jars_dir, root_build_dir),
|
||
|
"--jars=${_rebased_sources}",
|
||
|
"--depfile",
|
||
|
rebase_path(depfile, root_build_dir),
|
||
|
"--stamp",
|
||
|
rebase_path(_stamp_file, root_build_dir),
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_javatests",
|
||
|
":cronet_test_apk_java",
|
||
|
"//base:base_java",
|
||
|
"//base:base_java_test_support",
|
||
|
"//net/android:embedded_test_server_aidl_java",
|
||
|
"//net/android:net_java",
|
||
|
"//net/android:net_java_test_support",
|
||
|
"//third_party/netty4:netty_all_java",
|
||
|
"//url:url_java",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
action("repackage_extracted_test_jars") {
|
||
|
_output_jar = "$_test_package_dir/cronet_tests_java.jar"
|
||
|
testonly = true
|
||
|
|
||
|
script = "//build/android/gyp/jar.py"
|
||
|
outputs = [
|
||
|
_output_jar,
|
||
|
]
|
||
|
|
||
|
args = [
|
||
|
"--classes-dir",
|
||
|
rebase_path(_extract_cronet_test_jars_dir, root_build_dir),
|
||
|
"--jar-path",
|
||
|
rebase_path(_output_jar, root_build_dir),
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":extract_cronet_test_jars",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
template("jar_src") {
|
||
|
action(target_name) {
|
||
|
_rebased_src_search_dirs =
|
||
|
rebase_path(invoker.src_search_dirs, root_build_dir)
|
||
|
|
||
|
script = "//components/cronet/tools/jar_src.py"
|
||
|
depfile = "$target_gen_dir/$target_name.d"
|
||
|
outputs = [
|
||
|
invoker.jar_path,
|
||
|
]
|
||
|
args = [
|
||
|
"--src-search-dirs=${_rebased_src_search_dirs}",
|
||
|
"--jar-path",
|
||
|
rebase_path(invoker.jar_path, root_build_dir),
|
||
|
"--depfile",
|
||
|
rebase_path(depfile, root_build_dir),
|
||
|
]
|
||
|
|
||
|
deps = []
|
||
|
if (defined(invoker.deps)) {
|
||
|
deps += invoker.deps
|
||
|
}
|
||
|
|
||
|
_src_jars = []
|
||
|
|
||
|
# Add src-jar files that are listed in "src_jars".
|
||
|
if (defined(invoker.src_jars)) {
|
||
|
_rebased_src_jars = rebase_path(invoker.src_jars, root_build_dir)
|
||
|
_src_jars += _rebased_src_jars
|
||
|
}
|
||
|
|
||
|
# Add src-jar files that are generated by dependencies in "srcjar_deps".
|
||
|
if (defined(invoker.srcjar_deps)) {
|
||
|
foreach(_srcjar_dep, invoker.srcjar_deps) {
|
||
|
_dep_gen_dir = get_label_info(_srcjar_dep, "target_gen_dir")
|
||
|
_dep_name = get_label_info(_srcjar_dep, "name")
|
||
|
_src_jars += rebase_path([ "$_dep_gen_dir/$_dep_name.srcjar" ])
|
||
|
deps += [ _srcjar_dep ]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
# Create the list of all source files that are given in "src_files".
|
||
|
_src_files = []
|
||
|
if (defined(invoker.src_files)) {
|
||
|
_src_files += invoker.src_files
|
||
|
}
|
||
|
|
||
|
# Handle "source_deps".
|
||
|
_src_list_files = []
|
||
|
if (defined(invoker.source_deps)) {
|
||
|
foreach(_source_dep, invoker.source_deps) {
|
||
|
_dep_gen_dir = get_label_info(_source_dep, "target_gen_dir")
|
||
|
_dep_name = get_label_info(_source_dep, "name")
|
||
|
_src_list_files += rebase_path([ "$_dep_gen_dir/$_dep_name.sources" ])
|
||
|
deps += [ _source_dep ]
|
||
|
}
|
||
|
}
|
||
|
args += [ "--src-jar=${_src_jars}" ]
|
||
|
args += [ "--src-files=${_src_files}" ]
|
||
|
args += [ "--src-list-files=${_src_list_files}" ]
|
||
|
|
||
|
inputs = _src_jars
|
||
|
inputs += _src_files
|
||
|
inputs += _src_list_files
|
||
|
}
|
||
|
}
|
||
|
|
||
|
jar_src("jar_cronet_api_source") {
|
||
|
src_search_dirs = [ "api/src" ]
|
||
|
source_deps = [ ":cronet_api_java" ]
|
||
|
srcjar_deps = cronet_api_srcjar_deps
|
||
|
jar_path = "$_package_dir/cronet_api-src.jar"
|
||
|
}
|
||
|
|
||
|
jar_src("jar_cronet_impl_common_java_source") {
|
||
|
src_search_dirs = [ "java/src" ]
|
||
|
source_deps = [ ":cronet_impl_common_java" ]
|
||
|
srcjar_deps = cronet_impl_common_java_srcjar_deps
|
||
|
jar_path = "$_package_dir/cronet_impl_common_java-src.jar"
|
||
|
}
|
||
|
|
||
|
jar_src("jar_cronet_impl_platform_java_source") {
|
||
|
src_search_dirs = [ "java/src" ]
|
||
|
source_deps = [ ":cronet_impl_platform_java" ]
|
||
|
jar_path = "$_package_dir/cronet_impl_platform_java-src.jar"
|
||
|
}
|
||
|
|
||
|
zip("jar_cronet_sample_source") {
|
||
|
inputs = [
|
||
|
"sample/AndroidManifest.xml",
|
||
|
"sample/javatests/AndroidManifest.xml",
|
||
|
"sample/javatests/proguard.cfg",
|
||
|
"sample/javatests/src/org/chromium/cronet_sample_apk/Criteria.java",
|
||
|
"sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleTest.java",
|
||
|
"sample/README",
|
||
|
"sample/res/layout/activity_main.xml",
|
||
|
"sample/res/layout/dialog_url.xml",
|
||
|
"sample/res/values/dimens.xml",
|
||
|
"sample/res/values/strings.xml",
|
||
|
"sample/src/org/chromium/cronet_sample_apk/CronetSampleActivity.java",
|
||
|
"sample/src/org/chromium/cronet_sample_apk/CronetSampleApplication.java",
|
||
|
]
|
||
|
output = "$_package_dir/cronet-sample-src.jar"
|
||
|
base_dir = "sample"
|
||
|
}
|
||
|
|
||
|
jar_src("jar_cronet_impl_native_java_source") {
|
||
|
src_search_dirs = [
|
||
|
"//base/android/java/src",
|
||
|
"//components/cronet/android/java/src",
|
||
|
"//net/android/java/src",
|
||
|
"//url/android/java/src",
|
||
|
]
|
||
|
source_deps = [
|
||
|
":cronet_impl_native_java",
|
||
|
"//base:base_java",
|
||
|
"//net/android:net_java",
|
||
|
"//url:url_java",
|
||
|
]
|
||
|
srcjar_deps = cronet_impl_native_java_srcjar_deps + [
|
||
|
"//base:base_android_java_enums_srcjar",
|
||
|
"//net/android:net_android_java_enums_srcjar",
|
||
|
"//net/android:net_errors_java",
|
||
|
]
|
||
|
jar_path = "$_package_dir/cronet_impl_native_java-src.jar"
|
||
|
}
|
||
|
|
||
|
action("generate_licenses") {
|
||
|
_license_path = "$_package_dir/LICENSE"
|
||
|
|
||
|
script = "//tools/licenses.py"
|
||
|
outputs = [
|
||
|
_license_path,
|
||
|
]
|
||
|
args = [
|
||
|
"license_file",
|
||
|
rebase_path(_license_path, root_build_dir),
|
||
|
"--gn-target",
|
||
|
"//components/cronet/android:cronet",
|
||
|
"--gn-out-dir",
|
||
|
".",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
action("generate_javadoc") {
|
||
|
script = "//components/cronet/tools/generate_javadoc.py"
|
||
|
depfile = "$target_gen_dir/$target_name.d"
|
||
|
_stamp_file = "$target_gen_dir/$target_name.stamp"
|
||
|
outputs = [
|
||
|
_stamp_file,
|
||
|
]
|
||
|
args = [
|
||
|
"--output-dir",
|
||
|
rebase_path(_package_dir, root_build_dir),
|
||
|
"--input-dir",
|
||
|
rebase_path("//components/cronet", root_build_dir),
|
||
|
"--overview-file",
|
||
|
rebase_path("$_package_dir/README.md.html", root_build_dir),
|
||
|
"--readme-file",
|
||
|
rebase_path("//components/cronet/README.md", root_build_dir),
|
||
|
"--depfile",
|
||
|
rebase_path(depfile, root_build_dir),
|
||
|
"--stamp",
|
||
|
rebase_path(_stamp_file, root_build_dir),
|
||
|
"--lib-java-dir",
|
||
|
rebase_path("$root_build_dir/lib.java/components/cronet/android",
|
||
|
root_build_dir),
|
||
|
|
||
|
# JavaDoc is generated from Cronet's API source jar.
|
||
|
"--input-src-jar",
|
||
|
rebase_path("$_package_dir/cronet_api-src.jar", root_build_dir),
|
||
|
]
|
||
|
deps = [
|
||
|
":jar_cronet_api_source",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
copy("cronet_package_copy") {
|
||
|
sources = [
|
||
|
"$target_gen_dir/cronet_impl_native_proguard.cfg",
|
||
|
"//AUTHORS",
|
||
|
"//chrome/VERSION",
|
||
|
"cronet_impl_common_proguard.cfg",
|
||
|
"cronet_impl_platform_proguard.cfg",
|
||
|
]
|
||
|
outputs = [
|
||
|
"$_package_dir/{{source_file_part}}",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_combine_proguard_flags",
|
||
|
":cronet_impl_common_java",
|
||
|
":cronet_impl_platform_java",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
template("copy_java8_jars") {
|
||
|
_deps = []
|
||
|
foreach(dep, invoker.deps) {
|
||
|
_dep_name = get_label_info(dep, "name")
|
||
|
_source_jar = get_label_info(dep, "target_gen_dir") + "/" + _dep_name +
|
||
|
"__compile_java.javac.jar"
|
||
|
_output_jar = "$_package_dir/" + _dep_name + ".jar"
|
||
|
|
||
|
# cronet_api.jar is a special case. Its file name is
|
||
|
# different from the target name that builds it.
|
||
|
if (_output_jar == "$_package_dir/" + "cronet_api_java.jar") {
|
||
|
_output_jar = "$_package_dir/" + "cronet_api.jar"
|
||
|
}
|
||
|
|
||
|
_copy_dep = ":" + _dep_name + "__compile_java__javac"
|
||
|
_copy_target_name = "${target_name}_${dep}"
|
||
|
|
||
|
copy(_copy_target_name) {
|
||
|
sources = [
|
||
|
_source_jar,
|
||
|
]
|
||
|
outputs = [
|
||
|
_output_jar,
|
||
|
]
|
||
|
deps = [
|
||
|
_copy_dep,
|
||
|
]
|
||
|
}
|
||
|
_deps += [ ":" + _copy_target_name ]
|
||
|
}
|
||
|
|
||
|
group(target_name) {
|
||
|
deps = _deps
|
||
|
}
|
||
|
}
|
||
|
|
||
|
copy_java8_jars("copy_cronet_java8_jars") {
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_impl_common_java",
|
||
|
":cronet_impl_platform_java",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
action("cronet_combine_proguard_flags") {
|
||
|
script = "//components/cronet/tools/generate_proguard_file.py"
|
||
|
sources = [
|
||
|
"//base/android/proguard/chromium_code.flags",
|
||
|
"//components/cronet/android/cronet_impl_native_proguard.cfg",
|
||
|
]
|
||
|
outputs = [
|
||
|
"$target_gen_dir/cronet_impl_native_proguard.cfg",
|
||
|
]
|
||
|
args = [ "--output-file" ] + rebase_path(outputs, root_build_dir) +
|
||
|
rebase_path(sources, root_build_dir)
|
||
|
}
|
||
|
|
||
|
copy("cronet_package_copy_native_lib") {
|
||
|
sources = [
|
||
|
"$root_out_dir/" + _cronet_shared_lib_file_name,
|
||
|
]
|
||
|
outputs = [
|
||
|
"$_package_dir/libs/${android_app_abi}/" + _cronet_shared_lib_file_name,
|
||
|
]
|
||
|
deps = [
|
||
|
":cronet",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
copy("cronet_package_copy_native_lib_unstripped") {
|
||
|
sources = [
|
||
|
"$root_out_dir/lib.unstripped/" + _cronet_shared_lib_file_name,
|
||
|
]
|
||
|
outputs = [
|
||
|
"$_package_dir/symbols/${android_app_abi}/" + _cronet_shared_lib_file_name,
|
||
|
]
|
||
|
deps = [
|
||
|
":cronet",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
copy("cronet_package_copy_native_test_lib") {
|
||
|
testonly = true
|
||
|
sources = [
|
||
|
"$root_out_dir/libcronet_tests.so",
|
||
|
"$root_out_dir/libnetty-tcnative.so",
|
||
|
]
|
||
|
outputs = [
|
||
|
"$_test_package_dir/libs/${android_app_abi}/{{source_file_part}}",
|
||
|
]
|
||
|
deps = [
|
||
|
":cronet_tests",
|
||
|
"//third_party/netty-tcnative:netty-tcnative-so",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
copy("cronet_package_copy_native_test_lib_unstripped") {
|
||
|
testonly = true
|
||
|
sources = [
|
||
|
"$root_out_dir/lib.unstripped/libcronet_tests.so",
|
||
|
"$root_out_dir/lib.unstripped/libnetty-tcnative.so",
|
||
|
]
|
||
|
outputs = [
|
||
|
"$_test_package_dir/symbols/${android_app_abi}/{{source_file_part}}",
|
||
|
]
|
||
|
deps = [
|
||
|
":cronet_tests",
|
||
|
"//third_party/netty-tcnative:netty-tcnative-so",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
copy("cronet_package_copy_test_assets") {
|
||
|
testonly = true
|
||
|
sources = [
|
||
|
"test/assets",
|
||
|
]
|
||
|
outputs = [
|
||
|
"$_test_package_dir/assets",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
copy("cronet_package_copy_test_support_apks") {
|
||
|
testonly = true
|
||
|
sources = [
|
||
|
# Provides EmbeddedTestServer.
|
||
|
"$root_out_dir/apks/ChromiumNetTestSupport.apk",
|
||
|
]
|
||
|
outputs = [
|
||
|
"$_test_package_dir/apks/${android_app_abi}/{{source_file_part}}",
|
||
|
]
|
||
|
deps = [
|
||
|
"//net/android:net_test_support_apk",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
copy("cronet_package_copy_test_files") {
|
||
|
testonly = true
|
||
|
sources = [
|
||
|
"//net/data/ssl/certificates/quic_test.example.com.crt",
|
||
|
"//net/data/ssl/certificates/quic_test.example.com.key",
|
||
|
"//net/data/ssl/certificates/quic_test.example.com.key.pkcs8",
|
||
|
"//net/data/ssl/certificates/quic_test.example.com.key.pkcs8.pem",
|
||
|
"//net/data/ssl/certificates/quic_test.example.com.key.sct",
|
||
|
]
|
||
|
outputs = [
|
||
|
"$_test_package_dir/assets/test_files/net/data/ssl/certificates/{{source_file_part}}",
|
||
|
]
|
||
|
deps = [
|
||
|
# Not really dependent, but builds can fail if these two targets attempt
|
||
|
# to create the "assets" subdirectory simultaneously.
|
||
|
":cronet_package_copy_test_assets",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
copy("cronet_package_copy_resources") {
|
||
|
sources = [
|
||
|
"api/res/raw/keep_cronet_api.xml",
|
||
|
]
|
||
|
outputs = [
|
||
|
"$_package_dir/res/raw/{{source_file_part}}",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
# Enforce that ARM Neon is not used when building for ARMv7
|
||
|
if (target_cpu == "arm" && arm_version == 7 && !arm_use_neon) {
|
||
|
action("enforce_no_neon") {
|
||
|
script = "//components/cronet/tools/check_no_neon.py"
|
||
|
outputs = [
|
||
|
"$target_gen_dir/$target_name.stamp",
|
||
|
]
|
||
|
args = [
|
||
|
rebase_path("${android_tool_prefix}objdump", root_build_dir),
|
||
|
|
||
|
# libcronet.so may contain ARM Neon instructions from BoringSSL, but these
|
||
|
# are only used after checking whether the CPU supports NEON at runtime,
|
||
|
# so instead check base/ as it represents a large swath of code that only
|
||
|
# contains Neon instructions when Neon is enabled by default.
|
||
|
rebase_path("$root_out_dir/obj/base/base/*.o", root_build_dir),
|
||
|
"--stamp",
|
||
|
rebase_path(outputs[0], root_build_dir),
|
||
|
]
|
||
|
deps = [
|
||
|
"//base:base",
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
# Enforce restrictions for API<->impl boundary.
|
||
|
action("api_static_checks") {
|
||
|
script = "//components/cronet/tools/api_static_checks.py"
|
||
|
outputs = [
|
||
|
"$target_gen_dir/$target_name.stamp",
|
||
|
]
|
||
|
args = [
|
||
|
"--api_jar",
|
||
|
rebase_path(
|
||
|
"$root_out_dir/lib.java/components/cronet/android/cronet_api.jar",
|
||
|
root_build_dir),
|
||
|
"--impl_jar",
|
||
|
rebase_path(
|
||
|
"$root_out_dir/lib.java/components/cronet/android/cronet_impl_common_java.jar",
|
||
|
root_build_dir),
|
||
|
"--impl_jar",
|
||
|
rebase_path(
|
||
|
"$root_out_dir/lib.java/components/cronet/android/cronet_impl_platform_java.jar",
|
||
|
root_build_dir),
|
||
|
"--impl_jar",
|
||
|
rebase_path(
|
||
|
"$root_out_dir/lib.java/components/cronet/android/cronet_impl_native_java.jar",
|
||
|
root_build_dir),
|
||
|
"--stamp",
|
||
|
rebase_path(outputs[0], root_build_dir),
|
||
|
]
|
||
|
deps = [
|
||
|
":cronet_api_java",
|
||
|
":cronet_impl_common_java",
|
||
|
":cronet_impl_native_java",
|
||
|
":cronet_impl_platform_java",
|
||
|
]
|
||
|
inputs = [
|
||
|
"//components/cronet/tools/update_api.py",
|
||
|
]
|
||
|
sources = [
|
||
|
"//components/cronet/android/api.txt",
|
||
|
"//components/cronet/android/api_version.txt",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
group("cronet_package") {
|
||
|
# Marked as testonly as it contains test-only targets too.
|
||
|
testonly = true
|
||
|
|
||
|
# Enforce building with ICU alternatives, crbug.com/611621.
|
||
|
# Enforce that arm_use_neon==false when building for ARMv7 by
|
||
|
# not including any deps in cronet_package target otherwise.
|
||
|
if (use_platform_icu_alternatives &&
|
||
|
(!(target_cpu == "arm" && arm_version == 7) || !arm_use_neon)) {
|
||
|
deps = [
|
||
|
":api_static_checks",
|
||
|
":copy_cronet_java8_jars",
|
||
|
":cronet_package_copy",
|
||
|
":cronet_package_copy_native_lib",
|
||
|
":cronet_package_copy_native_lib_unstripped",
|
||
|
":cronet_package_copy_resources",
|
||
|
":cronet_test_package",
|
||
|
":generate_javadoc",
|
||
|
":generate_licenses",
|
||
|
":jar_cronet_api_source",
|
||
|
":jar_cronet_impl_common_java_source",
|
||
|
":jar_cronet_impl_native_java_source",
|
||
|
":jar_cronet_impl_platform_java_source",
|
||
|
":jar_cronet_sample_source",
|
||
|
":repackage_extracted_jars",
|
||
|
]
|
||
|
if (current_cpu == "arm" && arm_version == 7) {
|
||
|
deps += [ ":enforce_no_neon" ]
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
group("cronet_test_package") {
|
||
|
testonly = true
|
||
|
|
||
|
# Don't build for MIPS where tests aren't run.
|
||
|
if (current_cpu != "mipsel" && current_cpu != "mips64el") {
|
||
|
deps = [
|
||
|
":cronet_package_copy_native_test_lib",
|
||
|
":cronet_package_copy_native_test_lib_unstripped",
|
||
|
":cronet_package_copy_test_assets",
|
||
|
":cronet_package_copy_test_files",
|
||
|
":cronet_package_copy_test_support_apks",
|
||
|
":repackage_extracted_test_jars",
|
||
|
]
|
||
|
}
|
||
|
}
|