Add stub_only_libs property
Java libraries are not included when a stub is built with
java_sdk_library. However, we may need a java library when building
stubs. For it, stub_only_libs property is added.
Bug: 77577799
Test: make -j
Change-Id: I2223288e3a85ec7f0ccccdc1da31f8d46cbcbcc0
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 55da533..5dfc32f 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -99,6 +99,9 @@
// These libraries are not compiled into the stubs jar.
Static_libs []string `android:"arch_variant"`
+ // List of Java libraries that will be in the classpath when building stubs
+ Stub_only_libs []string `android:"arch_variant"`
+
// list of package names that will be documented and publicized as API
Api_packages []string
@@ -297,6 +300,7 @@
Name *string
Srcs []string
Sdk_version *string
+ Libs []string
Soc_specific *bool
Device_specific *bool
Product_specific *bool
@@ -314,6 +318,7 @@
// sources are generated from the droiddoc
props.Srcs = []string{":" + module.docsName(apiScope)}
props.Sdk_version = proptools.StringPtr(module.sdkVersion(apiScope))
+ props.Libs = module.properties.Stub_only_libs
// Unbundled apps will use the prebult one from /prebuilts/sdk
props.Product_variables.Unbundled_build.Enabled = proptools.BoolPtr(false)
props.Product_variables.Pdk.Enabled = proptools.BoolPtr(false)