Colin Cross | fc7ba9e | 2017-12-07 13:11:06 -0800 | [diff] [blame] | 1 | // |
| 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 Duffin | e95a895 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 17 | // 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 Badour | 051ef78 | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 22 | package { |
| 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 Cross | c1309ec | 2022-01-10 21:16:59 -0800 | [diff] [blame] | 29 | default_applicable_licenses: ["frameworks_base_test-base_license"], |
| 30 | } |
| 31 | |
| 32 | license { |
| 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 Badour | 051ef78 | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 42 | } |
| 43 | |
Sundong Ahn | e933ced | 2018-07-31 16:54:41 +0900 | [diff] [blame] | 44 | java_sdk_library { |
Paul Duffin | e95a895 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 45 | name: "android.test.base", |
| 46 | |
Anton Hansson | 2e25fdc | 2021-05-10 12:40:05 +0100 | [diff] [blame] | 47 | srcs: [":android-test-base-sources"], |
Paul Duffin | e95a895 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 48 | |
Paul Duffin | 2d86c7a | 2018-02-16 13:11:05 +0000 | [diff] [blame] | 49 | errorprone: { |
Paul Duffin | cd35de3 | 2019-05-30 15:12:47 +0100 | [diff] [blame] | 50 | javacflags: ["-Xep:DepAnn:ERROR"], |
Paul Duffin | 2d86c7a | 2018-02-16 13:11:05 +0000 | [diff] [blame] | 51 | }, |
| 52 | |
Sundong Ahn | e933ced | 2018-07-31 16:54:41 +0900 | [diff] [blame] | 53 | 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 Ahn | e933ced | 2018-07-31 16:54:41 +0900 | [diff] [blame] | 62 | compile_dex: true, |
Jiyong Park | 912db8d | 2020-05-29 10:51:18 +0900 | [diff] [blame] | 63 | default_to_stubs: true, |
Paul Duffin | 6766896 | 2021-01-27 11:32:54 +0000 | [diff] [blame] | 64 | |
| 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 Cross | 5959ec0 | 2021-05-10 10:38:53 -0700 | [diff] [blame] | 70 | dist_group: "android", |
Sundong Ahn | e933ced | 2018-07-31 16:54:41 +0900 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | // Build the android.test.base_static library |
| 74 | // ========================================== |
Paul Duffin | f404f1d | 2022-01-31 17:15:49 +0000 | [diff] [blame] | 75 | // This is only intended for use by the android.test.runner-minus-junit |
| 76 | // library. |
| 77 | // |
Paul Duffin | 79d7ba2 | 2019-02-25 19:18:37 +0000 | [diff] [blame] | 78 | // Must not be used elsewhere. |
Paul Duffin | f404f1d | 2022-01-31 17:15:49 +0000 | [diff] [blame] | 79 | // |
Sundong Ahn | e933ced | 2018-07-31 16:54:41 +0900 | [diff] [blame] | 80 | java_library_static { |
| 81 | name: "android.test.base_static", |
Paul Duffin | f404f1d | 2022-01-31 17:15:49 +0000 | [diff] [blame] | 82 | visibility: [ |
| 83 | "//frameworks/base/test-runner", |
| 84 | ], |
Sundong Ahn | e933ced | 2018-07-31 16:54:41 +0900 | [diff] [blame] | 85 | installable: false, |
| 86 | |
Anton Hansson | 2e25fdc | 2021-05-10 12:40:05 +0100 | [diff] [blame] | 87 | srcs: [":android-test-base-sources"], |
Sundong Ahn | e933ced | 2018-07-31 16:54:41 +0900 | [diff] [blame] | 88 | |
| 89 | errorprone: { |
| 90 | javacflags: ["-Xep:DepAnn:ERROR"], |
| 91 | }, |
| 92 | |
Tobias Thierer | d65595a | 2018-02-05 15:49:52 +0000 | [diff] [blame] | 93 | // Needs to be consistent with the repackaged version of this make target. |
| 94 | java_version: "1.8", |
| 95 | |
Paul Duffin | 4cdec67 | 2018-02-14 10:36:16 +0000 | [diff] [blame] | 96 | sdk_version: "current", |
Paul Duffin | e95a895 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 97 | } |
| 98 | |
Paul Duffin | bee7cce | 2018-01-05 15:11:18 +0000 | [diff] [blame] | 99 | // Build the android.test.base-minus-junit library |
| 100 | // =============================================== |
| 101 | // This contains the android.test classes from android.test.base plus |
Paul Duffin | f404f1d | 2022-01-31 17:15:49 +0000 | [diff] [blame] | 102 | // the com.android.internal.util.Predicate[s] classes. |
Paul Duffin | bee7cce | 2018-01-05 15:11:18 +0000 | [diff] [blame] | 103 | java_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 Zhang | 3fece48 | 2018-04-13 14:48:32 -0700 | [diff] [blame] | 116 | |
Anton Hansson | 2e25fdc | 2021-05-10 12:40:05 +0100 | [diff] [blame] | 117 | filegroup { |
| 118 | name: "android-test-base-sources", |
| 119 | srcs: ["src/**/*.java"], |
| 120 | path: "src", |
| 121 | } |
| 122 | |
Paul Duffin | cd35de3 | 2019-05-30 15:12:47 +0100 | [diff] [blame] | 123 | // Make the current.txt available for use by the cts/tests/signature tests. |
| 124 | // ======================================================================== |
| 125 | filegroup { |
| 126 | name: "android-test-base-current.txt", |
| 127 | visibility: [ |
| 128 | "//cts/tests/signature/api", |
| 129 | ], |
| 130 | srcs: [ |
| 131 | "api/current.txt", |
| 132 | ], |
| 133 | } |