1//
2// Copyright (C) 2021 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
16package {
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20filegroup {
21    name: "framework-annotations",
22    srcs: [
23        ":framework-metalava-annotations",
24        "com/android/internal/annotations/*.java",
25        "android/ravenwood/annotation/*.java",
26    ],
27
28    // This list is intentionally restricted, with few exceptions.
29    // Prefer using framework-annotations-lib wherever possible.
30    visibility: [
31        "//frameworks/base",
32        "//frameworks/base/tools/processors/property_cache",
33        "//frameworks/base/tools/processors/intdef_mappings",
34    ],
35}
36
37filegroup {
38    name: "framework-metalava-annotations",
39    srcs: ["android/annotation/*.java"],
40    visibility: [
41        // This group of files is needed by any metalava invocation that enabled enhancement of
42        // documentation (via javadoc tags like @paramDoc and @returnDoc). They are public for
43        // this purpose. However, java compilation should generally depend (dynamically) on
44        // framework-annotations-lib instead.
45        "//visibility:public",
46    ],
47}
48
49java_library {
50    name: "framework-annotations-lib",
51    srcs: [":framework-annotations"],
52    sdk_version: "core_current",
53    host_supported: true,
54    visibility: [
55        "//visibility:public",
56    ],
57}
58
59java_library {
60    name: "aconfig-annotations-lib",
61    srcs: [
62        "com/android/aconfig/annotations/*.java",
63    ],
64    sdk_version: "core_current",
65    host_supported: true,
66    optimize: {
67        proguard_flags_files: ["aconfig_proguard.flags"],
68        export_proguard_flags_files: true,
69    },
70    visibility: [
71        "//visibility:public",
72    ],
73}
74
75// Identical to aconfig-annotations-lib, but sdk_version is none.
76// Used for core modules where setting sdk_version of the dependencies as
77// core_current leads to circular dependencies
78java_library {
79    name: "aconfig-annotations-lib-sdk-none",
80    srcs: [
81        "com/android/aconfig/annotations/*.java",
82    ],
83    sdk_version: "none",
84    system_modules: "core-all-system-modules",
85    host_supported: true,
86    optimize: {
87        proguard_flags_files: ["aconfig_proguard.flags"],
88        export_proguard_flags_files: true,
89    },
90    visibility: [
91        "//visibility:public",
92    ],
93    patch_module: "java.base",
94}
95
96filegroup {
97    name: "framework-api-annotations",
98    srcs: [
99        "android/annotation/Discouraged.java",
100        "android/annotation/FlaggedApi.java",
101        "android/annotation/IntDef.java",
102        "android/annotation/SystemApi.java",
103        "android/annotation/TestApi.java",
104        "android/annotation/UserIdInt.java",
105        // aconfig annotations
106        "com/android/aconfig/annotations/*.java",
107    ],
108
109    visibility: [
110        "//art",
111        "//libcore",
112    ],
113}
114
115// TODO(b/183183152) This build rule should really be alongside the source in
116// com/android/modules/utils/ but cannot be due to b/183183152
117filegroup {
118    name: "module-utils-os-aidls",
119    srcs: [
120        "com/android/modules/utils/ParceledListSlice.aidl",
121        "com/android/modules/utils/StringParceledListSlice.aidl",
122    ],
123    visibility: [
124        "//frameworks/base/wifi",
125        "//packages/modules/Wifi/framework",
126        "//frameworks/libs/modules-utils/java/com/android/modules/utils",
127    ],
128}
129
130filegroup {
131    name: "module-utils-future-aidls",
132    srcs: [
133        "com/android/modules/utils/AndroidFuture.aidl",
134        "com/android/modules/utils/IAndroidFuture.aidl",
135    ],
136    visibility: [
137        "//packages/modules/NeuralNetworks/framework",
138        "//frameworks/libs/modules-utils/java/com/android/modules/utils",
139    ],
140}
141
142// This file group is deprecated; new users should use modules-utils-preconditions
143filegroup {
144    name: "modules-utils-preconditions-srcs",
145    srcs: [
146        "com/android/internal/util/Preconditions.java",
147    ],
148    visibility: [
149        // TODO: Prune this list
150        "//frameworks/base",
151        "//frameworks/base/core/java",
152    ],
153}
154