// Copyright (C) 2025 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/licenses/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. soong_config_module_type { name: "enable_cronet_tot_java_defaults", module_type: "java_defaults", config_namespace: "cronet", bool_variables: [ "enable_cronet_tot", ], properties: [ "static_libs", "jni_libs", "asset_dirs", "resource_dirs", "data", "srcs", ], } soong_config_module_type { name: "enable_cronet_tot_apex_defaults", module_type: "apex_defaults", config_namespace: "cronet", bool_variables: [ "enable_cronet_tot", ], properties: [ "jni_libs", ], } soong_config_module_type { name: "enable_cronet_tot_license", module_type: "license", config_namespace: "cronet", bool_variables: [ "enable_cronet_tot", ], properties: [ "license_text", ], } soong_config_bool_variable { name: "enable_cronet_tot", } enable_cronet_tot_java_defaults { name: "cronet_api", soong_config_variables: { enable_cronet_tot: { static_libs: [ "tot_cronet_components_cronet_android_cronet_api_java", ], conditions_default: { static_libs: [ "stable_cronet_components_cronet_android_cronet_api_java", ], }, }, }, } enable_cronet_tot_java_defaults { name: "cronet_impl", soong_config_variables: { enable_cronet_tot: { static_libs: [ "tot_cronet_components_cronet_android_cronet_impl_native_java", "tot_cronet_components_cronet_android_cronet_jni_registration_java", ], conditions_default: { static_libs: [ "stable_cronet_components_cronet_android_cronet_impl_native_java", "stable_cronet_components_cronet_android_cronet_jni_registration_java", ], }, }, }, } enable_cronet_tot_java_defaults { name: "cronet_testing", soong_config_variables: { enable_cronet_tot: { static_libs: [ "tot_cronet_components_cronet_android_cronet_impl_native_java__testing", "tot_cronet_components_cronet_android_cronet_jni_registration_java__testing", "tot_cronet_components_cronet_android_cronet_tests_jni_registration_java__testing", ], conditions_default: { static_libs: [ "stable_cronet_components_cronet_android_cronet_impl_native_java__testing", "stable_cronet_components_cronet_android_cronet_jni_registration_java__testing", "stable_cronet_components_cronet_android_cronet_tests_jni_registration_java__testing", ], }, }, }, } enable_cronet_tot_license { name: "external_cronet_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", ], soong_config_variables: { enable_cronet_tot: { license_text: [ "tot/LICENSE", ], conditions_default: { license_text: [ "stable/LICENSE", ], }, } } } java_library { // Don't change the name of the module. name: "cronet_aml_api_java", defaults: [ "cronet_api", ], sdk_version: "module_current", min_sdk_version: "30", visibility: [ "//packages/modules/Connectivity:__subpackages__", "//external/cronet/android:__subpackages__", ], apex_available: [ "com.android.tethering", ], } java_library { // Don't change the name of the module. name: "cronet_aml_java", defaults: [ "cronet_impl", ], 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: "cronet_aml_java__testing", defaults: [ "cronet_testing", ], sdk_version: "module_current", min_sdk_version: "30", visibility: [ "//external/cronet/android:__subpackages__", ], apex_available: [ "com.android.tethering", ], } enable_cronet_tot_java_defaults { name: "cronet_native_unittests_defaults", defaults: [ "mts-target-sdk-version-current", ], aaptflags: ["-0 .dat"], compile_multilib: "both", min_sdk_version: "31", // b/270049141 soong_config_variables: { enable_cronet_tot: { asset_dirs: [ "tot/third_party/icu/android", ], static_libs: [ "tot_cronet_testing_android_native_test_native_test_java__testing", "cronet_aml_java__testing", "androidx.annotation_annotation", "junit", ], conditions_default: { asset_dirs: [ "stable/third_party/icu/android", ], static_libs: [ "stable_cronet_testing_android_native_test_native_test_java__testing", "cronet_aml_java__testing", "androidx.annotation_annotation", "junit", ], }, }, }, } enable_cronet_tot_java_defaults { name: "cronet_native_net_unittests_defaults", soong_config_variables: { enable_cronet_tot: { jni_libs: [ "tot_cronet_net_net_unittests__library__testing", ], static_libs: ["tot_cronet_for_testing_net_java"], resource_dirs: [ "tot/net/android/unittest_support/res", ], conditions_default: { jni_libs: [ "stable_cronet_net_net_unittests__library__testing", ], static_libs: ["stable_cronet_for_testing_net_java"], resource_dirs: [ "stable/net/android/unittest_support/res", ], }, }, }, } enable_cronet_tot_apex_defaults { name: "CronetInTetheringApexDefaults", soong_config_variables: { enable_cronet_tot: { jni_libs: [ "tot_cronet_components_cronet_android_cronet", "tot_cronet_libcrypto", "tot_cronet_libssl", ], conditions_default: { jni_libs: [ "stable_cronet_components_cronet_android_cronet", "stable_cronet_libcrypto", "stable_cronet_libssl", ], }, }, }, } enable_cronet_tot_java_defaults { name: "cronet_aml_components_cronet_android_api_version", soong_config_variables: { enable_cronet_tot: { srcs: [ ":tot_cronet_components_cronet_android_api_version", ], conditions_default: { srcs: [ ":stable_cronet_components_cronet_android_api_version", ], }, }, }, } enable_cronet_tot_java_defaults { name: "cronet_java_tests", soong_config_variables: { enable_cronet_tot: { static_libs: [ "tot_cronet_java_tests", ], jni_libs: [ "tot_cronet_components_cronet_android_cronet_tests__testing", "tot_cronet_components_cronet_android_cronet__testing", "tot_cronet_third_party_netty_tcnative_netty_tcnative_so__testing", ], data: [":tot_cronet_javatests_resources"], conditions_default: { static_libs: [ "stable_cronet_java_tests", ], jni_libs: [ "stable_cronet_components_cronet_android_cronet_tests__testing", "stable_cronet_components_cronet_android_cronet__testing", "stable_cronet_third_party_netty_tcnative_netty_tcnative_so__testing", ], data: [":stable_cronet_javatests_resources"], }, }, }, } enable_cronet_tot_java_defaults { name: "net_unittests_data", soong_config_variables: { enable_cronet_tot: { data: [ ":tot_cronet_net_unittests_data", ], conditions_default: { data: [ ":stable_cronet_net_unittests_data", ], }, }, }, } android_test_helper_app { name: "cronet_tester_app", defaults: [ "cronet_native_unittests_defaults", ], jni_libs: select(release_flag("RELEASE_ENABLE_TOT_CRONET"), { true: [ "tot_cronet_components_cronet_android_cronet_unittests_android__library__testing", ], default: [ "stable_cronet_components_cronet_android_cronet_unittests_android__library__testing", ], }), manifest: "test_runner/AndroidManifest.xml", } // This is required to keep testing Cronet Stable. TH does not support, trivially, presubmit // testing of non-trunk_staging targets. In trunk_staging, Cronet ToT is "selected", while // Stable is selected everywhere else. To circumvent that, we expose a targets which are // always backed by Cronet Stable (hence the stable_ prefix). android_test_helper_app { name: "stable_cronet_tester_app", defaults: [ "mts-target-sdk-version-current", ], aaptflags: ["-0 .dat"], compile_multilib: "both", min_sdk_version: "31", // b/270049141 asset_dirs: [ "stable/third_party/icu/android", ], static_libs: [ "stable_cronet_testing_android_native_test_native_test_java__testing", "stable_cronet_components_cronet_android_cronet_impl_native_java__testing", "stable_cronet_components_cronet_android_cronet_jni_registration_java__testing", "stable_cronet_components_cronet_android_cronet_tests_jni_registration_java__testing", "androidx.annotation_annotation", "junit", ], jni_libs: [ "stable_cronet_components_cronet_android_cronet_unittests_android__library__testing", ], manifest: "test_runner/AndroidManifest.xml", } android_test_helper_app { name: "cronet_net_tester_app", defaults: [ "cronet_native_unittests_defaults", "cronet_native_net_unittests_defaults", ], manifest: "test_runner/AndroidNetManifest.xml", } // This is required to keep testing Cronet Stable. TH does not support, trivially, presubmit // testing of non-trunk_staging targets. In trunk_staging, Cronet ToT is "selected", while // Stable is selected everywhere else. To circumvent that, we expose a targets which are // always backed by Cronet Stable (hence the stable_ prefix). android_test_helper_app { name: "stable_cronet_net_tester_app", defaults: [ "mts-target-sdk-version-current", ], aaptflags: ["-0 .dat"], compile_multilib: "both", min_sdk_version: "31", // b/270049141 asset_dirs: [ "stable/third_party/icu/android", ], static_libs: [ "stable_cronet_testing_android_native_test_native_test_java__testing", "stable_cronet_components_cronet_android_cronet_impl_native_java__testing", "stable_cronet_components_cronet_android_cronet_jni_registration_java__testing", "stable_cronet_components_cronet_android_cronet_tests_jni_registration_java__testing", "androidx.annotation_annotation", "stable_cronet_for_testing_net_java", "junit", ], jni_libs: [ "stable_cronet_net_net_unittests__library__testing", ], manifest: "test_runner/AndroidNetManifest.xml", resource_dirs: [ "stable/net/android/unittest_support/res", ], }