blob: 440f5ca3593f0f068a3dbdac17cf23c885a9885b [file] [log] [blame]
Remi NGUYEN VANbe2a07f2021-03-29 17:09:13 +09001// 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 Badour98021482021-03-30 22:55:10 -070015package {
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000016 default_team: "trendy_team_fwk_core_networking",
Bob Badour98021482021-03-30 22:55:10 -070017 default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
Remi NGUYEN VANbe2a07f2021-03-29 17:09:13 +090020java_library {
21 name: "net-tests-utils",
22 srcs: [
23 "devicetests/**/*.java",
24 "devicetests/**/*.kt",
25 ],
Remi NGUYEN VAN2202e612021-03-30 07:56:39 +000026 defaults: [
27 "framework-connectivity-test-defaults",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000028 "lib_mockito_extended",
Remi NGUYEN VAN2202e612021-03-30 07:56:39 +000029 ],
Remi NGUYEN VANbe2a07f2021-03-29 17:09:13 +090030 libs: [
31 "androidx.annotation_annotation",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000032 "net-utils-device-common-bpf", // TestBpfMap extends IBpfMap.
Remi NGUYEN VANbe2a07f2021-03-29 17:09:13 +090033 ],
34 static_libs: [
35 "androidx.test.ext.junit",
36 "kotlin-reflect",
37 "libnanohttpd",
38 "net-tests-utils-host-device-common",
39 "net-utils-device-common",
Igor Chernyshev004c5b42023-01-05 19:25:18 -080040 "net-utils-device-common-async",
Xiao Ma57b34422021-07-01 13:57:02 +000041 "net-utils-device-common-netlink",
Junyu Lai626045a2023-08-28 18:49:44 +080042 "net-utils-device-common-struct",
Yang Sun3aa62e62024-03-12 21:23:19 +080043 "net-utils-device-common-struct-base",
Igor Chernyshev810be2b2023-04-06 15:52:26 -070044 "net-utils-device-common-wear",
Handa Wang9b0df362024-07-02 13:17:43 +000045 "net-utils-framework-connectivity",
Chiachang Wang40803d42021-06-21 11:52:44 +080046 "modules-utils-build_system",
Remi NGUYEN VANbe2a07f2021-03-29 17:09:13 +090047 ],
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000048 lint: {
49 strict_updatability_linting: true,
50 },
Remi NGUYEN VANbe2a07f2021-03-29 17:09:13 +090051}
52
53java_library {
Chalard Jeanb6fdf632021-11-22 19:28:34 +090054 // Consider using net-tests-utils instead if writing device code.
55 // That library has a lot more useful tools into it for users that
56 // work on Android and includes this lib.
57 name: "net-tests-utils-host-device-common",
58 srcs: [
59 "hostdevice/**/*.java",
60 "hostdevice/**/*.kt",
61 ],
62 host_supported: true,
63 visibility: [
Motomu Utsumic4800392023-09-11 11:48:36 +090064 "//packages/modules/Connectivity/staticlibs/tests:__subpackages__",
65 "//packages/modules/Connectivity/staticlibs/client-libs/tests:__subpackages__",
Junyu Laiaf464eb2023-07-26 14:41:33 +080066 "//packages/modules/Connectivity/tests/cts/hostside",
Chalard Jeanb6fdf632021-11-22 19:28:34 +090067 ],
Chalard Jeanfee2cab2021-11-25 19:54:31 +090068 // There are downstream branches using an old version of Kotlin
69 // that used to reserve the right to make breaking changes to the
Chalard Jeanb6fdf632021-11-22 19:28:34 +090070 // Result type and disallowed returning an instance of it.
71 // Later versions allowed this and there was never a change,
72 // so no matter the version returning Result is always fine,
73 // but on sc-mainline-prod the compiler rejects it without
74 // the following flag.
75 kotlincflags: ["-Xallow-result-return-type"],
76 libs: [
77 "jsr305",
78 ],
79 static_libs: [
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000080 "kotlin-test",
Chalard Jeanb6fdf632021-11-22 19:28:34 +090081 ],
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000082 lint: {
83 strict_updatability_linting: true,
84 },
Remi NGUYEN VANbe2a07f2021-03-29 17:09:13 +090085}
Remi NGUYEN VANc02dcd72021-10-04 19:53:32 +090086
87java_test_host {
88 name: "net-tests-utils-host-common",
89 srcs: [
Junyu Lai79b771f2024-06-27 10:31:19 +080090 "host/java/**/*.java",
91 "host/java/**/*.kt",
Remi NGUYEN VANc02dcd72021-10-04 19:53:32 +090092 ],
93 libs: ["tradefed"],
Tongbo Liu199357b2023-12-19 10:50:05 +000094 test_suites: [
95 "ats",
96 "device-tests",
97 "general-tests",
98 "cts",
99 "mts-networking",
Tongbo Liu47524102024-01-23 09:24:45 +0000100 "mts-tethering",
Tongbo Liu17ab27e2024-12-02 03:11:19 +0000101 "mcts-tethering",
Tongbo Liu199357b2023-12-19 10:50:05 +0000102 ],
Remi NGUYEN VANe2b52132023-04-25 15:49:10 +0900103 data: [":ConnectivityTestPreparer"],
Remi NGUYEN VANc02dcd72021-10-04 19:53:32 +0900104}
Junyu Lai79b771f2024-06-27 10:31:19 +0800105
106python_library_host {
107 name: "net-tests-utils-host-python-common",
108 srcs: [
109 "host/python/*.py",
110 ],
111 pkg_path: "net_tests_utils",
112}