From 9421c4ceb912ffb27df86d3a9cb0c8e5609e0384 Mon Sep 17 00:00:00 2001 From: Mark White Date: Thu, 10 Aug 2023 00:07:03 +0000 Subject: SdkTestCore for non-updatable modules Provides SdkTestCore/test_core_current sdk_version for non-updatable modules that have their test scope dependent on test apis from framework-minus-apex. Ignore-AOSP-First: Change in topic with internal-first projects Bug: 289776578 Test: m checkapi | go test ./java Merged-In: Iba3213e8c34ea75ac9dd8532a95ef62fb5455e6c Change-Id: Iba3213e8c34ea75ac9dd8532a95ef62fb5455e6c --- java/sdk_library.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'java/sdk_library.go') diff --git a/java/sdk_library.go b/java/sdk_library.go index 041aeb786..4ad3907a1 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -470,6 +470,9 @@ type ApiScopeProperties struct { // or the API file. They both have to use the same sdk_version as is used for // compiling the implementation library. Sdk_version *string + + // Extra libs used when compiling stubs for this scope. + Libs []string } type sdkLibraryProperties struct { @@ -1653,6 +1656,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.Libs = append(props.Libs, module.scopeToProperties[apiScope].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. @@ -1725,6 +1729,7 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC props.Libs = module.properties.Libs props.Libs = append(props.Libs, module.properties.Static_libs...) props.Libs = append(props.Libs, module.sdkLibraryProperties.Stub_only_libs...) + props.Libs = append(props.Libs, module.scopeToProperties[apiScope].Libs...) props.Aidl.Include_dirs = module.deviceProperties.Aidl.Include_dirs props.Aidl.Local_include_dirs = module.deviceProperties.Aidl.Local_include_dirs props.Java_version = module.properties.Java_version @@ -1864,6 +1869,7 @@ func (module *SdkLibrary) createApiLibrary(mctx android.DefaultableHookContext, props.Api_contributions = apiContributions props.Libs = module.properties.Libs props.Libs = append(props.Libs, module.sdkLibraryProperties.Stub_only_libs...) + props.Libs = append(props.Libs, module.scopeToProperties[apiScope].Libs...) props.Libs = append(props.Libs, "stub-annotations") props.Static_libs = module.sdkLibraryProperties.Stub_only_static_libs props.Full_api_surface_stub = proptools.StringPtr(apiScope.kind.DefaultJavaLibraryName()) -- cgit v1.2.3-59-g8ed1b