Redefine core and core platform API surface java_library
Redefined core and core platform API surface java_library using the product variable build_from_text_stub so that the correct static libs are linked based on build configuration Test: m --build-from-text-stub and verify no ninja path between "core.current.stubs" and "core.current.stubs.from-source" Bug: 285410821 Change-Id: I26febc65697be6278624a504ffbb61be0953d798
This commit is contained in:
@@ -33,19 +33,45 @@ dist_targets = [
|
||||
"win_sdk",
|
||||
]
|
||||
|
||||
java_library {
|
||||
name: "core.current.stubs",
|
||||
java_defaults {
|
||||
name: "core.current.stubs.defaults",
|
||||
visibility: ["//visibility:public"],
|
||||
sdk_version: "none",
|
||||
system_modules: "none",
|
||||
dist: {
|
||||
targets: dist_targets,
|
||||
},
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "core.current.stubs.from-source",
|
||||
defaults: [
|
||||
"core.current.stubs.defaults",
|
||||
],
|
||||
static_libs: [
|
||||
"art.module.public.api.stubs",
|
||||
"conscrypt.module.public.api.stubs",
|
||||
"i18n.module.public.api.stubs",
|
||||
],
|
||||
sdk_version: "none",
|
||||
system_modules: "none",
|
||||
}
|
||||
|
||||
dist: {
|
||||
targets: dist_targets,
|
||||
java_library {
|
||||
name: "core.current.stubs",
|
||||
defaults: [
|
||||
"core.current.stubs.defaults",
|
||||
],
|
||||
static_libs: [
|
||||
"core.current.stubs.from-source",
|
||||
],
|
||||
product_variables: {
|
||||
build_from_text_stub: {
|
||||
static_libs: [
|
||||
"core.current.stubs.from-text",
|
||||
],
|
||||
exclude_static_libs: [
|
||||
"core.current.stubs.from-source",
|
||||
],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -199,18 +225,46 @@ core_platform_visibility = ["//visibility:public"]
|
||||
// API annotations are available to the dex tools that enable enforcement of runtime
|
||||
// accessibility. b/119068555
|
||||
java_library {
|
||||
name: "legacy.core.platform.api.stubs",
|
||||
name: "legacy.core.platform.api.stubs.from-source",
|
||||
visibility: core_platform_visibility,
|
||||
hostdex: true,
|
||||
compile_dex: true,
|
||||
|
||||
sdk_version: "none",
|
||||
system_modules: "none",
|
||||
defaults: [
|
||||
"core.platform.api.stubs.defaults",
|
||||
],
|
||||
static_libs: [
|
||||
"art.module.public.api.stubs.module_lib",
|
||||
"conscrypt.module.platform.api.stubs",
|
||||
"legacy.i18n.module.platform.api.stubs",
|
||||
],
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "legacy.core.platform.api.stubs",
|
||||
visibility: core_platform_visibility,
|
||||
defaults: [
|
||||
"core.platform.api.stubs.defaults",
|
||||
],
|
||||
static_libs: [
|
||||
"legacy.core.platform.api.stubs.from-source",
|
||||
],
|
||||
product_variables: {
|
||||
build_from_text_stub: {
|
||||
static_libs: [
|
||||
"stable.core.platform.api.stubs.from-text",
|
||||
],
|
||||
exclude_static_libs: [
|
||||
"stable.core.platform.api.stubs.from-source",
|
||||
],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
java_defaults {
|
||||
name: "core.platform.api.stubs.defaults",
|
||||
hostdex: true,
|
||||
compile_dex: true,
|
||||
|
||||
sdk_version: "none",
|
||||
system_modules: "none",
|
||||
patch_module: "java.base",
|
||||
}
|
||||
|
||||
@@ -233,20 +287,38 @@ java_library {
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "stable.core.platform.api.stubs",
|
||||
name: "stable.core.platform.api.stubs.from-source",
|
||||
visibility: core_platform_visibility,
|
||||
hostdex: true,
|
||||
compile_dex: true,
|
||||
|
||||
sdk_version: "none",
|
||||
system_modules: "none",
|
||||
defaults: [
|
||||
"core.platform.api.stubs.defaults",
|
||||
],
|
||||
static_libs: [
|
||||
"art.module.public.api.stubs.module_lib",
|
||||
// conscrypt only has a stable version, so it is okay to depend on it here:
|
||||
"conscrypt.module.platform.api.stubs",
|
||||
"stable.i18n.module.platform.api.stubs",
|
||||
],
|
||||
patch_module: "java.base",
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "stable.core.platform.api.stubs",
|
||||
visibility: core_platform_visibility,
|
||||
defaults: [
|
||||
"core.platform.api.stubs.defaults",
|
||||
],
|
||||
static_libs: [
|
||||
"stable.core.platform.api.stubs.from-source",
|
||||
],
|
||||
product_variables: {
|
||||
build_from_text_stub: {
|
||||
static_libs: [
|
||||
"stable.core.platform.api.stubs.from-text",
|
||||
],
|
||||
exclude_static_libs: [
|
||||
"stable.core.platform.api.stubs.from-source",
|
||||
],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// Same as stable.core.platform.api.stubs, but android annotations are
|
||||
|
Reference in New Issue
Block a user