Anton Hansson | 24c88f4 | 2019-12-13 16:17:27 +0000 | [diff] [blame] | 1 | // 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 | |
| 15 | mainline_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 Hansson | 180ec39 | 2020-03-23 13:30:01 +0000 | [diff] [blame] | 29 | // TODO: remove the hiding when server classes are cleaned up. |
| 30 | mainline_framework_stubs_args = |
| 31 | mainline_stubs_args + |
| 32 | "--hide-package com.android.server " |
Anton Hansson | 5036ab6 | 2019-12-17 10:03:52 +0000 | [diff] [blame] | 33 | |
Anton Hansson | a12addc | 2020-02-03 14:44:47 +0000 | [diff] [blame] | 34 | priv_apps = " " + |
| 35 | "--show-annotation android.annotation.SystemApi\\(" + |
Jiyong Park | b4f8a85 | 2020-02-25 17:12:30 +0900 | [diff] [blame] | 36 | "client=android.annotation.SystemApi.Client.PRIVILEGED_APPS" + |
Anton Hansson | a12addc | 2020-02-03 14:44:47 +0000 | [diff] [blame] | 37 | "\\) " |
| 38 | |
| 39 | module_libs = " " + |
| 40 | " --show-annotation android.annotation.SystemApi\\(" + |
Jiyong Park | b4f8a85 | 2020-02-25 17:12:30 +0900 | [diff] [blame] | 41 | "client=android.annotation.SystemApi.Client.MODULE_LIBRARIES" + |
Anton Hansson | a12addc | 2020-02-03 14:44:47 +0000 | [diff] [blame] | 42 | "\\) " |
| 43 | |
Anton Hansson | 180ec39 | 2020-03-23 13:30:01 +0000 | [diff] [blame] | 44 | mainline_service_stubs_args = |
| 45 | mainline_stubs_args + |
| 46 | "--show-annotation android.annotation.SystemApi\\(" + |
| 47 | "client=android.annotation.SystemApi.Client.SYSTEM_SERVER" + |
| 48 | "\\) " + |
| 49 | "--hide-annotation android.annotation.Hide " + |
| 50 | "--hide InternalClasses " // com.android.* classes are okay in this interface |
| 51 | |
Anton Hansson | 24c88f4 | 2019-12-13 16:17:27 +0000 | [diff] [blame] | 52 | stubs_defaults { |
| 53 | name: "framework-module-stubs-defaults-publicapi", |
Anton Hansson | 180ec39 | 2020-03-23 13:30:01 +0000 | [diff] [blame] | 54 | args: mainline_framework_stubs_args, |
Anton Hansson | 24c88f4 | 2019-12-13 16:17:27 +0000 | [diff] [blame] | 55 | installable: false, |
Anton Hansson | 1527353 | 2020-03-09 19:14:28 +0000 | [diff] [blame] | 56 | sdk_version: "current", |
Anton Hansson | dc033c3 | 2020-01-17 19:03:34 +0000 | [diff] [blame] | 57 | check_api: { |
| 58 | current: { |
| 59 | api_file: "api/current.txt", |
| 60 | removed_api_file: "api/removed.txt", |
| 61 | }, |
| 62 | }, |
Anton Hansson | a92a23b | 2020-03-23 17:04:23 +0000 | [diff] [blame] | 63 | dist: { |
| 64 | targets: ["sdk", "win_sdk"], |
| 65 | dir: "apistubs/android/public/api", |
| 66 | }, |
Anton Hansson | 24c88f4 | 2019-12-13 16:17:27 +0000 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | stubs_defaults { |
| 70 | name: "framework-module-stubs-defaults-systemapi", |
Anton Hansson | 180ec39 | 2020-03-23 13:30:01 +0000 | [diff] [blame] | 71 | args: mainline_framework_stubs_args + priv_apps, |
Anton Hansson | 3b9ac0c | 2020-03-13 16:28:21 +0000 | [diff] [blame] | 72 | libs: ["framework-annotations-lib"], |
Jiyong Park | 7be934f | 2020-01-06 16:22:32 +0900 | [diff] [blame] | 73 | installable: false, |
Anton Hansson | 1527353 | 2020-03-09 19:14:28 +0000 | [diff] [blame] | 74 | sdk_version: "system_current", |
Anton Hansson | dc033c3 | 2020-01-17 19:03:34 +0000 | [diff] [blame] | 75 | check_api: { |
| 76 | current: { |
| 77 | api_file: "api/system-current.txt", |
| 78 | removed_api_file: "api/system-removed.txt", |
| 79 | }, |
| 80 | }, |
Anton Hansson | a92a23b | 2020-03-23 17:04:23 +0000 | [diff] [blame] | 81 | dist: { |
| 82 | targets: ["sdk", "win_sdk"], |
| 83 | dir: "apistubs/android/system/api", |
| 84 | }, |
Jiyong Park | 7be934f | 2020-01-06 16:22:32 +0900 | [diff] [blame] | 85 | } |
| 86 | |
Anton Hansson | b470bf3 | 2020-03-24 17:03:15 +0000 | [diff] [blame] | 87 | java_defaults { |
| 88 | name: "framework-module-stubs-lib-defaults-publicapi", |
| 89 | installable: false, |
| 90 | sdk_version: "module_current", |
| 91 | } |
| 92 | |
| 93 | java_defaults { |
| 94 | name: "framework-module-stubs-lib-defaults-systemapi", |
| 95 | installable: false, |
| 96 | sdk_version: "module_current", |
| 97 | } |
| 98 | |
| 99 | java_defaults { |
| 100 | name: "framework-module-stubs-lib-defaults-module_libs_api", |
| 101 | installable: false, |
| 102 | sdk_version: "module_current", |
| 103 | } |
| 104 | |
Anton Hansson | a12addc | 2020-02-03 14:44:47 +0000 | [diff] [blame] | 105 | // The defaults for module_libs comes in two parts - defaults for API checks |
| 106 | // and defaults for stub generation. This is because we want the API txt |
| 107 | // files to *only* include the module_libs_api, but the stubs to include |
| 108 | // module_libs_api as well as priv_apps. |
| 109 | |
Jiyong Park | 7be934f | 2020-01-06 16:22:32 +0900 | [diff] [blame] | 110 | stubs_defaults { |
Anton Hansson | a12addc | 2020-02-03 14:44:47 +0000 | [diff] [blame] | 111 | name: "framework-module-api-defaults-module_libs_api", |
Anton Hansson | 180ec39 | 2020-03-23 13:30:01 +0000 | [diff] [blame] | 112 | args: mainline_framework_stubs_args + module_libs, |
Anton Hansson | 3b9ac0c | 2020-03-13 16:28:21 +0000 | [diff] [blame] | 113 | libs: ["framework-annotations-lib"], |
Jiyong Park | 7be934f | 2020-01-06 16:22:32 +0900 | [diff] [blame] | 114 | installable: false, |
Anton Hansson | 1527353 | 2020-03-09 19:14:28 +0000 | [diff] [blame] | 115 | sdk_version: "module_current", |
Anton Hansson | dc033c3 | 2020-01-17 19:03:34 +0000 | [diff] [blame] | 116 | check_api: { |
| 117 | current: { |
| 118 | api_file: "api/module-lib-current.txt", |
| 119 | removed_api_file: "api/module-lib-removed.txt", |
| 120 | }, |
| 121 | }, |
Anton Hansson | a92a23b | 2020-03-23 17:04:23 +0000 | [diff] [blame] | 122 | dist: { |
| 123 | targets: ["sdk", "win_sdk"], |
| 124 | dir: "apistubs/android/module-lib/api", |
| 125 | }, |
Jiyong Park | 7be934f | 2020-01-06 16:22:32 +0900 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | stubs_defaults { |
| 129 | name: "framework-module-stubs-defaults-module_libs_api", |
Anton Hansson | 180ec39 | 2020-03-23 13:30:01 +0000 | [diff] [blame] | 130 | args: mainline_framework_stubs_args + module_libs + priv_apps, |
Anton Hansson | 3b9ac0c | 2020-03-13 16:28:21 +0000 | [diff] [blame] | 131 | libs: ["framework-annotations-lib"], |
Anton Hansson | 24c88f4 | 2019-12-13 16:17:27 +0000 | [diff] [blame] | 132 | installable: false, |
Anton Hansson | 1527353 | 2020-03-09 19:14:28 +0000 | [diff] [blame] | 133 | sdk_version: "module_current", |
Anton Hansson | 24c88f4 | 2019-12-13 16:17:27 +0000 | [diff] [blame] | 134 | } |
Anton Hansson | 180ec39 | 2020-03-23 13:30:01 +0000 | [diff] [blame] | 135 | |
| 136 | stubs_defaults { |
| 137 | name: "service-module-stubs-srcs-defaults", |
| 138 | args: mainline_service_stubs_args, |
| 139 | installable: false, |
| 140 | check_api: { |
| 141 | current: { |
| 142 | api_file: "api/current.txt", |
| 143 | removed_api_file: "api/removed.txt", |
| 144 | }, |
| 145 | }, |
Anton Hansson | a92a23b | 2020-03-23 17:04:23 +0000 | [diff] [blame] | 146 | dist: { |
| 147 | targets: ["sdk", "win_sdk"], |
| 148 | dir: "apistubs/android/system-server/api", |
| 149 | }, |
Anton Hansson | 180ec39 | 2020-03-23 13:30:01 +0000 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | // Empty for now, but a convenient place to add rules for all |
| 153 | // module java_library system_server stub libs. |
| 154 | java_defaults { |
| 155 | name: "service-module-stubs-defaults", |
| 156 | } |