diff options
Diffstat (limited to 'api/StubLibraries.bp')
-rw-r--r-- | api/StubLibraries.bp | 161 |
1 files changed, 117 insertions, 44 deletions
diff --git a/api/StubLibraries.bp b/api/StubLibraries.bp index 3e277e8a0cab..f77f1c638f09 100644 --- a/api/StubLibraries.bp +++ b/api/StubLibraries.bp @@ -44,13 +44,13 @@ non_updatable_exportable_droidstubs { removed_api_file: ":non-updatable-removed.txt", }, last_released: { - api_file: ":android-non-updatable.api.public.latest", - removed_api_file: ":android-non-updatable-removed.api.public.latest", + api_file: ":android-non-updatable.api.combined.public.latest", + removed_api_file: ":android-non-updatable-removed.api.combined.public.latest", baseline_file: ":android-non-updatable-incompatibilities.api.public.latest", }, api_lint: { enabled: true, - new_since: ":android.api.public.latest", + new_since: ":android.api.combined.public.latest", baseline_file: ":non-updatable-lint-baseline.txt", }, }, @@ -124,13 +124,13 @@ non_updatable_exportable_droidstubs { removed_api_file: ":non-updatable-system-removed.txt", }, last_released: { - api_file: ":android-non-updatable.api.system.latest", - removed_api_file: ":android-non-updatable-removed.api.system.latest", + api_file: ":android-non-updatable.api.combined.system.latest", + removed_api_file: ":android-non-updatable-removed.api.combined.system.latest", baseline_file: ":android-non-updatable-incompatibilities.api.system.latest", }, api_lint: { enabled: true, - new_since: ":android.api.system.latest", + new_since: ":android.api.combined.system.latest", baseline_file: ":non-updatable-system-lint-baseline.txt", }, }, @@ -185,7 +185,7 @@ non_updatable_exportable_droidstubs { }, api_lint: { enabled: true, - new_since: ":android.api.test.latest", + new_since: ":android.api.combined.test.latest", baseline_file: ":non-updatable-test-lint-baseline.txt", }, }, @@ -263,13 +263,13 @@ non_updatable_exportable_droidstubs { removed_api_file: ":non-updatable-module-lib-removed.txt", }, last_released: { - api_file: ":android-non-updatable.api.module-lib.latest", - removed_api_file: ":android-non-updatable-removed.api.module-lib.latest", + api_file: ":android-non-updatable.api.combined.module-lib.latest", + removed_api_file: ":android-non-updatable-removed.api.combined.module-lib.latest", baseline_file: ":android-non-updatable-incompatibilities.api.module-lib.latest", }, api_lint: { enabled: true, - new_since: ":android.api.module-lib.latest", + new_since: ":android.api.combined.module-lib.latest", baseline_file: ":non-updatable-module-lib-lint-baseline.txt", }, }, @@ -1135,31 +1135,47 @@ java_library { ], } -droidstubs { - name: "api_versions_public", - srcs: [":android_stubs_current_with_test_libs{.jar}"], +// Defaults for `droidstubs` modules that generate `api-versions.xml` files for +// the various API surfaces. +stubs_defaults { + name: "api_versions_base_defaults", + defaults_visibility: ["//visibility:private"], generate_stubs: false, api_levels_annotations_enabled: true, api_levels_annotations_dirs: [ "sdk-dir", "api-versions-jars-dir", ], - api_levels_sdk_type: "public", +} + +// Defaults for `droidstubs` modules that generate complete `api-versions.xml` +// files, i.e. include SDK extensions. +stubs_defaults { + name: "api_versions_complete_defaults", + defaults_visibility: ["//visibility:private"], + defaults: ["api_versions_base_defaults"], extensions_info_file: ":sdk-extensions-info", +} + +// Produces an `api-versions.xml` file that includes up-to-date information +// about all the public APIs, both updatable and non-updatable and historic +// information about all previous dessert and SDK extension releases. +droidstubs { + name: "api_versions_public", + defaults: ["api_versions_complete_defaults"], + srcs: [":android_stubs_current_with_test_libs{.jar}"], + api_levels_sdk_type: "public", visibility: ["//frameworks/base"], } +// Produces an `api-versions.xml` file that includes up-to-date information +// about all the system APIs, both updatable and non-updatable and historic +// information about all previous dessert and SDK extension releases. droidstubs { name: "api_versions_system", + defaults: ["api_versions_complete_defaults"], srcs: [":android_system_stubs_current_with_test_libs{.jar}"], - generate_stubs: false, - api_levels_annotations_enabled: true, - api_levels_annotations_dirs: [ - "sdk-dir", - "api-versions-jars-dir", - ], api_levels_sdk_type: "system", - extensions_info_file: ":sdk-extensions-info", dists: [ // Make the api-versions.xml file for the system API available in the // sdk build target. @@ -1171,42 +1187,99 @@ droidstubs { ], } -// This module can be built with: -// m out/soong/.intermediates/frameworks/base/api/api_versions_module_lib/android_common/metalava/api-versions.xml -droidstubs { - name: "api_versions_module_lib", - srcs: [":android_module_stubs_current_with_test_libs{.jar}"], - generate_stubs: false, - api_levels_annotations_enabled: true, +// Defaults for `droidstubs` modules that generate `api-versions.xml` files that +// only include non-updatable code, i.e. for platform API only, not SDK +// extensions. +stubs_defaults { + name: "api_versions_non_updatable_defaults", + defaults_visibility: ["//visibility:private"], + defaults: ["api_versions_base_defaults"], // this only has the non-updatable portions of the module lib sdk, // which can reference classes from updatable apexes, so remove references to them // from this api_versions file. flags: ["--remove-missing-class-references-in-api-levels"], - api_levels_annotations_dirs: [ - "sdk-dir", - "api-versions-jars-dir", - ], - api_levels_sdk_type: "module-lib", // extensions_info_file is purposefully omitted, because this module should just be // the non-updatable portions of the sdk, and extension sdks are updatable. } +// Produces an `api-versions.xml` file that includes up-to-date information +// about only the non-updatable module-lib APIs and historic information about +// all previous dessert and SDK extension releases. That historic information +// may include information about APIs that were previously not-updatable which +// have since become updatable. +droidstubs { + name: "api_versions_module_lib", + defaults: ["api_versions_non_updatable_defaults"], + srcs: [":android_module_stubs_current_with_test_libs{.jar}"], + api_levels_sdk_type: "module-lib", +} + +// Create a single jar containing the whole module-lib API surface. +// This is needed because Metalava only consumes the first jar file it is given +// and ignores the rest. +java_library { + name: "android_module_stubs_complete_current_with_test_libs", + static_libs: [ + "android_module_stubs_current_with_test_libs", + "framework-updatable-stubs-module_libs_api-exportable", + ], + defaults: ["android.jar_defaults"], + visibility: [ + "//visibility:override", + "//visibility:private", + ], +} + +// Produces an `api-versions.xml` file that includes up-to-date information +// about all the module-lib APIs, both updatable and non-updatable and historic +// information about all previous dessert and SDK extension releases. +droidstubs { + name: "api_versions_module_lib_complete", + defaults: ["api_versions_complete_defaults"], + srcs: [":android_module_stubs_complete_current_with_test_libs{.jar}"], + api_levels_sdk_type: "module-lib", +} + +// Produces an `api-versions.xml` file that includes up-to-date information +// about only the non-updatable system-server APIs and historic information +// about all previous dessert and SDK extension releases. That historic +// information may include information about APIs that were previously +// not-updatable which have since become updatable. droidstubs { name: "api_versions_system_server", + defaults: ["api_versions_non_updatable_defaults"], srcs: [":android_system_server_stubs_current_with_test_libs{.jar}"], - generate_stubs: false, - api_levels_annotations_enabled: true, - // this only has the non-updatable portions of the system server sdk, - // which can reference classes from updatable apexes, so remove references to them - // from this api_versions file. - flags: ["--remove-missing-class-references-in-api-levels"], - api_levels_annotations_dirs: [ - "sdk-dir", - "api-versions-jars-dir", + api_levels_sdk_type: "system-server", +} + +// Create a single jar containing the whole system-server API surface. +// This is needed because Metalava only consumes the first jar file it is given +// and ignores the rest. +java_library { + name: "android_system_server_stubs_complete_current_with_test_libs", + static_libs: [ + "android_system_server_stubs_current_with_test_libs", + // system-server extends module-lib but libraries which only service-* + // libraries provided system-server APIs, so include module-lib APIs for + // the others, e.g. framework-* libraries. + "framework-updatable-stubs-module_libs_api-exportable", + "framework-updatable-stubs-system_server_api-exportable", + ], + defaults: ["android.jar_defaults"], + visibility: [ + "//visibility:override", + "//visibility:private", ], +} + +// Produces an `api-versions.xml` file that includes up-to-date information +// about all the system-server APIs, both updatable and non-updatable and +// historic information about all previous dessert and SDK extension releases. +droidstubs { + name: "api_versions_system_server_complete", + defaults: ["api_versions_complete_defaults"], + srcs: [":android_system_server_stubs_complete_current_with_test_libs{.jar}"], api_levels_sdk_type: "system-server", - // extensions_info_file is purposefully omitted, because this module should just be - // the non-updatable portions of the sdk, and extension sdks are updatable. } ///////////////////////////////////////////////////////////////////// |