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 |
| 29 | default_applicable_licenses: ["frameworks_base_license"], |
| 30 | } |
| 31 | |
Sundong Ahn | e933ced | 2018-07-31 16:54:41 +0900 | [diff] [blame] | 32 | java_sdk_library { |
Paul Duffin | e95a895 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 33 | name: "android.test.base", |
| 34 | |
Anton Hansson | 2e25fdc | 2021-05-10 12:40:05 +0100 | [diff] [blame^] | 35 | srcs: [":android-test-base-sources"], |
Paul Duffin | e95a895 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 36 | |
Paul Duffin | 2d86c7a | 2018-02-16 13:11:05 +0000 | [diff] [blame] | 37 | errorprone: { |
Paul Duffin | cd35de3 | 2019-05-30 15:12:47 +0100 | [diff] [blame] | 38 | javacflags: ["-Xep:DepAnn:ERROR"], |
Paul Duffin | 2d86c7a | 2018-02-16 13:11:05 +0000 | [diff] [blame] | 39 | }, |
| 40 | |
Sundong Ahn | e933ced | 2018-07-31 16:54:41 +0900 | [diff] [blame] | 41 | 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 Ahn | e933ced | 2018-07-31 16:54:41 +0900 | [diff] [blame] | 50 | compile_dex: true, |
Jiyong Park | 912db8d | 2020-05-29 10:51:18 +0900 | [diff] [blame] | 51 | default_to_stubs: true, |
Paul Duffin | 6766896 | 2021-01-27 11:32:54 +0000 | [diff] [blame] | 52 | |
| 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 Ahn | e933ced | 2018-07-31 16:54:41 +0900 | [diff] [blame] | 58 | } |
| 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 Duffin | 79d7ba2 | 2019-02-25 19:18:37 +0000 | [diff] [blame] | 64 | // Must not be used elsewhere. |
Sundong Ahn | e933ced | 2018-07-31 16:54:41 +0900 | [diff] [blame] | 65 | java_library_static { |
| 66 | name: "android.test.base_static", |
| 67 | installable: false, |
| 68 | |
Anton Hansson | 2e25fdc | 2021-05-10 12:40:05 +0100 | [diff] [blame^] | 69 | srcs: [":android-test-base-sources"], |
Sundong Ahn | e933ced | 2018-07-31 16:54:41 +0900 | [diff] [blame] | 70 | |
| 71 | errorprone: { |
| 72 | javacflags: ["-Xep:DepAnn:ERROR"], |
| 73 | }, |
| 74 | |
Tobias Thierer | d65595a | 2018-02-05 15:49:52 +0000 | [diff] [blame] | 75 | // Needs to be consistent with the repackaged version of this make target. |
| 76 | java_version: "1.8", |
| 77 | |
Paul Duffin | 4cdec67 | 2018-02-14 10:36:16 +0000 | [diff] [blame] | 78 | sdk_version: "current", |
Paul Duffin | e95a895 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 79 | } |
| 80 | |
Paul Duffin | e95a895 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 81 | // Build the repackaged.android.test.base library |
| 82 | // ============================================== |
Paul Duffin | b36eb54 | 2018-01-15 15:47:47 +0000 | [diff] [blame] | 83 | // This contains repackaged versions of the classes from |
| 84 | // android.test.base. |
Colin Cross | fc7ba9e | 2017-12-07 13:11:06 -0800 | [diff] [blame] | 85 | java_library_static { |
Paul Duffin | e95a895 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 86 | name: "repackaged.android.test.base", |
Colin Cross | fc7ba9e | 2017-12-07 13:11:06 -0800 | [diff] [blame] | 87 | |
Paul Duffin | 4cdec67 | 2018-02-14 10:36:16 +0000 | [diff] [blame] | 88 | sdk_version: "current", |
Sundong Ahn | e933ced | 2018-07-31 16:54:41 +0900 | [diff] [blame] | 89 | static_libs: ["android.test.base_static"], |
Colin Cross | fc7ba9e | 2017-12-07 13:11:06 -0800 | [diff] [blame] | 90 | |
| 91 | jarjar_rules: "jarjar-rules.txt", |
Tobias Thierer | d65595a | 2018-02-05 15:49:52 +0000 | [diff] [blame] | 92 | // Pin java_version until jarjar is certified to support later versions. http://b/72703434 |
| 93 | java_version: "1.8", |
Colin Cross | fc7ba9e | 2017-12-07 13:11:06 -0800 | [diff] [blame] | 94 | } |
| 95 | |
Paul Duffin | bee7cce | 2018-01-05 15:11:18 +0000 | [diff] [blame] | 96 | // 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 Duffin | 6766896 | 2021-01-27 11:32:54 +0000 | [diff] [blame] | 100 | // 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 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 | } |