Merge "Strip annotations from library stubs" am: 61c6eef064
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2092623 Change-Id: Ifd82d1e8dd7c30ebafa65c0a3ccfd814ff833e77 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -138,11 +138,29 @@ java_library {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Same as core-module-lib-stubs-for-system-modules, but android annotations are
|
||||||
|
// stripped. This is used by the Java toolchain, while the annotated stub is to
|
||||||
|
// be used by Kotlin one.
|
||||||
|
java_library {
|
||||||
|
name: "core-module-lib-stubs-for-system-modules-no-annotations",
|
||||||
|
visibility: ["//visibility:private"],
|
||||||
|
static_libs: [
|
||||||
|
"core-module-lib-stubs-for-system-modules",
|
||||||
|
],
|
||||||
|
sdk_version: "none",
|
||||||
|
system_modules: "none",
|
||||||
|
dist: {
|
||||||
|
dest: "system-modules/module-lib/core-for-system-modules-no-annotations.jar",
|
||||||
|
targets: dist_targets,
|
||||||
|
},
|
||||||
|
jarjar_rules: "jarjar-strip-annotations-rules.txt",
|
||||||
|
}
|
||||||
|
|
||||||
// Used when compiling higher-level code with sdk_version "module_current"
|
// Used when compiling higher-level code with sdk_version "module_current"
|
||||||
java_system_modules {
|
java_system_modules {
|
||||||
name: "core-module-lib-stubs-system-modules",
|
name: "core-module-lib-stubs-system-modules",
|
||||||
libs: [
|
libs: [
|
||||||
"core-module-lib-stubs-for-system-modules",
|
"core-module-lib-stubs-for-system-modules-no-annotations",
|
||||||
],
|
],
|
||||||
visibility: ["//visibility:public"],
|
visibility: ["//visibility:public"],
|
||||||
}
|
}
|
||||||
@@ -174,6 +192,24 @@ java_library {
|
|||||||
patch_module: "java.base",
|
patch_module: "java.base",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Same as legacy.core.platform.api.stubs, but android annotations are
|
||||||
|
// stripped. This is used by the Java toolchain, while the annotated stub is to
|
||||||
|
// be used by Kotlin one.
|
||||||
|
java_library {
|
||||||
|
name: "legacy.core.platform.api.no.annotations.stubs",
|
||||||
|
visibility: core_platform_visibility,
|
||||||
|
hostdex: true,
|
||||||
|
compile_dex: true,
|
||||||
|
|
||||||
|
sdk_version: "none",
|
||||||
|
system_modules: "none",
|
||||||
|
static_libs: [
|
||||||
|
"legacy.core.platform.api.stubs",
|
||||||
|
],
|
||||||
|
patch_module: "java.base",
|
||||||
|
jarjar_rules: "jarjar-strip-annotations-rules.txt",
|
||||||
|
}
|
||||||
|
|
||||||
java_library {
|
java_library {
|
||||||
name: "stable.core.platform.api.stubs",
|
name: "stable.core.platform.api.stubs",
|
||||||
visibility: core_platform_visibility,
|
visibility: core_platform_visibility,
|
||||||
@@ -191,12 +227,30 @@ java_library {
|
|||||||
patch_module: "java.base",
|
patch_module: "java.base",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Same as stable.core.platform.api.stubs, but android annotations are
|
||||||
|
// stripped. This is used by the Java toolchain, while the annotated stub is to
|
||||||
|
// be used by Kotlin one.
|
||||||
|
java_library {
|
||||||
|
name: "stable.core.platform.api.no.annotations.stubs",
|
||||||
|
visibility: core_platform_visibility,
|
||||||
|
hostdex: true,
|
||||||
|
compile_dex: true,
|
||||||
|
|
||||||
|
sdk_version: "none",
|
||||||
|
system_modules: "none",
|
||||||
|
static_libs: [
|
||||||
|
"stable.core.platform.api.stubs",
|
||||||
|
],
|
||||||
|
patch_module: "java.base",
|
||||||
|
jarjar_rules: "jarjar-strip-annotations-rules.txt",
|
||||||
|
}
|
||||||
|
|
||||||
// Used when compiling higher-level code against *.core.platform.api.stubs.
|
// Used when compiling higher-level code against *.core.platform.api.stubs.
|
||||||
java_system_modules {
|
java_system_modules {
|
||||||
name: "legacy-core-platform-api-stubs-system-modules",
|
name: "legacy-core-platform-api-stubs-system-modules",
|
||||||
visibility: core_platform_visibility,
|
visibility: core_platform_visibility,
|
||||||
libs: [
|
libs: [
|
||||||
"legacy.core.platform.api.stubs",
|
"legacy.core.platform.api.no.annotations.stubs",
|
||||||
// This one is not on device but it's needed when javac compiles code
|
// This one is not on device but it's needed when javac compiles code
|
||||||
// containing lambdas.
|
// containing lambdas.
|
||||||
"core-lambda-stubs-for-system-modules",
|
"core-lambda-stubs-for-system-modules",
|
||||||
@@ -212,7 +266,7 @@ java_system_modules {
|
|||||||
name: "stable-core-platform-api-stubs-system-modules",
|
name: "stable-core-platform-api-stubs-system-modules",
|
||||||
visibility: core_platform_visibility,
|
visibility: core_platform_visibility,
|
||||||
libs: [
|
libs: [
|
||||||
"stable.core.platform.api.stubs",
|
"stable.core.platform.api.no.annotations.stubs",
|
||||||
// This one is not on device but it's needed when javac compiles code
|
// This one is not on device but it's needed when javac compiles code
|
||||||
// containing lambdas.
|
// containing lambdas.
|
||||||
"core-lambda-stubs-for-system-modules",
|
"core-lambda-stubs-for-system-modules",
|
||||||
|
4
java/core-libraries/jarjar-strip-annotations-rules.txt
Normal file
4
java/core-libraries/jarjar-strip-annotations-rules.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
strip-annotation android.annotation.NotNull
|
||||||
|
strip-annotation android.annotation.Nullable
|
||||||
|
strip-annotation androidx.annotation.RecentlyNonNull
|
||||||
|
strip-annotation androidx.annotation.RecentlyNullable
|
Reference in New Issue
Block a user