Include annotations in module metalava runs
Without this, we don't get nullability annotations in the stub sources,
nor the stubs themselves, which is a requirement for good interop with
kotlin.
Bug: 157010342
Test: m
Test: javap -c -v out/soong/.intermediates/frameworks/base/apex/media/\
framework/framework-media-stubs-publicapi/android_common/javac/classes/\
android/media/MediaSession2.class | grep Null && echo success || echo fail
Change-Id: I60c82e0fd495d379d7107e43542b846ca50b1e96
diff --git a/apex/Android.bp b/apex/Android.bp
index f511af5..7ef3a82 100644
--- a/apex/Android.bp
+++ b/apex/Android.bp
@@ -125,6 +125,10 @@
args: mainline_framework_stubs_args,
installable: false,
sdk_version: "module_current",
+ annotations_enabled: true,
+ merge_annotations_dirs: [
+ "metalava-manual",
+ ],
filter_packages: framework_packages_to_document,
check_api: {
current: {
@@ -147,6 +151,10 @@
libs: ["framework-annotations-lib"],
installable: false,
sdk_version: "module_current",
+ annotations_enabled: true,
+ merge_annotations_dirs: [
+ "metalava-manual",
+ ],
filter_packages: framework_packages_to_document,
check_api: {
current: {
@@ -167,6 +175,7 @@
name: "framework-module-stubs-lib-defaults-publicapi",
installable: false,
sdk_version: "module_current",
+ libs: [ "stub-annotations" ],
dist: {
targets: ["sdk", "win_sdk"],
dir: "apistubs/android/public",
@@ -177,6 +186,7 @@
name: "framework-module-stubs-lib-defaults-systemapi",
installable: false,
sdk_version: "module_current",
+ libs: [ "stub-annotations" ],
dist: {
targets: ["sdk", "win_sdk"],
dir: "apistubs/android/system",
@@ -187,6 +197,7 @@
name: "framework-module-stubs-lib-defaults-module_libs_api",
installable: false,
sdk_version: "module_current",
+ libs: [ "stub-annotations" ],
dist: {
targets: ["sdk", "win_sdk"],
dir: "apistubs/android/module-lib",
@@ -204,6 +215,10 @@
libs: ["framework-annotations-lib"],
installable: false,
sdk_version: "module_current",
+ annotations_enabled: true,
+ merge_annotations_dirs: [
+ "metalava-manual",
+ ],
filter_packages: framework_packages_to_document,
check_api: {
current: {
@@ -226,6 +241,10 @@
libs: ["framework-annotations-lib"],
installable: false,
sdk_version: "module_current",
+ annotations_enabled: true,
+ merge_annotations_dirs: [
+ "metalava-manual",
+ ],
filter_packages: framework_packages_to_document,
}
@@ -233,6 +252,10 @@
name: "service-module-stubs-srcs-defaults",
args: mainline_service_stubs_args,
installable: false,
+ annotations_enabled: true,
+ merge_annotations_dirs: [
+ "metalava-manual",
+ ],
filter_packages: ["com.android."],
check_api: {
current: {