blob: b58aa11597c24bd279148062300bc852168777d3 [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
29 default_applicable_licenses: ["frameworks_base_license"],
30}
31
Sundong Ahne933ced2018-07-31 16:54:41 +090032java_sdk_library {
Paul Duffine95a8952017-11-16 15:53:09 +000033 name: "android.test.base",
34
Anton Hansson2e25fdc2021-05-10 12:40:05 +010035 srcs: [":android-test-base-sources"],
Paul Duffine95a8952017-11-16 15:53:09 +000036
Paul Duffin2d86c7a2018-02-16 13:11:05 +000037 errorprone: {
Paul Duffincd35de32019-05-30 15:12:47 +010038 javacflags: ["-Xep:DepAnn:ERROR"],
Paul Duffin2d86c7a2018-02-16 13:11:05 +000039 },
40
Sundong Ahne933ced2018-07-31 16:54:41 +090041 hostdex: true,
42
43 api_packages: [
44 "android.test",
45 "android.test.suitebuilder.annotation",
46 "com.android.internal.util",
47 "junit.framework",
48 ],
49
Sundong Ahne933ced2018-07-31 16:54:41 +090050 compile_dex: true,
Jiyong Park912db8d2020-05-29 10:51:18 +090051 default_to_stubs: true,
Paul Duffin67668962021-01-27 11:32:54 +000052
53 // Additional hiddenapi annotations are provided in a separate module.
54 // TODO(b/180295980) - investigate whether this can be removed
55 hiddenapi_additional_annotations: [
56 "android.test.base-hiddenapi-annotations",
57 ],
Sundong Ahne933ced2018-07-31 16:54:41 +090058}
59
60// Build the android.test.base_static library
61// ==========================================
62// This is only intended for inclusion in the android.test.runner-minus-junit,
63// robolectric_android-all-stub and repackaged.android.test.* libraries.
Paul Duffin79d7ba22019-02-25 19:18:37 +000064// Must not be used elsewhere.
Sundong Ahne933ced2018-07-31 16:54:41 +090065java_library_static {
66 name: "android.test.base_static",
67 installable: false,
68
Anton Hansson2e25fdc2021-05-10 12:40:05 +010069 srcs: [":android-test-base-sources"],
Sundong Ahne933ced2018-07-31 16:54:41 +090070
71 errorprone: {
72 javacflags: ["-Xep:DepAnn:ERROR"],
73 },
74
Tobias Thiererd65595a2018-02-05 15:49:52 +000075 // Needs to be consistent with the repackaged version of this make target.
76 java_version: "1.8",
77
Paul Duffin4cdec672018-02-14 10:36:16 +000078 sdk_version: "current",
Paul Duffine95a8952017-11-16 15:53:09 +000079}
80
Paul Duffine95a8952017-11-16 15:53:09 +000081// Build the repackaged.android.test.base library
82// ==============================================
Paul Duffinb36eb542018-01-15 15:47:47 +000083// This contains repackaged versions of the classes from
84// android.test.base.
Colin Crossfc7ba9e2017-12-07 13:11:06 -080085java_library_static {
Paul Duffine95a8952017-11-16 15:53:09 +000086 name: "repackaged.android.test.base",
Colin Crossfc7ba9e2017-12-07 13:11:06 -080087
Paul Duffin4cdec672018-02-14 10:36:16 +000088 sdk_version: "current",
Sundong Ahne933ced2018-07-31 16:54:41 +090089 static_libs: ["android.test.base_static"],
Colin Crossfc7ba9e2017-12-07 13:11:06 -080090
91 jarjar_rules: "jarjar-rules.txt",
Tobias Thiererd65595a2018-02-05 15:49:52 +000092 // Pin java_version until jarjar is certified to support later versions. http://b/72703434
93 java_version: "1.8",
Colin Crossfc7ba9e2017-12-07 13:11:06 -080094}
95
Paul Duffinbee7cce2018-01-05 15:11:18 +000096// Build the android.test.base-minus-junit library
97// ===============================================
98// This contains the android.test classes from android.test.base plus
99// the com.android.internal.util.Predicate[s] classes. This is only
Paul Duffin67668962021-01-27 11:32:54 +0000100// intended for inclusion in android.test.legacy and in
101// android.test.base-hiddenapi-annotations to avoid a dependency cycle and must
102// not be used elsewhere.
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}