summaryrefslogtreecommitdiff
path: root/StubLibraries.bp
diff options
context:
space:
mode:
Diffstat (limited to 'StubLibraries.bp')
-rw-r--r--StubLibraries.bp183
1 files changed, 152 insertions, 31 deletions
diff --git a/StubLibraries.bp b/StubLibraries.bp
index 32101c791242..b005591980c0 100644
--- a/StubLibraries.bp
+++ b/StubLibraries.bp
@@ -36,8 +36,8 @@ droidstubs {
args: metalava_framework_docs_args,
check_api: {
current: {
- api_file: "core/api/current.txt",
- removed_api_file: "core/api/removed.txt",
+ api_file: ":non-updatable-current.txt",
+ removed_api_file: ":non-updatable-removed.txt",
},
last_released: {
api_file: ":android-non-updatable.api.public.latest",
@@ -88,8 +88,8 @@ droidstubs {
args: metalava_framework_docs_args + priv_apps,
check_api: {
current: {
- api_file: "core/api/system-current.txt",
- removed_api_file: "core/api/system-removed.txt",
+ api_file: ":non-updatable-system-current.txt",
+ removed_api_file: ":non-updatable-system-removed.txt",
},
last_released: {
api_file: ":android-non-updatable.api.system.latest",
@@ -99,7 +99,7 @@ droidstubs {
api_lint: {
enabled: true,
new_since: ":android.api.system.latest",
- baseline_file: "core/api/system-lint-baseline.txt",
+ baseline_file: ":non-updatable-system-lint-baseline.txt",
},
},
dists: [
@@ -127,12 +127,12 @@ droidstubs {
args: metalava_framework_docs_args + test + priv_apps_in_stubs,
check_api: {
current: {
- api_file: "core/api/test-current.txt",
- removed_api_file: "core/api/test-removed.txt",
+ api_file: ":non-updatable-test-current.txt",
+ removed_api_file: ":non-updatable-test-removed.txt",
},
api_lint: {
enabled: true,
- baseline_file: "core/api/test-lint-baseline.txt",
+ baseline_file: ":non-updatable-test-lint-baseline.txt",
},
},
dists: [
@@ -172,8 +172,8 @@ droidstubs {
args: metalava_framework_docs_args + priv_apps_in_stubs + module_libs,
check_api: {
current: {
- api_file: "core/api/module-lib-current.txt",
- removed_api_file: "core/api/module-lib-removed.txt",
+ api_file: ":non-updatable-module-lib-current.txt",
+ removed_api_file: ":non-updatable-module-lib-removed.txt",
},
last_released: {
api_file: ":android-non-updatable.api.module-lib.latest",
@@ -183,7 +183,7 @@ droidstubs {
api_lint: {
enabled: true,
new_since: ":android.api.module-lib.latest",
- baseline_file: "core/api/module-lib-lint-baseline.txt",
+ baseline_file: ":non-updatable-module-lib-lint-baseline.txt",
},
},
dists: [
@@ -328,10 +328,12 @@ java_library {
java_library {
name: "android_test_stubs_current",
- // Modules do not have test APIs, but we want to include their SystemApis, like we include
- // the SystemApi of framework-non-updatable-sources.
static_libs: [
- "all-modules-system-stubs",
+ // Updatable modules do not have test APIs, but we want to include their SystemApis, like we
+ // include the SystemApi of framework-non-updatable-sources.
+ "all-updatable-modules-system-stubs",
+ // Non-updatable modules on the other hand can have test APIs, so include their test-stubs.
+ "all-non-updatable-modules-test-stubs",
"android-non-updatable.stubs.test",
"private-stub-annotations-jar",
],
@@ -362,17 +364,78 @@ java_library {
java_library {
name: "android_system_server_stubs_current",
- defaults: ["android_stubs_dists_default"],
+ defaults: [
+ "android.jar_defaults",
+ "android_stubs_dists_default",
+ ],
srcs: [":services-non-updatable-stubs"],
installable: false,
static_libs: [
"android_module_lib_stubs_current",
],
+ dist: {
+ dir: "apistubs/android/system-server",
+ },
+}
+
+java_library {
+ name: "android_stubs_private_jar",
+ defaults: ["android.jar_defaults"],
+ visibility: [
+ "//visibility:override",
+ "//visibility:private",
+ ],
+ static_libs: [
+ "stable.core.platform.api.stubs",
+ "core-lambda-stubs-for-system-modules",
+ "core-generated-annotation-stubs",
+ "framework",
+ "ext",
+ "framework-res-package-jar",
+ // The order of this matters, it has to be last to provide a
+ // package-private androidx.annotation.RecentlyNonNull without
+ // overriding the public android.annotation.Nullable in framework.jar
+ // with its own package-private android.annotation.Nullable.
+ "private-stub-annotations-jar",
+ ],
+}
+
+java_genrule {
+ name: "android_stubs_private_hjar",
+ visibility: ["//visibility:private"],
+ srcs: [":android_stubs_private_jar{.hjar}"],
+ out: ["android_stubs_private.jar"],
+ cmd: "cp $(in) $(out)",
+}
+
+java_library {
+ name: "android_stubs_private",
+ defaults: ["android_stubs_dists_default"],
+ visibility: ["//visibility:private"],
sdk_version: "none",
system_modules: "none",
- java_version: "1.8",
+ static_libs: ["android_stubs_private_hjar"],
dist: {
- dir: "apistubs/android/system-server",
+ dir: "apistubs/android/private",
+ },
+}
+
+java_genrule {
+ name: "android_stubs_private_framework_aidl",
+ visibility: ["//visibility:private"],
+ tools: ["sdkparcelables"],
+ srcs: [":android_stubs_private"],
+ out: ["framework.aidl"],
+ cmd: "rm -f $(genDir)/framework.aidl.merged && " +
+ "for i in $(in); do " +
+ " rm -f $(genDir)/framework.aidl.tmp && " +
+ " $(location sdkparcelables) $$i $(genDir)/framework.aidl.tmp && " +
+ " cat $(genDir)/framework.aidl.tmp >> $(genDir)/framework.aidl.merged; " +
+ "done && " +
+ "sort -u $(genDir)/framework.aidl.merged > $(out)",
+ dist: {
+ targets: ["sdk"],
+ dir: "apistubs/android/private",
},
}
@@ -411,6 +474,36 @@ java_library {
],
}
+java_library {
+ name: "android_module_stubs_current_with_test_libs",
+ static_libs: [
+ "android_module_lib_stubs_current",
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
+ "android.test.runner.stubs",
+ ],
+ defaults: ["android.jar_defaults"],
+ visibility: [
+ "//visibility:override",
+ "//visibility:private",
+ ],
+}
+
+java_library {
+ name: "android_system_server_stubs_current_with_test_libs",
+ static_libs: [
+ "android_system_server_stubs_current",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
+ "android.test.runner.stubs.system",
+ ],
+ defaults: ["android.jar_defaults"],
+ visibility: [
+ "//visibility:override",
+ "//visibility:private",
+ ],
+}
+
droidstubs {
name: "api_versions_public",
srcs: [":android_stubs_current_with_test_libs{.jar}"],
@@ -420,6 +513,8 @@ droidstubs {
"sdk-dir",
"api-versions-jars-dir",
],
+ api_levels_sdk_type: "public",
+ extensions_info_file: ":sdk-extensions-info",
}
droidstubs {
@@ -432,6 +527,45 @@ droidstubs {
"api-versions-jars-dir",
],
api_levels_sdk_type: "system",
+ extensions_info_file: ":sdk-extensions-info",
+}
+
+// This module can be built with:
+// m out/soong/.intermediates/frameworks/base/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,
+ // 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.
+}
+
+droidstubs {
+ name: "api_versions_system_server",
+ 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",
+ // extensions_info_file is purposefully omitted, because this module should just be
+ // the non-updatable portions of the sdk, and extension sdks are updatable.
}
/////////////////////////////////////////////////////////////////////
@@ -441,20 +575,7 @@ droidstubs {
droidstubs {
name: "hwbinder-stubs-docs",
- srcs: [
- "core/java/android/os/HidlSupport.java",
- "core/java/android/os/HidlMemory.java",
- "core/java/android/os/HwBinder.java",
- "core/java/android/os/HwBlob.java",
- "core/java/android/os/HwParcel.java",
- "core/java/android/os/IHwBinder.java",
- "core/java/android/os/IHwInterface.java",
- "core/java/android/os/DeadObjectException.java",
- "core/java/android/os/DeadSystemException.java",
- "core/java/android/os/NativeHandle.java",
- "core/java/android/os/RemoteException.java",
- "core/java/android/util/AndroidException.java",
- ],
+ srcs: [":hwbinder-stubs-srcs"],
libs: ["framework-annotations-lib"],
installable: false,
sdk_version: "core_platform",