Anton Hansson | da4972f | 2020-01-08 09:48:18 +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 | package { |
Ronish Kalia | 45efc30 | 2024-02-14 14:17:36 +0000 | [diff] [blame] | 16 | default_team: "trendy_team_updatable_sdk_apis", |
Anton Hansson | da4972f | 2020-01-08 09:48:18 +0000 | [diff] [blame] | 17 | default_visibility: [":__subpackages__"], |
Bob Badour | be5b707 | 2021-02-12 14:50:30 -0800 | [diff] [blame] | 18 | default_applicable_licenses: ["Android-Apache-2.0"], |
Anton Hansson | da4972f | 2020-01-08 09:48:18 +0000 | [diff] [blame] | 19 | } |
| 20 | |
| 21 | apex { |
| 22 | name: "com.android.sdkext", |
Paul Duffin | c9d11fc | 2021-05-17 13:19:48 +0100 | [diff] [blame] | 23 | defaults: ["com.android.sdkext-defaults"], |
satayev | 9a5c441 | 2021-05-12 13:30:40 +0100 | [diff] [blame] | 24 | bootclasspath_fragments: ["com.android.sdkext-bootclasspath-fragment"], |
Anton Hansson | 4c63968 | 2021-05-27 10:01:34 +0000 | [diff] [blame] | 25 | binaries: [ |
| 26 | "derive_classpath", |
| 27 | "derive_sdk", |
| 28 | ], |
Anton Hansson | 16097ea | 2021-01-12 20:34:32 +0000 | [diff] [blame] | 29 | prebuilts: [ |
Anton Hansson | 1f555ec | 2021-05-24 12:27:02 +0100 | [diff] [blame] | 30 | "current_sdkinfo", |
Anton Hansson | 16097ea | 2021-01-12 20:34:32 +0000 | [diff] [blame] | 31 | "extensions_db", |
| 32 | ], |
Anton Hansson | 36e2b13 | 2019-12-19 12:10:53 +0000 | [diff] [blame] | 33 | manifest: "manifest.json", |
| 34 | } |
| 35 | |
| 36 | apex_defaults { |
| 37 | name: "com.android.sdkext-defaults", |
Gurpreet Singh | 8b30b40 | 2022-03-02 16:26:44 +0000 | [diff] [blame] | 38 | defaults: ["r-launched-apex-module"], |
Anton Hansson | da4972f | 2020-01-08 09:48:18 +0000 | [diff] [blame] | 39 | prebuilts: [ |
satayev | be3f8ea | 2021-03-19 11:08:49 +0000 | [diff] [blame] | 40 | "derive_classpath.rc", |
Anton Hansson | 36e2b13 | 2019-12-19 12:10:53 +0000 | [diff] [blame] | 41 | "derive_sdk.rc", |
Anton Hansson | da4972f | 2020-01-08 09:48:18 +0000 | [diff] [blame] | 42 | ], |
| 43 | key: "com.android.sdkext.key", |
| 44 | certificate: ":com.android.sdkext.certificate", |
| 45 | } |
| 46 | |
Anton Hansson | da4972f | 2020-01-08 09:48:18 +0000 | [diff] [blame] | 47 | apex_key { |
| 48 | name: "com.android.sdkext.key", |
| 49 | public_key: "com.android.sdkext.avbpubkey", |
| 50 | private_key: "com.android.sdkext.pem", |
| 51 | } |
| 52 | |
| 53 | android_app_certificate { |
| 54 | name: "com.android.sdkext.certificate", |
| 55 | certificate: "com.android.sdkext", |
| 56 | } |
| 57 | |
Anton Hansson | 966175d | 2020-11-09 15:03:34 +0000 | [diff] [blame] | 58 | sdk { |
| 59 | name: "sdkextensions-sdk", |
Paul Duffin | 99af1f4 | 2022-07-13 11:18:49 +0000 | [diff] [blame] | 60 | apexes: [ |
| 61 | // Adds exportable dependencies of the APEX to the sdk, |
| 62 | // e.g. *classpath_fragments. |
| 63 | "com.android.sdkext", |
| 64 | ], |
Anton Hansson | 966175d | 2020-11-09 15:03:34 +0000 | [diff] [blame] | 65 | } |
satayev | 9a5c441 | 2021-05-12 13:30:40 +0100 | [diff] [blame] | 66 | |
| 67 | // Encapsulate the contributions made by the com.android.sdkext to the bootclasspath. |
| 68 | bootclasspath_fragment { |
| 69 | name: "com.android.sdkext-bootclasspath-fragment", |
| 70 | contents: ["framework-sdkextensions"], |
| 71 | apex_available: ["com.android.sdkext"], |
Paul Duffin | 338c35f | 2021-05-17 12:48:35 +0100 | [diff] [blame] | 72 | |
| 73 | // The bootclasspath_fragments that provide APIs on which this depends. |
| 74 | fragments: [ |
| 75 | { |
| 76 | apex: "com.android.art", |
| 77 | module: "art-bootclasspath-fragment", |
| 78 | }, |
| 79 | ], |
Paul Duffin | c024f03 | 2022-03-10 18:37:12 +0000 | [diff] [blame] | 80 | |
| 81 | hidden_api: { |
| 82 | // This module does not contain any split packages. |
| 83 | split_packages: [], |
| 84 | |
| 85 | // The following packages and all their subpackages currently only |
| 86 | // contain classes from this bootclasspath_fragment. Listing a package |
| 87 | // here won't prevent other bootclasspath modules from adding classes in |
| 88 | // any of those packages but it will prevent them from adding those |
| 89 | // classes into an API surface, e.g. public, system, etc.. Doing so will |
| 90 | // result in a build failure due to inconsistent flags. |
| 91 | package_prefixes: [ |
| 92 | "android.os.ext", |
| 93 | ], |
| 94 | }, |
satayev | 9a5c441 | 2021-05-12 13:30:40 +0100 | [diff] [blame] | 95 | } |
Mårten Kongstad | 2ff5358 | 2022-09-06 15:12:42 +0200 | [diff] [blame] | 96 | |
| 97 | filegroup { |
| 98 | name: "sdk-extensions-info", |
Mårten Kongstad | fbb1e09 | 2022-11-08 12:29:11 +0100 | [diff] [blame] | 99 | srcs: ["sdk-extensions-info.xml"], |
Mårten Kongstad | 2ff5358 | 2022-09-06 15:12:42 +0200 | [diff] [blame] | 100 | visibility: [ |
| 101 | "//frameworks/base", |
Anton Hansson | d7c3c36 | 2023-03-03 17:56:45 +0000 | [diff] [blame] | 102 | "//frameworks/base/api", |
Mårten Kongstad | 2ff5358 | 2022-09-06 15:12:42 +0200 | [diff] [blame] | 103 | ], |
| 104 | } |
Andrei Onea | 4f030a3 | 2022-11-03 15:26:22 +0000 | [diff] [blame] | 105 | |
| 106 | java_test_host { |
| 107 | name: "sdkextensions_conformance_framework_tests", |
| 108 | static_libs: ["ClasspathFetcher"], |
| 109 | libs: [ |
| 110 | "tradefed", |
Krzysztof Kosiński | 1feb47f | 2023-10-07 00:48:19 +0000 | [diff] [blame] | 111 | "truth", |
Andrei Onea | 4f030a3 | 2022-11-03 15:26:22 +0000 | [diff] [blame] | 112 | ], |
| 113 | test_config: "sdkext-conformance-framework.xml", |
| 114 | test_suites: [ |
| 115 | "mts", |
| 116 | "device-tests", |
| 117 | ], |
| 118 | } |
Paul Duffin | df7e3da | 2023-11-27 13:20:29 +0000 | [diff] [blame] | 119 | |
Jihoon Kang | 9382733 | 2023-12-14 19:24:53 +0000 | [diff] [blame] | 120 | // TODO: b/316383039 - Remove this module and the script when udc-mainline-prod |
| 121 | // branch is removed. |
Paul Duffin | df7e3da | 2023-11-27 13:20:29 +0000 | [diff] [blame] | 122 | // The options passed to Metalava when generating API signature files and stubs |
| 123 | // for SDK extension releases. |
Paul Duffin | ec17dc4 | 2023-11-29 09:11:04 +0000 | [diff] [blame] | 124 | genrule { |
Paul Duffin | df7e3da | 2023-11-27 13:20:29 +0000 | [diff] [blame] | 125 | name: "sdkext-released-flagged-apis", |
Paul Duffin | ec17dc4 | 2023-11-29 09:11:04 +0000 | [diff] [blame] | 126 | visibility: [ |
| 127 | "//visibility:public", |
| 128 | ], |
| 129 | tool_files: ["keep-flagged-apis.sh"], |
Paul Duffin | df7e3da | 2023-11-27 13:20:29 +0000 | [diff] [blame] | 130 | srcs: ["released-flagged-apis.txt"], |
Paul Duffin | ec17dc4 | 2023-11-29 09:11:04 +0000 | [diff] [blame] | 131 | out: ["metalava-keep-flagged-apis.txt"], |
| 132 | cmd: "$(location keep-flagged-apis.sh) \"$(in)\" > \"$(out)\"", |
Paul Duffin | df7e3da | 2023-11-27 13:20:29 +0000 | [diff] [blame] | 133 | } |