Add new stub_only_static_libs attr for sdk_library
Allow java_sdk_libraries to include libraries statically into their
stubs. The immediate use-case of this is to embed libcore notice files
into their stubs.
Also extend the java_sdk_library tests for impl/stub-only-libs, plus
some not assert utils.
Bug: 173186484
Bug: 184839599
Test: soong tests
Change-Id: I1ebf2f35c048eab5cec5125482a0304fe660f188
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 223be5c..05ce97a 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -399,6 +399,9 @@
// List of Java libraries that will be in the classpath when building stubs
Stub_only_libs []string `android:"arch_variant"`
+ // List of Java libraries that will included in stub libraries
+ Stub_only_static_libs []string `android:"arch_variant"`
+
// list of package names that will be documented and publicized as API.
// This allows the API to be restricted to a subset of the source files provided.
// If this is unspecified then all the source files will be treated as being part
@@ -1275,6 +1278,7 @@
System_modules *string
Patch_module *string
Libs []string
+ Static_libs []string
Compile_dex *bool
Java_version *string
Openjdk9 struct {
@@ -1299,6 +1303,7 @@
props.Patch_module = module.properties.Patch_module
props.Installable = proptools.BoolPtr(false)
props.Libs = module.sdkLibraryProperties.Stub_only_libs
+ props.Static_libs = module.sdkLibraryProperties.Stub_only_static_libs
// The stub-annotations library contains special versions of the annotations
// with CLASS retention policy, so that they're kept.
if proptools.Bool(module.sdkLibraryProperties.Annotations_enabled) {