Remi NGUYEN VAN | be2a07f | 2021-03-29 17:09:13 +0900 | [diff] [blame] | 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 | |
Bob Badour | 9802148 | 2021-03-30 22:55:10 -0700 | [diff] [blame] | 15 | package { |
| 16 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 17 | } |
| 18 | |
Remi NGUYEN VAN | be2a07f | 2021-03-29 17:09:13 +0900 | [diff] [blame] | 19 | java_library { |
| 20 | name: "net-tests-utils", |
| 21 | srcs: [ |
| 22 | "devicetests/**/*.java", |
| 23 | "devicetests/**/*.kt", |
| 24 | ], |
Remi NGUYEN VAN | 2202e61 | 2021-03-30 07:56:39 +0000 | [diff] [blame] | 25 | defaults: [ |
| 26 | "framework-connectivity-test-defaults", |
| 27 | "lib_mockito_extended" |
| 28 | ], |
Remi NGUYEN VAN | be2a07f | 2021-03-29 17:09:13 +0900 | [diff] [blame] | 29 | libs: [ |
| 30 | "androidx.annotation_annotation", |
Lorenzo Colitti | 167102d | 2022-02-02 02:18:38 +0900 | [diff] [blame] | 31 | "net-utils-device-common-bpf", // TestBpfMap extends IBpfMap. |
Remi NGUYEN VAN | be2a07f | 2021-03-29 17:09:13 +0900 | [diff] [blame] | 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", |
Xiao Ma | 57b3442 | 2021-07-01 13:57:02 +0000 | [diff] [blame] | 39 | "net-utils-device-common-netlink", |
Chiachang Wang | 40803d4 | 2021-06-21 11:52:44 +0800 | [diff] [blame] | 40 | "modules-utils-build_system", |
Remi NGUYEN VAN | be2a07f | 2021-03-29 17:09:13 +0900 | [diff] [blame] | 41 | ], |
Chiachang Wang | 7068c88 | 2021-11-19 15:37:30 +0800 | [diff] [blame] | 42 | lint: { strict_updatability_linting: true }, |
Remi NGUYEN VAN | be2a07f | 2021-03-29 17:09:13 +0900 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | java_library { |
Chalard Jean | b6fdf63 | 2021-11-22 19:28:34 +0900 | [diff] [blame] | 46 | // Consider using net-tests-utils instead if writing device code. |
| 47 | // That library has a lot more useful tools into it for users that |
| 48 | // work on Android and includes this lib. |
| 49 | name: "net-tests-utils-host-device-common", |
| 50 | srcs: [ |
| 51 | "hostdevice/**/*.java", |
| 52 | "hostdevice/**/*.kt", |
| 53 | ], |
| 54 | host_supported: true, |
| 55 | visibility: [ |
| 56 | "//frameworks/libs/net/common/tests:__subpackages__", |
| 57 | "//frameworks/libs/net/client-libs/tests:__subpackages__", |
| 58 | ], |
Chalard Jean | fee2cab | 2021-11-25 19:54:31 +0900 | [diff] [blame] | 59 | // There are downstream branches using an old version of Kotlin |
| 60 | // that used to reserve the right to make breaking changes to the |
Chalard Jean | b6fdf63 | 2021-11-22 19:28:34 +0900 | [diff] [blame] | 61 | // Result type and disallowed returning an instance of it. |
| 62 | // Later versions allowed this and there was never a change, |
| 63 | // so no matter the version returning Result is always fine, |
| 64 | // but on sc-mainline-prod the compiler rejects it without |
| 65 | // the following flag. |
| 66 | kotlincflags: ["-Xallow-result-return-type"], |
| 67 | libs: [ |
| 68 | "jsr305", |
| 69 | ], |
| 70 | static_libs: [ |
| 71 | "kotlin-test" |
| 72 | ], |
| 73 | lint: { strict_updatability_linting: true }, |
Remi NGUYEN VAN | be2a07f | 2021-03-29 17:09:13 +0900 | [diff] [blame] | 74 | } |
Remi NGUYEN VAN | c02dcd7 | 2021-10-04 19:53:32 +0900 | [diff] [blame] | 75 | |
| 76 | java_test_host { |
| 77 | name: "net-tests-utils-host-common", |
| 78 | srcs: [ |
| 79 | "host/**/*.java", |
| 80 | "host/**/*.kt", |
| 81 | ], |
| 82 | libs: ["tradefed"], |
Nandu Suram | 8d88f8b | 2022-09-08 22:34:47 +0000 | [diff] [blame] | 83 | test_suites: ["ats", "device-tests", "general-tests", "cts", "mts-networking"], |
Remi NGUYEN VAN | c02dcd7 | 2021-10-04 19:53:32 +0900 | [diff] [blame] | 84 | data: [":ConnectivityChecker"], |
| 85 | } |