blob: 29ae8db42f1b5d4f3e95965fdbe9c7a2a919a5f5 [file] [log] [blame]
Anton Hanssonda4972f2020-01-08 09:48:18 +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
15package {
Ronish Kalia45efc302024-02-14 14:17:36 +000016 default_team: "trendy_team_updatable_sdk_apis",
Anton Hanssonda4972f2020-01-08 09:48:18 +000017 default_visibility: [":__subpackages__"],
Bob Badourbe5b7072021-02-12 14:50:30 -080018 default_applicable_licenses: ["Android-Apache-2.0"],
Anton Hanssonda4972f2020-01-08 09:48:18 +000019}
20
21apex {
22 name: "com.android.sdkext",
Paul Duffinc9d11fc2021-05-17 13:19:48 +010023 defaults: ["com.android.sdkext-defaults"],
satayev9a5c4412021-05-12 13:30:40 +010024 bootclasspath_fragments: ["com.android.sdkext-bootclasspath-fragment"],
Anton Hansson4c639682021-05-27 10:01:34 +000025 binaries: [
26 "derive_classpath",
27 "derive_sdk",
28 ],
Anton Hansson16097ea2021-01-12 20:34:32 +000029 prebuilts: [
Anton Hansson1f555ec2021-05-24 12:27:02 +010030 "current_sdkinfo",
Anton Hansson16097ea2021-01-12 20:34:32 +000031 "extensions_db",
32 ],
Anton Hansson36e2b132019-12-19 12:10:53 +000033 manifest: "manifest.json",
34}
35
36apex_defaults {
37 name: "com.android.sdkext-defaults",
Gurpreet Singh8b30b402022-03-02 16:26:44 +000038 defaults: ["r-launched-apex-module"],
Anton Hanssonda4972f2020-01-08 09:48:18 +000039 prebuilts: [
satayevbe3f8ea2021-03-19 11:08:49 +000040 "derive_classpath.rc",
Anton Hansson36e2b132019-12-19 12:10:53 +000041 "derive_sdk.rc",
Anton Hanssonda4972f2020-01-08 09:48:18 +000042 ],
43 key: "com.android.sdkext.key",
44 certificate: ":com.android.sdkext.certificate",
45}
46
Anton Hanssonda4972f2020-01-08 09:48:18 +000047apex_key {
48 name: "com.android.sdkext.key",
49 public_key: "com.android.sdkext.avbpubkey",
50 private_key: "com.android.sdkext.pem",
51}
52
53android_app_certificate {
54 name: "com.android.sdkext.certificate",
55 certificate: "com.android.sdkext",
56}
57
Anton Hansson966175d2020-11-09 15:03:34 +000058sdk {
59 name: "sdkextensions-sdk",
Paul Duffin99af1f42022-07-13 11:18:49 +000060 apexes: [
61 // Adds exportable dependencies of the APEX to the sdk,
62 // e.g. *classpath_fragments.
63 "com.android.sdkext",
64 ],
Anton Hansson966175d2020-11-09 15:03:34 +000065}
satayev9a5c4412021-05-12 13:30:40 +010066
67// Encapsulate the contributions made by the com.android.sdkext to the bootclasspath.
68bootclasspath_fragment {
69 name: "com.android.sdkext-bootclasspath-fragment",
70 contents: ["framework-sdkextensions"],
71 apex_available: ["com.android.sdkext"],
Paul Duffin338c35f2021-05-17 12:48:35 +010072
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 Duffinc024f032022-03-10 18:37:12 +000080
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 },
satayev9a5c4412021-05-12 13:30:40 +010095}
Mårten Kongstad2ff53582022-09-06 15:12:42 +020096
97filegroup {
98 name: "sdk-extensions-info",
Mårten Kongstadfbb1e092022-11-08 12:29:11 +010099 srcs: ["sdk-extensions-info.xml"],
Mårten Kongstad2ff53582022-09-06 15:12:42 +0200100 visibility: [
101 "//frameworks/base",
Anton Hanssond7c3c362023-03-03 17:56:45 +0000102 "//frameworks/base/api",
Mårten Kongstad2ff53582022-09-06 15:12:42 +0200103 ],
104}
Andrei Onea4f030a32022-11-03 15:26:22 +0000105
106java_test_host {
107 name: "sdkextensions_conformance_framework_tests",
108 static_libs: ["ClasspathFetcher"],
109 libs: [
110 "tradefed",
Krzysztof Kosiński1feb47f2023-10-07 00:48:19 +0000111 "truth",
Andrei Onea4f030a32022-11-03 15:26:22 +0000112 ],
113 test_config: "sdkext-conformance-framework.xml",
114 test_suites: [
115 "mts",
116 "device-tests",
117 ],
118}
Paul Duffindf7e3da2023-11-27 13:20:29 +0000119
Jihoon Kang93827332023-12-14 19:24:53 +0000120// TODO: b/316383039 - Remove this module and the script when udc-mainline-prod
121// branch is removed.
Paul Duffindf7e3da2023-11-27 13:20:29 +0000122// The options passed to Metalava when generating API signature files and stubs
123// for SDK extension releases.
Paul Duffinec17dc42023-11-29 09:11:04 +0000124genrule {
Paul Duffindf7e3da2023-11-27 13:20:29 +0000125 name: "sdkext-released-flagged-apis",
Paul Duffinec17dc42023-11-29 09:11:04 +0000126 visibility: [
127 "//visibility:public",
128 ],
129 tool_files: ["keep-flagged-apis.sh"],
Paul Duffindf7e3da2023-11-27 13:20:29 +0000130 srcs: ["released-flagged-apis.txt"],
Paul Duffinec17dc42023-11-29 09:11:04 +0000131 out: ["metalava-keep-flagged-apis.txt"],
132 cmd: "$(location keep-flagged-apis.sh) \"$(in)\" > \"$(out)\"",
Paul Duffindf7e3da2023-11-27 13:20:29 +0000133}