blob: 0b7a3981a4039dad28843dc097134e891b718455 [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
35 srcs: ["src/**/*.java"],
36
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,
Sundong Ahne933ced2018-07-31 16:54:41 +090052}
53
54// Build the android.test.base_static library
55// ==========================================
56// This is only intended for inclusion in the android.test.runner-minus-junit,
57// robolectric_android-all-stub and repackaged.android.test.* libraries.
Paul Duffin79d7ba22019-02-25 19:18:37 +000058// Must not be used elsewhere.
Sundong Ahne933ced2018-07-31 16:54:41 +090059java_library_static {
60 name: "android.test.base_static",
61 installable: false,
62
63 srcs: ["src/**/*.java"],
64
65 errorprone: {
66 javacflags: ["-Xep:DepAnn:ERROR"],
67 },
68
Tobias Thiererd65595a2018-02-05 15:49:52 +000069 // Needs to be consistent with the repackaged version of this make target.
70 java_version: "1.8",
71
Paul Duffin4cdec672018-02-14 10:36:16 +000072 sdk_version: "current",
Paul Duffine95a8952017-11-16 15:53:09 +000073}
74
Paul Duffine95a8952017-11-16 15:53:09 +000075// Build the repackaged.android.test.base library
76// ==============================================
Paul Duffinb36eb542018-01-15 15:47:47 +000077// This contains repackaged versions of the classes from
78// android.test.base.
Colin Crossfc7ba9e2017-12-07 13:11:06 -080079java_library_static {
Paul Duffine95a8952017-11-16 15:53:09 +000080 name: "repackaged.android.test.base",
Colin Crossfc7ba9e2017-12-07 13:11:06 -080081
Paul Duffin4cdec672018-02-14 10:36:16 +000082 sdk_version: "current",
Sundong Ahne933ced2018-07-31 16:54:41 +090083 static_libs: ["android.test.base_static"],
Colin Crossfc7ba9e2017-12-07 13:11:06 -080084
85 jarjar_rules: "jarjar-rules.txt",
Tobias Thiererd65595a2018-02-05 15:49:52 +000086 // Pin java_version until jarjar is certified to support later versions. http://b/72703434
87 java_version: "1.8",
Colin Crossfc7ba9e2017-12-07 13:11:06 -080088}
89
Paul Duffinbee7cce2018-01-05 15:11:18 +000090// Build the android.test.base-minus-junit library
91// ===============================================
92// This contains the android.test classes from android.test.base plus
93// the com.android.internal.util.Predicate[s] classes. This is only
Paul Duffin79d7ba22019-02-25 19:18:37 +000094// intended for inclusion in android.test.legacy and must not be used
95// elsewhere.
Paul Duffinbee7cce2018-01-05 15:11:18 +000096java_library_static {
97 name: "android.test.base-minus-junit",
98
99 srcs: [
100 "src/android/**/*.java",
101 "src/com/**/*.java",
102 ],
103
104 sdk_version: "current",
105 libs: [
106 "junit",
107 ],
108}
Nan Zhang3fece482018-04-13 14:48:32 -0700109
Paul Duffincd35de32019-05-30 15:12:47 +0100110// Make the current.txt available for use by the cts/tests/signature tests.
111// ========================================================================
112filegroup {
113 name: "android-test-base-current.txt",
114 visibility: [
115 "//cts/tests/signature/api",
116 ],
117 srcs: [
118 "api/current.txt",
119 ],
120}