diff options
Diffstat (limited to 'StubLibraries.bp')
| -rw-r--r-- | StubLibraries.bp | 188 |
1 files changed, 119 insertions, 69 deletions
diff --git a/StubLibraries.bp b/StubLibraries.bp index e8aa3936d889..bb13eaacfa90 100644 --- a/StubLibraries.bp +++ b/StubLibraries.bp @@ -47,13 +47,14 @@ stubs_defaults { "core/java/**/*.logtags", ":opt-telephony-srcs", ":opt-net-voip-srcs", - ":core-current-stubs-source", - ":core_public_api_files", + ":art-module-public-api-stubs-source", + ":android_icu4j_public_api_files", + "**/package.html", ], libs: ["framework-internal-utils"], installable: false, annotations_enabled: true, - previous_api: ":last-released-public-api", + previous_api: ":android.api.public.latest", merge_annotations_dirs: [ "metalava-manual", ], @@ -64,14 +65,29 @@ stubs_defaults { stubs_defaults { name: "metalava-full-api-stubs-default", defaults: ["metalava-base-api-stubs-default"], - srcs: [":framework-updatable-sources"], + srcs: [ + ":conscrypt.module.public.api{.public.stubs.source}", + ":framework-updatable-sources", + ], sdk_version: "core_platform", } stubs_defaults { name: "metalava-non-updatable-api-stubs-default", defaults: ["metalava-base-api-stubs-default"], - sdk_version: "system_current", + sdk_version: "core_platform", + // There are a few classes from modules used as type arguments that + // need to be resolved by metalava. For now, we can use a previously + // finalized stub library to resolve them. If a new class gets added, + // this may be need to be revisited to use a manually maintained stub + // library with empty classes in order to resolve those references. + libs: ["sdk_system_29_android"], + aidl: { + local_include_dirs: [ + "media/apex/java", + "wifi/aidl-export", + ], + }, } ///////////////////////////////////////////////////////////////////// @@ -84,9 +100,7 @@ stubs_defaults { droidstubs { name: "api-stubs-docs", defaults: ["metalava-full-api-stubs-default"], - api_filename: "public_api.txt", - private_api_filename: "private.txt", - removed_api_filename: "removed.txt", + removed_dex_api_filename: "removed-dex.txt", arg_files: [ "core/res/AndroidManifest.xml", ], @@ -97,19 +111,37 @@ droidstubs { removed_api_file: "api/removed.txt", }, last_released: { - api_file: ":last-released-public-api", + api_file: ":android.api.public.latest", removed_api_file: "api/removed.txt", baseline_file: ":public-api-incompatibilities-with-last-released", }, api_lint: { enabled: true, - new_since: ":last-released-public-api", + new_since: ":android.api.public.latest", baseline_file: "api/lint-baseline.txt", }, }, + dist: { + targets: ["sdk", "win_sdk"], + dir: "apistubs/android/public/api", + dest: "android.txt", + }, jdiff_enabled: true, } +droidstubs { + name: "api-stubs-docs-non-updatable", + defaults: ["metalava-non-updatable-api-stubs-default"], + arg_files: ["core/res/AndroidManifest.xml"], + args: metalava_framework_docs_args, + check_api: { + current: { + api_file: "non-updatable-api/current.txt", + removed_api_file: "non-updatable-api/removed.txt", + }, + }, +} + priv_apps = " " + "--show-annotation android.annotation.SystemApi\\(" + "client=android.annotation.SystemApi.Client.PRIVILEGED_APPS" + @@ -123,10 +155,7 @@ module_libs = " " + droidstubs { name: "system-api-stubs-docs", defaults: ["metalava-full-api-stubs-default"], - api_tag_name: "SYSTEM", - api_filename: "system-api.txt", - private_api_filename: "system-private.txt", - removed_api_filename: "system-removed.txt", + removed_dex_api_filename: "system-removed-dex.txt", arg_files: [ "core/res/AndroidManifest.xml", ], @@ -137,25 +166,40 @@ droidstubs { removed_api_file: "api/system-removed.txt", }, last_released: { - api_file: ":last-released-system-api", + api_file: ":android.api.system.latest", removed_api_file: "api/system-removed.txt", baseline_file: ":system-api-incompatibilities-with-last-released" }, api_lint: { enabled: true, - new_since: ":last-released-system-api", + new_since: ":android.api.system.latest", baseline_file: "api/system-lint-baseline.txt", }, }, + dist: { + targets: ["sdk", "win_sdk"], + dir: "apistubs/android/system/api", + dest: "android.txt", + }, jdiff_enabled: true, } droidstubs { + name: "system-api-stubs-docs-non-updatable", + defaults: ["metalava-non-updatable-api-stubs-default"], + arg_files: ["core/res/AndroidManifest.xml"], + args: metalava_framework_docs_args + priv_apps, + check_api: { + current: { + api_file: "non-updatable-api/system-current.txt", + removed_api_file: "non-updatable-api/system-removed.txt", + }, + }, +} + +droidstubs { name: "test-api-stubs-docs", defaults: ["metalava-full-api-stubs-default"], - api_tag_name: "TEST", - api_filename: "test-api.txt", - removed_api_filename: "test-removed.txt", arg_files: [ "core/res/AndroidManifest.xml", ], @@ -170,6 +214,11 @@ droidstubs { baseline_file: "api/test-lint-baseline.txt", }, }, + dist: { + targets: ["sdk", "win_sdk"], + dir: "apistubs/android/test/api", + dest: "android.txt", + }, } ///////////////////////////////////////////////////////////////////// @@ -188,24 +237,45 @@ droidstubs { defaults: ["metalava-full-api-stubs-default"], arg_files: ["core/res/AndroidManifest.xml"], args: metalava_framework_docs_args + module_libs, + + // Do not generate stubs as they are not needed + generate_stubs: false, + check_api: { current: { api_file: "api/module-lib-current.txt", removed_api_file: "api/module-lib-removed.txt", }, last_released: { - api_file: ":last-released-module-lib-api", + api_file: ":android.api.module-lib.latest", removed_api_file: "api/module-lib-removed.txt", baseline_file: ":module-lib-api-incompatibilities-with-last-released" }, api_lint: { enabled: true, - new_since: ":last-released-module-lib-api", + new_since: ":android.api.module-lib.latest", baseline_file: "api/module-lib-lint-baseline.txt", }, }, + dist: { + targets: ["sdk", "win_sdk"], + dir: "apistubs/android/module-lib/api", + dest: "android.txt", + }, } +droidstubs { + name: "module-lib-api-stubs-docs-non-updatable", + defaults: ["metalava-non-updatable-api-stubs-default"], + arg_files: ["core/res/AndroidManifest.xml"], + args: metalava_framework_docs_args + module_libs, + check_api: { + current: { + api_file: "non-updatable-api/module-lib-current.txt", + removed_api_file: "non-updatable-api/module-lib-removed.txt", + }, + }, +} // The following droidstub module generates source files for the API stub library for // modules. Note that it not only includes its own APIs but also other APIs that have @@ -224,18 +294,20 @@ droidstubs { ///////////////////////////////////////////////////////////////////// java_defaults { - name: "framework-stubs-default", + name: "android_defaults_stubs_current", libs: [ "stub-annotations" ], - static_libs: [ "private-stub-annotations-jar" ], - sdk_version: "core_current", + static_libs: [ + "private-stub-annotations-jar", + + // License notices from art module + "art-notices-for-framework-stubs-jar", + ], errorprone: { javacflags: [ "-XepDisableAllChecks", ], }, - java_resources: [ - ":notices-for-framework-stubs", - ], + sdk_version: "none", system_modules: "none", java_version: "1.8", compile_dex: true, @@ -244,26 +316,40 @@ java_defaults { java_library_static { name: "android_stubs_current", srcs: [ ":api-stubs-docs" ], - defaults: ["framework-stubs-default"], + defaults: ["android_defaults_stubs_current"], } java_library_static { name: "android_system_stubs_current", srcs: [ ":system-api-stubs-docs" ], - defaults: ["framework-stubs-default"], + defaults: ["android_defaults_stubs_current"], } java_library_static { name: "android_test_stubs_current", srcs: [ ":test-api-stubs-docs" ], - defaults: ["framework-stubs-default"], + defaults: ["android_defaults_stubs_current"], } java_library_static { name: "android_module_lib_stubs_current", srcs: [ ":module-lib-api-stubs-docs" ], - defaults: ["framework-stubs-default"], - libs: ["android_system_stubs_current"], + defaults: ["android_defaults_stubs_current"], + libs: ["sdk_system_29_android"], +} + +java_library_static { + name: "android_non_updatable_stubs_current", + srcs: [":api-stubs-docs-non-updatable"], + defaults: ["android_defaults_stubs_current"], + libs: ["sdk_system_29_android"], +} + +java_library_static { + name: "android_system_non_updatable_stubs_current", + srcs: [":system-api-stubs-docs-non-updatable"], + defaults: ["android_defaults_stubs_current"], + libs: ["sdk_system_29_android"], } ///////////////////////////////////////////////////////////////////// @@ -294,7 +380,7 @@ droidstubs { installable: false, sdk_version: "core_platform", annotations_enabled: true, - previous_api: ":last-released-public-api", + previous_api: ":android.api.public.latest", merge_annotations_dirs: [ "metalava-manual", ], @@ -310,42 +396,6 @@ java_library_static { } ///////////////////////////////////////////////////////////////////// -// Stubs for hiddenapi processing. -///////////////////////////////////////////////////////////////////// - -droidstubs { - name: "hiddenapi-lists-docs", - defaults: ["metalava-full-api-stubs-default"], - arg_files: [ - "core/res/AndroidManifest.xml", - ], - removed_dex_api_filename: "removed-dex.txt", - args: metalava_framework_docs_args + - " --show-unannotated " + - priv_apps + - " --show-annotation android.annotation.TestApi ", -} - -droidstubs { - name: "hiddenapi-mappings", - defaults: ["metalava-full-api-stubs-default"], - srcs: [ - ":opt-telephony-common-srcs", - ], - - arg_files: [ - "core/res/AndroidManifest.xml", - ], - dex_mapping_filename: "dex-mapping.txt", - args: metalava_framework_docs_args + - " --hide ReferencesHidden " + - " --hide UnhiddenSystemApi " + - " --show-unannotated " + - priv_apps + - " --show-annotation android.annotation.TestApi ", -} - -///////////////////////////////////////////////////////////////////// // api/*-current.txt files for use by modules in other directories // like the CTS test ///////////////////////////////////////////////////////////////////// |