blob: c28f3278f395dacebdfd710a8a87862e52370777 [file]
// Copyright (C) 2023 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licensNew.javaues/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
license {
name: "${GN2BP_MODULE_PREFIX}license",
license_kinds: [
"SPDX-license-identifier-Apache-2.0",
"SPDX-license-identifier-BSD",
"SPDX-license-identifier-BSD-3-Clause",
"SPDX-license-identifier-BSD-Source-Code",
"SPDX-license-identifier-BSD-2-Clause",
"SPDX-license-identifier-BSD-4-Clause",
"SPDX-license-identifier-BSL-1.0",
"SPDX-license-identifier-ICU",
"SPDX-license-identifier-ISC",
"SPDX-license-identifier-MIT",
"SPDX-license-identifier-MPL",
"SPDX-license-identifier-MPL-1.1",
"SPDX-license-identifier-MPL-2.0",
"SPDX-license-identifier-NCSA",
"SPDX-license-identifier-Zlib",
// "SPDX-license-identifier-GPL-2.0-with-autoconf-exception", // ICU TODO(aymanm): Reapply those once aosp/2470343 is merged
// "SPDX-license-identifier-GPL-3.0-with-autoconf-exception", // ICU TODO(aymanm): Reapply those once aosp/2470343 is merged
"SPDX-license-identifier-OpenSSL",
"SPDX-license-identifier-Unicode-DFS-2016",
"legacy_unencumbered",
],
license_text: [
"LICENSE",
],
}
java_library {
name: "${GN2BP_MODULE_PREFIX}api_java",
static_libs: [
"${GN2BP_MODULE_PREFIX}components_cronet_android_cronet_api_java",
],
sdk_version: "module_current",
min_sdk_version: "30",
visibility: [
"//packages/modules/Connectivity:__subpackages__",
"//external/cronet/android:__subpackages__",
],
apex_available: [
"com.android.tethering",
],
}
java_library {
name: "${GN2BP_MODULE_PREFIX}java",
static_libs: [
"${GN2BP_MODULE_PREFIX}components_cronet_android_cronet_build_config_java",
"${GN2BP_MODULE_PREFIX}components_cronet_android_cronet_impl_native_java",
"${GN2BP_MODULE_PREFIX}components_cronet_android_cronet_jni_registration_java",
],
sdk_version: "module_current",
min_sdk_version: "30",
visibility: [
"//external/cronet:__subpackages__",
],
apex_available: [
"com.android.tethering",
],
}
java_library {
name: "${GN2BP_MODULE_PREFIX}java__testing",
static_libs: [
"${GN2BP_MODULE_PREFIX}components_cronet_android_cronet_build_config_java__testing",
"${GN2BP_MODULE_PREFIX}components_cronet_android_cronet_impl_native_java__testing",
"${GN2BP_MODULE_PREFIX}components_cronet_android_cronet_jni_registration_java__testing",
"${GN2BP_MODULE_PREFIX}components_cronet_android_cronet_tests_jni_registration_java__testing",
],
sdk_version: "module_current",
min_sdk_version: "30",
visibility: [
"//external/cronet:__subpackages__",
],
apex_available: [
"com.android.tethering",
],
}
// ------------------------------ NATIVE TEST TARGETS --------------------------------------------
java_library {
name: "${GN2BP_MODULE_PREFIX}for_testing_net_java",
static_libs: [
"${GN2BP_MODULE_PREFIX}net_android_net_test_support_provider_java__testing",
"${GN2BP_MODULE_PREFIX}net_android_net_java_test_support__testing",
"${GN2BP_MODULE_PREFIX}net_android_net_tests_java__testing",
"${GN2BP_MODULE_PREFIX}net_android_dummy_spnego_authenticator_java__testing",
],
}
filegroup {
name: "${GN2BP_MODULE_PREFIX}net_unittests_data",
srcs: [
"net/data/**/*",
"net/third_party/quiche/src/quiche/common/platform/api/testdir/**/*",
"third_party/anonymous_tokens/src/anonymous_tokens/testdata/**/*",
],
}
filegroup {
name: "${GN2BP_MODULE_PREFIX}javatests_resources",
srcs: [
"net/data/ssl/certificates/**/*",
"components/cronet/android/test/test_server/data/**/*",
],
visibility: [
"//external/cronet:__subpackages__",
],
}
android_library {
name: "${GN2BP_MODULE_PREFIX}java_tests",
manifest: "components/cronet/android/test/src/org/chromium/net/AndroidManifest.xml",
sdk_version: "module_current",
min_sdk_version: "30",
static_libs: [
"${GN2BP_MODULE_PREFIX}components_cronet_android_cronet_javatests__testing",
"androidx.test.ext.junit",
"androidx.test.rules",
"${GN2BP_MODULE_PREFIX}java__testing",
"guava",
"hamcrest-library",
"junit",
"net-tests-utils",
"truth",
],
libs: [
"android.test.base.stubs.system",
"${GN2BP_MODULE_PREFIX}api_java",
"framework-connectivity.stubs.module_lib",
"framework-connectivity-pre-jarjar",
// android.net.TrafficStats apis
"framework-connectivity-t.stubs.module_lib",
"guava",
],
lint: {
test: true,
},
visibility: [
"//external/cronet:__subpackages__",
],
}
java_defaults {
name: "${GN2BP_MODULE_PREFIX}java_framework_defaults",
sdk_version: "module_current",
libs: [
"framework-connectivity-pre-jarjar-without-cronet",
"framework-connectivity.stubs.module_lib",
"framework-connectivity-t.stubs.module_lib",
"framework-location.stubs.module_lib",
"framework-mediaprovider.stubs.module_lib",
"framework-statsd.stubs.module_lib",
"framework-wifi.stubs.module_lib",
"framework-sdkextensions.stubs.module_lib",
] + select(release_flag("RELEASE_CONSCRYPT_NSC"), {
true: ["framework-conscrypt-nsc.stubs"],
default: ["framework-network-security-config.stubs.module_lib"],
}),
visibility: [
"//external/cronet:__subpackages__",
],
}
// rust_bindgen modules do not have an `include_dirs` attribute. Due to that,
// C++ headers generated from rust_bindgen can't reference other headers
// through paths relative to the repository root. This is what Chromium does
// so, to circumvent this issue, create this module that adds the root of the
// repository to `include_dirs`. This will be added to all modules depending
// on a rust_bindgen module.
cc_library_headers {
name: "${GN2BP_MODULE_PREFIX}repository_root_include_dirs_anchor",
host_supported: true,
apex_available: [
"com.android.tethering",
],
min_sdk_version: "30",
export_include_dirs: ["."],
visibility: [
"//external/cronet:__subpackages__",
],
}
android_test {
name: "${GN2BP_MODULE_PREFIX}NetHttpCoverageTests",
enforce_default_target_sdk_version: true,
min_sdk_version: "30",
test_suites: [
"general-tests",
"mts-tethering",
],
static_libs: [
"modules-utils-native-coverage-listener",
"CtsNetHttpTestsLib",
"${GN2BP_MODULE_PREFIX}api_java",
"${GN2BP_MODULE_PREFIX}java__testing",
"${GN2BP_MODULE_PREFIX}java_tests",
],
compile_multilib: "both", // Include both the 32 and 64 bit versions
jni_libs: [
"libnativecoverage",
"${GN2BP_MODULE_PREFIX}components_cronet_android_cronet_tests__testing",
"${GN2BP_MODULE_PREFIX}components_cronet_android_cronet__testing",
"${GN2BP_MODULE_PREFIX}third_party_netty_tcnative_netty_tcnative_so__testing",
],
test_config: "AndroidTest.xml",
data: [":${GN2BP_MODULE_PREFIX}javatests_resources"],
manifest: "components/cronet/android/test/javatests/AndroidManifest.xml",
resource_dirs: ["components/cronet/android/test/res"],
}