blob: 527159a78ebf25623eb7bbf6ff3dd73b9dc45fce [file] [log] [blame]
Colin Crossfc7ba9e2017-12-07 13:11:06 -08001//
2// Copyright (C) 2016 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
Paul Duffine95a8952017-11-16 15:53:09 +000017// Build the android.test.base library
18// ===================================
19// This contains the junit.framework and android.test classes that were in
20// Android API level 25 excluding those from android.test.runner.
21// Also contains the com.android.internal.util.Predicate[s] classes.
Bob Badour051ef782021-02-12 17:07:05 -080022package {
23 // See: http://go/android-license-faq
24 // A large-scale-change added 'default_applicable_licenses' to import
25 // all of the 'license_kinds' from "frameworks_base_license"
26 // to get the below license kinds:
27 // SPDX-license-identifier-Apache-2.0
28 // SPDX-license-identifier-CPL-1.0
Colin Crossc1309ec2022-01-10 21:16:59 -080029 default_applicable_licenses: ["frameworks_base_test-base_license"],
30}
31
32license {
33 name: "frameworks_base_test-base_license",
34 visibility: [":__subpackages__"],
35 license_kinds: [
36 "SPDX-license-identifier-Apache-2.0",
37 "SPDX-license-identifier-CPL-1.0",
38 ],
39 license_text: [
40 "src/junit/cpl-v10.html",
41 ],
Bob Badour051ef782021-02-12 17:07:05 -080042}
43
Sundong Ahne933ced2018-07-31 16:54:41 +090044java_sdk_library {
Paul Duffine95a8952017-11-16 15:53:09 +000045 name: "android.test.base",
46
Anton Hansson2e25fdc2021-05-10 12:40:05 +010047 srcs: [":android-test-base-sources"],
Paul Duffine95a8952017-11-16 15:53:09 +000048
Paul Duffin2d86c7a2018-02-16 13:11:05 +000049 errorprone: {
Paul Duffincd35de32019-05-30 15:12:47 +010050 javacflags: ["-Xep:DepAnn:ERROR"],
Paul Duffin2d86c7a2018-02-16 13:11:05 +000051 },
52
Sundong Ahne933ced2018-07-31 16:54:41 +090053 hostdex: true,
54
55 api_packages: [
56 "android.test",
57 "android.test.suitebuilder.annotation",
58 "com.android.internal.util",
59 "junit.framework",
60 ],
61
Sundong Ahne933ced2018-07-31 16:54:41 +090062 compile_dex: true,
Jiyong Park912db8d2020-05-29 10:51:18 +090063 default_to_stubs: true,
Paul Duffin67668962021-01-27 11:32:54 +000064
65 // Additional hiddenapi annotations are provided in a separate module.
66 // TODO(b/180295980) - investigate whether this can be removed
67 hiddenapi_additional_annotations: [
68 "android.test.base-hiddenapi-annotations",
69 ],
Colin Cross5959ec02021-05-10 10:38:53 -070070 dist_group: "android",
Sundong Ahne933ced2018-07-31 16:54:41 +090071}
72
73// Build the android.test.base_static library
74// ==========================================
Paul Duffinf404f1d2022-01-31 17:15:49 +000075// This is only intended for use by the android.test.runner-minus-junit
76// library.
77//
Paul Duffin79d7ba22019-02-25 19:18:37 +000078// Must not be used elsewhere.
Paul Duffinf404f1d2022-01-31 17:15:49 +000079//
Sundong Ahne933ced2018-07-31 16:54:41 +090080java_library_static {
81 name: "android.test.base_static",
Paul Duffinf404f1d2022-01-31 17:15:49 +000082 visibility: [
83 "//frameworks/base/test-runner",
84 ],
Sundong Ahne933ced2018-07-31 16:54:41 +090085 installable: false,
86
Anton Hansson2e25fdc2021-05-10 12:40:05 +010087 srcs: [":android-test-base-sources"],
Sundong Ahne933ced2018-07-31 16:54:41 +090088
89 errorprone: {
90 javacflags: ["-Xep:DepAnn:ERROR"],
91 },
92
Tobias Thiererd65595a2018-02-05 15:49:52 +000093 // Needs to be consistent with the repackaged version of this make target.
94 java_version: "1.8",
95
Paul Duffin4cdec672018-02-14 10:36:16 +000096 sdk_version: "current",
Paul Duffine95a8952017-11-16 15:53:09 +000097}
98
Paul Duffinbee7cce2018-01-05 15:11:18 +000099// Build the android.test.base-minus-junit library
100// ===============================================
101// This contains the android.test classes from android.test.base plus
Paul Duffinf404f1d2022-01-31 17:15:49 +0000102// the com.android.internal.util.Predicate[s] classes.
Paul Duffinbee7cce2018-01-05 15:11:18 +0000103java_library_static {
104 name: "android.test.base-minus-junit",
105
106 srcs: [
107 "src/android/**/*.java",
108 "src/com/**/*.java",
109 ],
110
111 sdk_version: "current",
112 libs: [
113 "junit",
114 ],
115}
Nan Zhang3fece482018-04-13 14:48:32 -0700116
Anton Hansson2e25fdc2021-05-10 12:40:05 +0100117filegroup {
118 name: "android-test-base-sources",
119 srcs: ["src/**/*.java"],
120 path: "src",
121}
122
Paul Duffincd35de32019-05-30 15:12:47 +0100123// Make the current.txt available for use by the cts/tests/signature tests.
124// ========================================================================
125filegroup {
126 name: "android-test-base-current.txt",
127 visibility: [
128 "//cts/tests/signature/api",
129 ],
130 srcs: [
131 "api/current.txt",
132 ],
133}