1// Copyright (C) 2021 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package { 16 default_applicable_licenses: ["Android-Apache-2.0"], 17} 18 19java_library { 20 name: "net-tests-utils", 21 srcs: [ 22 "devicetests/**/*.java", 23 "devicetests/**/*.kt", 24 ], 25 defaults: [ 26 "framework-connectivity-test-defaults", 27 "lib_mockito_extended" 28 ], 29 libs: [ 30 "androidx.annotation_annotation", 31 "net-utils-device-common-bpf", // TestBpfMap extends IBpfMap. 32 ], 33 static_libs: [ 34 "androidx.test.ext.junit", 35 "kotlin-reflect", 36 "libnanohttpd", 37 "net-tests-utils-host-device-common", 38 "net-utils-device-common", 39 "net-utils-device-common-async", 40 "net-utils-device-common-netlink", 41 "net-utils-device-common-wear", 42 "modules-utils-build_system", 43 ], 44 lint: { strict_updatability_linting: true }, 45} 46 47java_library { 48 // Consider using net-tests-utils instead if writing device code. 49 // That library has a lot more useful tools into it for users that 50 // work on Android and includes this lib. 51 name: "net-tests-utils-host-device-common", 52 srcs: [ 53 "hostdevice/**/*.java", 54 "hostdevice/**/*.kt", 55 ], 56 host_supported: true, 57 visibility: [ 58 "//frameworks/libs/net/common/tests:__subpackages__", 59 "//frameworks/libs/net/client-libs/tests:__subpackages__", 60 ], 61 // There are downstream branches using an old version of Kotlin 62 // that used to reserve the right to make breaking changes to the 63 // Result type and disallowed returning an instance of it. 64 // Later versions allowed this and there was never a change, 65 // so no matter the version returning Result is always fine, 66 // but on sc-mainline-prod the compiler rejects it without 67 // the following flag. 68 kotlincflags: ["-Xallow-result-return-type"], 69 libs: [ 70 "jsr305", 71 ], 72 static_libs: [ 73 "kotlin-test" 74 ], 75 lint: { strict_updatability_linting: true }, 76} 77 78java_test_host { 79 name: "net-tests-utils-host-common", 80 srcs: [ 81 "host/**/*.java", 82 "host/**/*.kt", 83 ], 84 libs: ["tradefed"], 85 test_suites: ["ats", "device-tests", "general-tests", "cts", "mts-networking"], 86 data: [":ConnectivityChecker"], 87} 88