blob: 8ff790168436e03eb307452e2aa3335f637410f0 [file] [log] [blame]
Anton Hansson24c88f42019-12-13 16:17:27 +00001// Copyright (C) 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15mainline_stubs_args =
16 "--error UnhiddenSystemApi " +
17 "--hide BroadcastBehavior " +
18 "--hide DeprecationMismatch " +
19 "--hide HiddenSuperclass " +
20 "--hide HiddenTypedefConstant " +
21 "--hide HiddenTypeParameter " +
22 "--hide MissingPermission " +
23 "--hide RequiresPermission " +
24 "--hide SdkConstant " +
25 "--hide Todo " +
26 "--hide Typo " +
27 "--hide UnavailableSymbol "
28
Anton Hansson087646e2020-03-24 15:21:01 +000029// TODO: modularize this so not every module has the same whitelist
30framework_packages_to_document = [
31 "android",
32 "dalvik",
33 "java",
34 "javax",
35 "junit",
36 "org.apache.http",
37 "org.json",
38 "org.w3c.dom",
39 "org.xml.sax",
40 "org.xmlpull",
41]
42
Anton Hansson26e1ed62020-03-23 13:30:01 +000043// TODO: remove the hiding when server classes are cleaned up.
44mainline_framework_stubs_args =
45 mainline_stubs_args +
46 "--hide-package com.android.server "
Anton Hansson5036ab62019-12-17 10:03:52 +000047
Anton Hanssona12addc2020-02-03 14:44:47 +000048priv_apps = " " +
49 "--show-annotation android.annotation.SystemApi\\(" +
Jiyong Park7f1e9b22020-02-25 17:12:30 +090050 "client=android.annotation.SystemApi.Client.PRIVILEGED_APPS" +
Anton Hanssona12addc2020-02-03 14:44:47 +000051 "\\) "
52
53module_libs = " " +
54 " --show-annotation android.annotation.SystemApi\\(" +
Jiyong Park7f1e9b22020-02-25 17:12:30 +090055 "client=android.annotation.SystemApi.Client.MODULE_LIBRARIES" +
Anton Hanssona12addc2020-02-03 14:44:47 +000056 "\\) "
57
Anton Hansson26e1ed62020-03-23 13:30:01 +000058mainline_service_stubs_args =
59 mainline_stubs_args +
60 "--show-annotation android.annotation.SystemApi\\(" +
61 "client=android.annotation.SystemApi.Client.SYSTEM_SERVER" +
62 "\\) " +
63 "--hide-annotation android.annotation.Hide " +
64 "--hide InternalClasses " // com.android.* classes are okay in this interface
65
Anton Hansson24c88f42019-12-13 16:17:27 +000066stubs_defaults {
67 name: "framework-module-stubs-defaults-publicapi",
Anton Hansson26e1ed62020-03-23 13:30:01 +000068 args: mainline_framework_stubs_args,
Anton Hansson24c88f42019-12-13 16:17:27 +000069 installable: false,
Anton Hansson4d90a282020-03-09 19:14:28 +000070 sdk_version: "current",
Anton Hansson087646e2020-03-24 15:21:01 +000071 filter_packages: framework_packages_to_document,
Anton Hansson5d708e52020-01-17 19:03:34 +000072 check_api: {
73 current: {
74 api_file: "api/current.txt",
75 removed_api_file: "api/removed.txt",
76 },
77 },
Anton Hansson24c88f42019-12-13 16:17:27 +000078}
79
80stubs_defaults {
81 name: "framework-module-stubs-defaults-systemapi",
Anton Hansson26e1ed62020-03-23 13:30:01 +000082 args: mainline_framework_stubs_args + priv_apps,
Anton Hansson397eb472020-03-13 16:28:21 +000083 libs: ["framework-annotations-lib"],
Jiyong Park7be934f2020-01-06 16:22:32 +090084 installable: false,
Anton Hansson4d90a282020-03-09 19:14:28 +000085 sdk_version: "system_current",
Anton Hansson087646e2020-03-24 15:21:01 +000086 filter_packages: framework_packages_to_document,
Anton Hansson5d708e52020-01-17 19:03:34 +000087 check_api: {
88 current: {
89 api_file: "api/system-current.txt",
90 removed_api_file: "api/system-removed.txt",
91 },
92 },
Jiyong Park7be934f2020-01-06 16:22:32 +090093}
94
Anton Hanssonc8cc1eb2020-03-24 17:03:15 +000095java_defaults {
96 name: "framework-module-stubs-lib-defaults-publicapi",
97 installable: false,
98 sdk_version: "module_current",
99}
100
101java_defaults {
102 name: "framework-module-stubs-lib-defaults-systemapi",
103 installable: false,
104 sdk_version: "module_current",
105}
106
107java_defaults {
108 name: "framework-module-stubs-lib-defaults-module_libs_api",
109 installable: false,
110 sdk_version: "module_current",
111}
112
Anton Hanssona12addc2020-02-03 14:44:47 +0000113// The defaults for module_libs comes in two parts - defaults for API checks
114// and defaults for stub generation. This is because we want the API txt
115// files to *only* include the module_libs_api, but the stubs to include
116// module_libs_api as well as priv_apps.
117
Jiyong Park7be934f2020-01-06 16:22:32 +0900118stubs_defaults {
Anton Hanssona12addc2020-02-03 14:44:47 +0000119 name: "framework-module-api-defaults-module_libs_api",
Anton Hansson26e1ed62020-03-23 13:30:01 +0000120 args: mainline_framework_stubs_args + module_libs,
Anton Hansson397eb472020-03-13 16:28:21 +0000121 libs: ["framework-annotations-lib"],
Jiyong Park7be934f2020-01-06 16:22:32 +0900122 installable: false,
Anton Hansson4d90a282020-03-09 19:14:28 +0000123 sdk_version: "module_current",
Anton Hansson087646e2020-03-24 15:21:01 +0000124 filter_packages: framework_packages_to_document,
Anton Hansson5d708e52020-01-17 19:03:34 +0000125 check_api: {
126 current: {
127 api_file: "api/module-lib-current.txt",
128 removed_api_file: "api/module-lib-removed.txt",
129 },
130 },
Jiyong Park7be934f2020-01-06 16:22:32 +0900131}
132
133stubs_defaults {
134 name: "framework-module-stubs-defaults-module_libs_api",
Anton Hansson26e1ed62020-03-23 13:30:01 +0000135 args: mainline_framework_stubs_args + module_libs + priv_apps,
Anton Hansson397eb472020-03-13 16:28:21 +0000136 libs: ["framework-annotations-lib"],
Anton Hansson24c88f42019-12-13 16:17:27 +0000137 installable: false,
Anton Hansson4d90a282020-03-09 19:14:28 +0000138 sdk_version: "module_current",
Anton Hansson087646e2020-03-24 15:21:01 +0000139 filter_packages: framework_packages_to_document,
Anton Hansson24c88f42019-12-13 16:17:27 +0000140}
Anton Hansson26e1ed62020-03-23 13:30:01 +0000141
142stubs_defaults {
143 name: "service-module-stubs-srcs-defaults",
144 args: mainline_service_stubs_args,
145 installable: false,
146 check_api: {
147 current: {
148 api_file: "api/current.txt",
149 removed_api_file: "api/removed.txt",
150 },
151 },
152}
153
154// Empty for now, but a convenient place to add rules for all
155// module java_library system_server stub libs.
156java_defaults {
157 name: "service-module-stubs-defaults",
158}