• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
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.
22package {
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
32java_sdk_library {
33    name: "android.test.base",
34
35    srcs: [":android-test-base-sources"],
36
37    errorprone: {
38        javacflags: ["-Xep:DepAnn:ERROR"],
39    },
40
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
50    compile_dex: true,
51    default_to_stubs: true,
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    ],
58    dist_group: "android",
59}
60
61// Build the android.test.base_static library
62// ==========================================
63// This is only intended for inclusion in the android.test.runner-minus-junit,
64// robolectric_android-all-stub and repackaged.android.test.* libraries.
65// Must not be used elsewhere.
66java_library_static {
67    name: "android.test.base_static",
68    installable: false,
69
70    srcs: [":android-test-base-sources"],
71
72    errorprone: {
73        javacflags: ["-Xep:DepAnn:ERROR"],
74    },
75
76    // Needs to be consistent with the repackaged version of this make target.
77    java_version: "1.8",
78
79    sdk_version: "current",
80}
81
82// Build the repackaged.android.test.base library
83// ==============================================
84// This contains repackaged versions of the classes from
85// android.test.base.
86java_library_static {
87    name: "repackaged.android.test.base",
88
89    sdk_version: "current",
90    static_libs: ["android.test.base_static"],
91
92    jarjar_rules: "jarjar-rules.txt",
93    // Pin java_version until jarjar is certified to support later versions. http://b/72703434
94    java_version: "1.8",
95}
96
97// Build the android.test.base-minus-junit library
98// ===============================================
99// This contains the android.test classes from android.test.base plus
100// the com.android.internal.util.Predicate[s] classes. This is only
101// intended for inclusion in android.test.legacy and in
102// android.test.base-hiddenapi-annotations to avoid a dependency cycle and must
103// not be used elsewhere.
104java_library_static {
105    name: "android.test.base-minus-junit",
106
107    srcs: [
108        "src/android/**/*.java",
109        "src/com/**/*.java",
110    ],
111
112    sdk_version: "current",
113    libs: [
114        "junit",
115    ],
116}
117
118filegroup {
119    name: "android-test-base-sources",
120    srcs: ["src/**/*.java"],
121    path: "src",
122}
123
124// Make the current.txt available for use by the cts/tests/signature tests.
125// ========================================================================
126filegroup {
127    name: "android-test-base-current.txt",
128    visibility: [
129        "//cts/tests/signature/api",
130    ],
131    srcs: [
132        "api/current.txt",
133    ],
134}
135