[automerge] java_sdk_library_import: Copy all prebuilt properties to child modules 2p: 397924a23b

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/20082017

Bug: 249192297
Change-Id: I37e1a9d447fd4698a845eae32c7eedc00fdaa321
Merged-In: I5719c257f8457bcb2238bc7965215512a20f1095
This commit is contained in:
Paul Duffin
2022-09-29 10:30:41 +00:00
committed by Presubmit Automerger Backend
3 changed files with 91 additions and 10 deletions

View File

@@ -2236,8 +2236,9 @@ func (module *SdkLibraryImport) createJavaImportForStubs(mctx android.Defaultabl
Sdk_version *string
Libs []string
Jars []string
Prefer *bool
Compile_dex *bool
android.UserSuppliedPrebuiltProperties
}{}
props.Name = proptools.StringPtr(module.stubsLibraryModuleName(apiScope))
props.Sdk_version = scopeProperties.Sdk_version
@@ -2247,7 +2248,7 @@ func (module *SdkLibraryImport) createJavaImportForStubs(mctx android.Defaultabl
props.Jars = scopeProperties.Jars
// The imports are preferred if the java_sdk_library_import is preferred.
props.Prefer = proptools.BoolPtr(module.prebuilt.Prefer())
props.CopyUserSuppliedPropertiesFromPrebuilt(&module.prebuilt)
// The imports need to be compiled to dex if the java_sdk_library_import requests it.
compileDex := module.properties.Compile_dex
@@ -2261,16 +2262,18 @@ func (module *SdkLibraryImport) createJavaImportForStubs(mctx android.Defaultabl
func (module *SdkLibraryImport) createPrebuiltStubsSources(mctx android.DefaultableHookContext, apiScope *apiScope, scopeProperties *sdkLibraryScopeProperties) {
props := struct {
Name *string
Srcs []string
Prefer *bool
Name *string
Srcs []string
android.UserSuppliedPrebuiltProperties
}{}
props.Name = proptools.StringPtr(module.stubsSourceModuleName(apiScope))
props.Srcs = scopeProperties.Stub_srcs
mctx.CreateModule(PrebuiltStubsSourcesFactory, &props)
// The stubs source is preferred if the java_sdk_library_import is preferred.
props.Prefer = proptools.BoolPtr(module.prebuilt.Prefer())
props.CopyUserSuppliedPropertiesFromPrebuilt(&module.prebuilt)
mctx.CreateModule(PrebuiltStubsSourcesFactory, &props)
}
// Add the dependencies on the child module in the component deps mutator so that it