blob: 5fe7ac3a9661037d07e7d9ca547d28251bbc0702 [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 {
16 default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
Remi NGUYEN VANbe2a07f2021-03-29 17:09:13 +090019java_library {
20 name: "net-tests-utils",
21 srcs: [
22 "devicetests/**/*.java",
23 "devicetests/**/*.kt",
24 ],
Remi NGUYEN VAN2202e612021-03-30 07:56:39 +000025 defaults: [
26 "framework-connectivity-test-defaults",
27 "lib_mockito_extended"
28 ],
Remi NGUYEN VANbe2a07f2021-03-29 17:09:13 +090029 libs: [
30 "androidx.annotation_annotation",
Lorenzo Colitti167102d2022-02-02 02:18:38 +090031 "net-utils-device-common-bpf", // TestBpfMap extends IBpfMap.
Remi NGUYEN VANbe2a07f2021-03-29 17:09:13 +090032 ],
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",
Igor Chernyshev004c5b42023-01-05 19:25:18 -080039 "net-utils-device-common-async",
Xiao Ma57b34422021-07-01 13:57:02 +000040 "net-utils-device-common-netlink",
Igor Chernyshev810be2b2023-04-06 15:52:26 -070041 "net-utils-device-common-wear",
Chiachang Wang40803d42021-06-21 11:52:44 +080042 "modules-utils-build_system",
Remi NGUYEN VANbe2a07f2021-03-29 17:09:13 +090043 ],
Chiachang Wang7068c882021-11-19 15:37:30 +080044 lint: { strict_updatability_linting: true },
Remi NGUYEN VANbe2a07f2021-03-29 17:09:13 +090045}
46
47java_library {
Chalard Jeanb6fdf632021-11-22 19:28:34 +090048 // 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: [
Motomu Utsumic4800392023-09-11 11:48:36 +090058 "//packages/modules/Connectivity/staticlibs/tests:__subpackages__",
59 "//packages/modules/Connectivity/staticlibs/client-libs/tests:__subpackages__",
Junyu Laiaf464eb2023-07-26 14:41:33 +080060 "//packages/modules/Connectivity/tests/cts/hostside",
Chalard Jeanb6fdf632021-11-22 19:28:34 +090061 ],
Chalard Jeanfee2cab2021-11-25 19:54:31 +090062 // There are downstream branches using an old version of Kotlin
63 // that used to reserve the right to make breaking changes to the
Chalard Jeanb6fdf632021-11-22 19:28:34 +090064 // Result type and disallowed returning an instance of it.
65 // Later versions allowed this and there was never a change,
66 // so no matter the version returning Result is always fine,
67 // but on sc-mainline-prod the compiler rejects it without
68 // the following flag.
69 kotlincflags: ["-Xallow-result-return-type"],
70 libs: [
71 "jsr305",
72 ],
73 static_libs: [
74 "kotlin-test"
75 ],
76 lint: { strict_updatability_linting: true },
Remi NGUYEN VANbe2a07f2021-03-29 17:09:13 +090077}
Remi NGUYEN VANc02dcd72021-10-04 19:53:32 +090078
79java_test_host {
80 name: "net-tests-utils-host-common",
81 srcs: [
82 "host/**/*.java",
83 "host/**/*.kt",
84 ],
85 libs: ["tradefed"],
Nandu Suram8d88f8b2022-09-08 22:34:47 +000086 test_suites: ["ats", "device-tests", "general-tests", "cts", "mts-networking"],
Remi NGUYEN VANe2b52132023-04-25 15:49:10 +090087 data: [":ConnectivityTestPreparer"],
Remi NGUYEN VANc02dcd72021-10-04 19:53:32 +090088}