diff options
Diffstat (limited to 'api')
| -rw-r--r-- | api/Android.bp | 18 | ||||
| -rw-r--r-- | api/StubLibraries.bp | 27 | ||||
| -rw-r--r-- | api/api.go | 2 | ||||
| -rwxr-xr-x | api/gen_combined_removed_dex.sh | 2 |
4 files changed, 39 insertions, 10 deletions
diff --git a/api/Android.bp b/api/Android.bp index 3fa9c600741e..cd1997c8bf97 100644 --- a/api/Android.bp +++ b/api/Android.bp @@ -157,6 +157,7 @@ genrule { genrule { name: "frameworks-base-api-system-current-compat", srcs: [ + ":android.api.public.latest", ":android.api.system.latest", ":android-incompatibilities.api.system.latest", ":frameworks-base-api-current.txt", @@ -165,33 +166,35 @@ genrule { out: ["updated-baseline.txt"], tools: ["metalava"], cmd: metalava_cmd + + "--check-compatibility:api:released $(location :android.api.public.latest) " + "--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-current.txt) " + "$(location :frameworks-base-api-system-current.txt)", } genrule { name: "frameworks-base-api-module-lib-current-compat", srcs: [ + ":android.api.public.latest", + ":android.api.system.latest", ":android.api.module-lib.latest", ":android-incompatibilities.api.module-lib.latest", ":frameworks-base-api-current.txt", + ":frameworks-base-api-system-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.public.latest) " + + "--check-compatibility:api:released $(location :android.api.system.latest) " + "--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-current.txt) " + + "$(location :frameworks-base-api-system-current.txt) " + "$(location :frameworks-base-api-module-lib-current.txt)", } @@ -373,7 +376,6 @@ stubs_defaults { high_mem: true, // Lots of sources => high memory use, see b/170701554 installable: false, annotations_enabled: true, - previous_api: ":android.api.public.latest", merge_annotations_dirs: ["metalava-manual"], defaults_visibility: ["//frameworks/base/api"], visibility: [ diff --git a/api/StubLibraries.bp b/api/StubLibraries.bp index 6cfd2e0ce833..12820f9ff277 100644 --- a/api/StubLibraries.bp +++ b/api/StubLibraries.bp @@ -38,6 +38,9 @@ non_updatable_exportable_droidstubs { "android-non-updatable-stubs-defaults", "module-classpath-stubs-defaults", ], + // Use full Android API not just the non-updatable API as the latter is incomplete + // and can result in incorrect behavior. + previous_api: ":android.api.combined.public.latest", check_api: { current: { api_file: ":non-updatable-current.txt", @@ -118,6 +121,9 @@ non_updatable_exportable_droidstubs { "module-classpath-stubs-defaults", ], flags: priv_apps, + // Use full Android API not just the non-updatable API as the latter is incomplete + // and can result in incorrect behavior. + previous_api: ":android.api.combined.system.latest", check_api: { current: { api_file: ":non-updatable-system-current.txt", @@ -178,6 +184,9 @@ non_updatable_exportable_droidstubs { "module-classpath-stubs-defaults", ], flags: test + priv_apps_in_stubs, + // Use full Android API not just the non-updatable API as the latter is incomplete + // and can result in incorrect behavior. + previous_api: ":android.api.combined.test.latest", check_api: { current: { api_file: ":non-updatable-test-current.txt", @@ -257,6 +266,9 @@ non_updatable_exportable_droidstubs { "module-classpath-stubs-defaults", ], flags: priv_apps_in_stubs + module_libs, + // Use full Android API not just the non-updatable API as the latter is incomplete + // and can result in incorrect behavior. + previous_api: ":android.api.combined.module-lib.latest", check_api: { current: { api_file: ":non-updatable-module-lib-current.txt", @@ -571,6 +583,9 @@ java_api_library { ], defaults: ["android-non-updatable_everything_from_text_defaults"], full_api_surface_stub: "android_stubs_current.from-text", + // Use full Android API not just the non-updatable API as the latter is incomplete + // and can result in incorrect behavior. + previous_api: ":android.api.combined.public.latest", } java_api_library { @@ -582,6 +597,9 @@ java_api_library { ], defaults: ["android-non-updatable_everything_from_text_defaults"], full_api_surface_stub: "android_system_stubs_current.from-text", + // Use full Android API not just the non-updatable API as the latter is incomplete + // and can result in incorrect behavior. + previous_api: ":android.api.combined.system.latest", } java_api_library { @@ -594,6 +612,9 @@ java_api_library { ], defaults: ["android-non-updatable_everything_from_text_defaults"], full_api_surface_stub: "android_test_stubs_current.from-text", + // Use full Android API not just the non-updatable API as the latter is incomplete + // and can result in incorrect behavior. + previous_api: ":android.api.combined.test.latest", } java_api_library { @@ -606,6 +627,9 @@ java_api_library { ], defaults: ["android-non-updatable_everything_from_text_defaults"], full_api_surface_stub: "android_module_lib_stubs_current_full.from-text", + // Use full Android API not just the non-updatable API as the latter is incomplete + // and can result in incorrect behavior. + previous_api: ":android.api.combined.module-lib.latest", } // This module generates a stub jar that is a union of the test and module lib @@ -623,6 +647,8 @@ java_api_library { defaults: ["android-non-updatable_everything_from_text_defaults"], full_api_surface_stub: "android_test_module_lib_stubs_current.from-text", + // No need to specify previous_api as this is not used for compiling against. + // This module is only used for hiddenapi, and other modules should not // depend on this module. visibility: ["//visibility:private"], @@ -922,6 +948,7 @@ java_defaults { "i18n.module.public.api.stubs.source.system.api.contribution", "i18n.module.public.api.stubs.source.module_lib.api.contribution", ], + previous_api: ":android.api.combined.module-lib.latest", } // Java API library definitions per API surface diff --git a/api/api.go b/api/api.go index 449fac63f90c..d4db49e90a01 100644 --- a/api/api.go +++ b/api/api.go @@ -478,7 +478,7 @@ func createApiContributionDefaults(ctx android.LoadHookContext, modules []string props.Api_contributions = transformArray( modules, "", fmt.Sprintf(".stubs.source%s.api.contribution", apiSuffix)) props.Defaults_visibility = []string{"//visibility:public"} - props.Previous_api = proptools.StringPtr(":android.api.public.latest") + props.Previous_api = proptools.StringPtr(":android.api.combined." + sdkKind.String() + ".latest") ctx.CreateModule(java.DefaultsFactory, &props) } } diff --git a/api/gen_combined_removed_dex.sh b/api/gen_combined_removed_dex.sh index e0153f7c1091..2860e2ed17c2 100755 --- a/api/gen_combined_removed_dex.sh +++ b/api/gen_combined_removed_dex.sh @@ -6,6 +6,6 @@ shift 2 # Convert each removed.txt to the "dex format" equivalent, and print all output. for f in "$@"; do - "$metalava_path" signature-to-dex "$f" "${tmp_dir}/tmp" + "$metalava_path" signature-to-dex "$f" --out "${tmp_dir}/tmp" cat "${tmp_dir}/tmp" done |