Files
frameworks_base/api/Android.bp
Cole Faust dcda370025 Add lint api database files for module and system server sdks
Soong modules compiled against the module or system server sdks
should use the api_versions.xml for their respective sdk, but
currently they use the public-filtered api database. Add module
and system server sdk build targets to be used later.

Right now they're unused. I'm adding them first so that they
can be built on the build server, and then we can import them
into prebuilts/sdk, as some builds require the api files to be
prebuilt.

Bug: 193460475
Test: m api-versions-xml-module-filtered api-versions-xml-system-server-filtered
Change-Id: I668a878a470125ed3ecf79435713c27c4dd92b0a
2022-10-12 10:17:12 -07:00

244 lines
7.8 KiB
Plaintext

// Copyright (C) 2020 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package {
default_visibility: ["//visibility:private"],
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "frameworks_base_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
// SPDX-license-identifier-MIT
// SPDX-license-identifier-Unicode-DFS
default_applicable_licenses: ["frameworks_base_license"],
}
bootstrap_go_package {
name: "soong-api",
pkgPath: "android/soong/api",
deps: [
"blueprint",
"soong",
"soong-android",
"soong-genrule",
"soong-java",
],
srcs: ["api.go"],
pluginFor: ["soong_build"],
}
python_binary_host {
name: "api_versions_trimmer",
srcs: ["api_versions_trimmer.py"],
}
python_test_host {
name: "api_versions_trimmer_unittests",
main: "api_versions_trimmer_unittests.py",
srcs: [
"api_versions_trimmer_unittests.py",
"api_versions_trimmer.py",
],
test_options: {
unit_test: true,
},
}
python_binary_host {
name: "merge_annotation_zips",
srcs: ["merge_annotation_zips.py"],
}
python_test_host {
name: "merge_annotation_zips_test",
main: "merge_annotation_zips_test.py",
srcs: [
"merge_annotation_zips.py",
"merge_annotation_zips_test.py",
],
test_options: {
unit_test: true,
},
}
metalava_cmd = "$(location metalava)"
// Silence reflection warnings. See b/168689341
metalava_cmd += " -J--add-opens=java.base/java.util=ALL-UNNAMED "
metalava_cmd += " --quiet --no-banner --format=v2 "
genrule {
name: "current-api-xml",
tools: ["metalava"],
srcs: [":frameworks-base-api-current.txt"],
out: ["current.api"],
cmd: metalava_cmd + "-convert2xmlnostrip $(in) $(out)",
visibility: ["//visibility:public"],
}
combined_apis {
name: "frameworks-base-api",
bootclasspath: [
"android.net.ipsec.ike",
"art.module.public.api",
"conscrypt.module.public.api",
"framework-adservices",
"framework-appsearch",
"framework-bluetooth",
"framework-connectivity",
"framework-connectivity-t",
"framework-graphics",
"framework-media",
"framework-mediaprovider",
"framework-ondevicepersonalization",
"framework-permission",
"framework-permission-s",
"framework-scheduling",
"framework-sdkextensions",
"framework-statsd",
"framework-sdksandbox",
"framework-tethering",
"framework-uwb",
"framework-wifi",
"i18n.module.public.api",
],
system_server_classpath: [
"service-media-s",
"service-permission",
"service-sdksandbox",
],
}
genrule {
name: "frameworks-base-api-current-compat",
srcs: [
":android.api.public.latest",
":android-incompatibilities.api.public.latest",
":frameworks-base-api-current.txt",
],
out: ["updated-baseline.txt"],
tools: ["metalava"],
cmd: metalava_cmd +
"--check-compatibility:api:released $(location :android.api.public.latest) " +
"--baseline:compatibility:released $(location :android-incompatibilities.api.public.latest) " +
"--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
"$(location :frameworks-base-api-current.txt)",
}
genrule {
name: "frameworks-base-api-system-current-compat",
srcs: [
":android.api.system.latest",
":android-incompatibilities.api.system.latest",
":frameworks-base-api-current.txt",
":frameworks-base-api-system-current.txt",
],
out: ["updated-baseline.txt"],
tools: ["metalava"],
cmd: metalava_cmd +
"--check-compatibility:api:released $(location :android.api.system.latest) " +
"--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
"--baseline:compatibility:released $(location :android-incompatibilities.api.system.latest) " +
"--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
"$(location :frameworks-base-api-system-current.txt)",
}
genrule {
name: "frameworks-base-api-module-lib-current-compat",
srcs: [
":android.api.module-lib.latest",
":android-incompatibilities.api.module-lib.latest",
":frameworks-base-api-current.txt",
":frameworks-base-api-module-lib-current.txt",
],
out: ["updated-baseline.txt"],
tools: ["metalava"],
cmd: metalava_cmd +
"--check-compatibility:api:released $(location :android.api.module-lib.latest) " +
// Note: having "public" be the base of module-lib is not perfect -- it should
// ideally be a merged public+system (which metalava is not currently able to generate).
// This "base" will help when migrating from MODULE_LIBS -> public, but not when
// migrating from MODULE_LIBS -> system (where it needs to instead be listed as
// an incompatibility).
"--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
"--baseline:compatibility:released $(location :android-incompatibilities.api.module-lib.latest) " +
"--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
"$(location :frameworks-base-api-module-lib-current.txt)",
}
// This produces the same annotations.zip as framework-doc-stubs, but by using
// outputs from individual modules instead of all the source code.
genrule_defaults {
name: "sdk-annotations-defaults",
out: ["annotations.zip"],
tools: [
"merge_annotation_zips",
"soong_zip",
],
cmd: "$(location merge_annotation_zips) $(genDir)/out $(in) && " +
"$(location soong_zip) -o $(out) -C $(genDir)/out -D $(genDir)/out",
}
genrule {
name: "sdk-annotations.zip",
defaults: ["sdk-annotations-defaults"],
srcs: [
":android-non-updatable-doc-stubs{.annotations.zip}",
":all-modules-public-annotations",
],
}
genrule {
name: "sdk-annotations-system.zip",
defaults: ["sdk-annotations-defaults"],
srcs: [
":android-non-updatable-doc-stubs-system{.annotations.zip}",
":all-modules-system-annotations",
],
}
genrule {
name: "sdk-annotations-module-lib.zip",
defaults: ["sdk-annotations-defaults"],
srcs: [
":android-non-updatable-doc-stubs-module-lib{.annotations.zip}",
":all-modules-module-lib-annotations",
],
}
genrule {
name: "sdk-annotations-system-server.zip",
defaults: ["sdk-annotations-defaults"],
srcs: [
":android-non-updatable-doc-stubs-system-server{.annotations.zip}",
":all-modules-system-server-annotations",
],
}
genrule {
name: "combined-removed-dex",
visibility: [
"//frameworks/base/boot",
],
srcs: [
":frameworks-base-api-removed.txt",
":frameworks-base-api-system-removed.txt",
":android.car-stubs-docs{.removed-api.txt}",
":android.car-system-stubs-docs{.removed-api.txt}",
],
tool_files: ["gen_combined_removed_dex.sh"],
tools: ["metalava"],
out: ["combined-removed-dex.txt"],
cmd: "$(location gen_combined_removed_dex.sh) $(location metalava) $(genDir) $(in) > $(out)",
}