blob: 8be732452228086e3c3b1e5d573e799511d9d4e7 [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// ==========================================
75// This is only intended for inclusion in the android.test.runner-minus-junit,
76// robolectric_android-all-stub and repackaged.android.test.* libraries.
Paul Duffin79d7ba22019-02-25 19:18:37 +000077// Must not be used elsewhere.
Sundong Ahne933ced2018-07-31 16:54:41 +090078java_library_static {
79 name: "android.test.base_static",
80 installable: false,
81
Anton Hansson2e25fdc2021-05-10 12:40:05 +010082 srcs: [":android-test-base-sources"],
Sundong Ahne933ced2018-07-31 16:54:41 +090083
84 errorprone: {
85 javacflags: ["-Xep:DepAnn:ERROR"],
86 },
87
Tobias Thiererd65595a2018-02-05 15:49:52 +000088 // Needs to be consistent with the repackaged version of this make target.
89 java_version: "1.8",
90
Paul Duffin4cdec672018-02-14 10:36:16 +000091 sdk_version: "current",
Paul Duffine95a8952017-11-16 15:53:09 +000092}
93
Paul Duffine95a8952017-11-16 15:53:09 +000094// Build the repackaged.android.test.base library
95// ==============================================
Paul Duffinb36eb542018-01-15 15:47:47 +000096// This contains repackaged versions of the classes from
97// android.test.base.
Colin Crossfc7ba9e2017-12-07 13:11:06 -080098java_library_static {
Paul Duffine95a8952017-11-16 15:53:09 +000099 name: "repackaged.android.test.base",
Colin Crossfc7ba9e2017-12-07 13:11:06 -0800100
Paul Duffin4cdec672018-02-14 10:36:16 +0000101 sdk_version: "current",
Sundong Ahne933ced2018-07-31 16:54:41 +0900102 static_libs: ["android.test.base_static"],
Colin Crossfc7ba9e2017-12-07 13:11:06 -0800103
104 jarjar_rules: "jarjar-rules.txt",
Tobias Thiererd65595a2018-02-05 15:49:52 +0000105 // Pin java_version until jarjar is certified to support later versions. http://b/72703434
106 java_version: "1.8",
Colin Crossfc7ba9e2017-12-07 13:11:06 -0800107}
108
Paul Duffinbee7cce2018-01-05 15:11:18 +0000109// Build the android.test.base-minus-junit library
110// ===============================================
111// This contains the android.test classes from android.test.base plus
112// the com.android.internal.util.Predicate[s] classes. This is only
Paul Duffin67668962021-01-27 11:32:54 +0000113// intended for inclusion in android.test.legacy and in
114// android.test.base-hiddenapi-annotations to avoid a dependency cycle and must
115// not be used elsewhere.
Paul Duffinbee7cce2018-01-05 15:11:18 +0000116java_library_static {
117 name: "android.test.base-minus-junit",
118
119 srcs: [
120 "src/android/**/*.java",
121 "src/com/**/*.java",
122 ],
123
124 sdk_version: "current",
125 libs: [
126 "junit",
127 ],
128}
Nan Zhang3fece482018-04-13 14:48:32 -0700129
Anton Hansson2e25fdc2021-05-10 12:40:05 +0100130filegroup {
131 name: "android-test-base-sources",
132 srcs: ["src/**/*.java"],
133 path: "src",
134}
135
Paul Duffincd35de32019-05-30 15:12:47 +0100136// Make the current.txt available for use by the cts/tests/signature tests.
137// ========================================================================
138filegroup {
139 name: "android-test-base-current.txt",
140 visibility: [
141 "//cts/tests/signature/api",
142 ],
143 srcs: [
144 "api/current.txt",
145 ],
146}