From dae54cd84fff352cd1479314758cfd077da79e16 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Wed, 21 Apr 2021 16:30:10 +0100 Subject: 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 --- java/sdk_library.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'java/sdk_library.go') diff --git a/java/sdk_library.go b/java/sdk_library.go index 223be5cf7..05ce97aea 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -399,6 +399,9 @@ type sdkLibraryProperties struct { // 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 @@ func (module *SdkLibrary) createStubsLibrary(mctx android.DefaultableHookContext System_modules *string Patch_module *string Libs []string + Static_libs []string Compile_dex *bool Java_version *string Openjdk9 struct { @@ -1299,6 +1303,7 @@ func (module *SdkLibrary) createStubsLibrary(mctx android.DefaultableHookContext 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) { -- cgit v1.2.3-59-g8ed1b