Build java_sdk_library modules when UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true
java_sdk_library modules are usually disabled in favor of prebuilts when TARGET_BUILD_APPS is set. Keep them enabled when UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true, which is used by some unbundled builds built from a full source tree like mainline modules. Bug: 123183568 Test: m TARGET_PRODUCT=mainline_modules_arm UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true TARGET_BUILD_APPS=com.android.media Change-Id: Ifa940769e467ca4b7ad3b95106e184c00680d2ae
This commit is contained in:
@@ -396,7 +396,9 @@ func (module *sdkLibrary) createStubsLibrary(mctx android.TopDownMutatorContext,
|
|||||||
props.Sdk_version = proptools.StringPtr(module.sdkVersion(apiScope))
|
props.Sdk_version = proptools.StringPtr(module.sdkVersion(apiScope))
|
||||||
props.Libs = module.sdkLibraryProperties.Stub_only_libs
|
props.Libs = module.sdkLibraryProperties.Stub_only_libs
|
||||||
// Unbundled apps will use the prebult one from /prebuilts/sdk
|
// Unbundled apps will use the prebult one from /prebuilts/sdk
|
||||||
props.Product_variables.Unbundled_build.Enabled = proptools.BoolPtr(false)
|
if mctx.Config().UnbundledBuildPrebuiltSdks() {
|
||||||
|
props.Product_variables.Unbundled_build.Enabled = proptools.BoolPtr(false)
|
||||||
|
}
|
||||||
props.Product_variables.Pdk.Enabled = proptools.BoolPtr(false)
|
props.Product_variables.Pdk.Enabled = proptools.BoolPtr(false)
|
||||||
props.No_standard_libs = module.Library.Module.properties.No_standard_libs
|
props.No_standard_libs = module.Library.Module.properties.No_standard_libs
|
||||||
props.System_modules = module.Library.Module.deviceProperties.System_modules
|
props.System_modules = module.Library.Module.deviceProperties.System_modules
|
||||||
@@ -596,7 +598,7 @@ func (module *sdkLibrary) PrebuiltJars(ctx android.BaseContext, sdkVersion strin
|
|||||||
// to satisfy SdkLibraryDependency interface
|
// to satisfy SdkLibraryDependency interface
|
||||||
func (module *sdkLibrary) HeaderJars(ctx android.BaseContext, sdkVersion string) android.Paths {
|
func (module *sdkLibrary) HeaderJars(ctx android.BaseContext, sdkVersion string) android.Paths {
|
||||||
// This module is just a wrapper for the stubs.
|
// This module is just a wrapper for the stubs.
|
||||||
if ctx.Config().UnbundledBuild() {
|
if ctx.Config().UnbundledBuildPrebuiltSdks() {
|
||||||
return module.PrebuiltJars(ctx, sdkVersion)
|
return module.PrebuiltJars(ctx, sdkVersion)
|
||||||
} else {
|
} else {
|
||||||
if strings.HasPrefix(sdkVersion, "system_") {
|
if strings.HasPrefix(sdkVersion, "system_") {
|
||||||
@@ -612,7 +614,7 @@ func (module *sdkLibrary) HeaderJars(ctx android.BaseContext, sdkVersion string)
|
|||||||
// to satisfy SdkLibraryDependency interface
|
// to satisfy SdkLibraryDependency interface
|
||||||
func (module *sdkLibrary) ImplementationJars(ctx android.BaseContext, sdkVersion string) android.Paths {
|
func (module *sdkLibrary) ImplementationJars(ctx android.BaseContext, sdkVersion string) android.Paths {
|
||||||
// This module is just a wrapper for the stubs.
|
// This module is just a wrapper for the stubs.
|
||||||
if ctx.Config().UnbundledBuild() {
|
if ctx.Config().UnbundledBuildPrebuiltSdks() {
|
||||||
return module.PrebuiltJars(ctx, sdkVersion)
|
return module.PrebuiltJars(ctx, sdkVersion)
|
||||||
} else {
|
} else {
|
||||||
if strings.HasPrefix(sdkVersion, "system_") {
|
if strings.HasPrefix(sdkVersion, "system_") {
|
||||||
|
Reference in New Issue
Block a user