From 5aa5933732587efc20aa11574005177fb03b5564 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Fri, 21 Jan 2022 16:32:31 +0000 Subject: [PATCH] Dedupe default definitions slightly We only need one defaults for doc-stubs. Add the module-classpath defaults and api-db generation to the modules that need it instead. Test: m framework-doc-stubs before & after and diff soong intermediates Change-Id: I26066d1a8bb3ef190c89d840b52884d2b71ee977 --- ApiDocs.bp | 47 +++++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/ApiDocs.bp b/ApiDocs.bp index f7bd34ea2d66..ca019ee1786b 100644 --- a/ApiDocs.bp +++ b/ApiDocs.bp @@ -55,25 +55,9 @@ framework_docs_only_libs = [ "android-support-multidex-instrumentation", ] +// These defaults enable doc-stub generation, api lint database generation and sdk value generation. stubs_defaults { name: "android-non-updatable-doc-stubs-defaults", - defaults: [ - "android-non-updatable-stubs-defaults", - "module-classpath-stubs-defaults", - ], - srcs: [ - // No longer part of the stubs, but are included in the docs. - ":android-test-base-sources", - ":android-test-mock-sources", - ":android-test-runner-sources", - ], - libs: framework_docs_only_libs, - create_doc_stubs: true, - write_sdk_values: true, -} - -stubs_defaults { - name: "framework-doc-stubs-default", defaults: ["android-non-updatable-stubs-defaults"], srcs: [ // No longer part of the stubs, but are included in the docs. @@ -83,18 +67,13 @@ stubs_defaults { ], libs: framework_docs_only_libs, create_doc_stubs: true, - api_levels_annotations_enabled: true, - api_levels_annotations_dirs: [ - "sdk-dir", - "api-versions-jars-dir", - ], write_sdk_values: true, } // Defaults module for doc-stubs targets that use module source code as input. stubs_defaults { name: "framework-doc-stubs-sources-default", - defaults: ["framework-doc-stubs-default"], + defaults: ["android-non-updatable-doc-stubs-defaults"], srcs: [ ":art.module.public.api{.public.stubs.source}", ":conscrypt.module.public.api{.public.stubs.source}", @@ -119,13 +98,19 @@ stubs_defaults { droidstubs { name: "android-non-updatable-doc-stubs", - defaults: ["android-non-updatable-doc-stubs-defaults"], + defaults: [ + "android-non-updatable-doc-stubs-defaults", + "module-classpath-stubs-defaults", + ], args: metalava_framework_docs_args, } droidstubs { name: "android-non-updatable-doc-stubs-system", - defaults: ["android-non-updatable-doc-stubs-defaults"], + defaults: [ + "android-non-updatable-doc-stubs-defaults", + "module-classpath-stubs-defaults", + ], args: metalava_framework_docs_args + " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ", } @@ -135,14 +120,24 @@ droidstubs { defaults: ["framework-doc-stubs-sources-default"], args: metalava_framework_docs_args + " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ", + api_levels_annotations_enabled: true, + api_levels_annotations_dirs: [ + "sdk-dir", + "api-versions-jars-dir", + ], api_levels_sdk_type: "system", } droidstubs { name: "framework-doc-stubs", - defaults: ["framework-doc-stubs-default"], + defaults: ["android-non-updatable-doc-stubs-defaults"], srcs: [":all-modules-public-stubs-source"], args: metalava_framework_docs_args, + api_levels_annotations_enabled: true, + api_levels_annotations_dirs: [ + "sdk-dir", + "api-versions-jars-dir", + ], aidl: { local_include_dirs: [ "apex/media/aidl/stable",