Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c77ceba authored by Colin Cross's avatar Colin Cross
Browse files

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
parent 0f670a22
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -396,7 +396,9 @@ func (module *sdkLibrary) createStubsLibrary(mctx android.TopDownMutatorContext,
	props.Sdk_version = proptools.StringPtr(module.sdkVersion(apiScope))
	props.Libs = module.sdkLibraryProperties.Stub_only_libs
	// Unbundled apps will use the prebult one from /prebuilts/sdk
	if mctx.Config().UnbundledBuildPrebuiltSdks() {
		props.Product_variables.Unbundled_build.Enabled = proptools.BoolPtr(false)
	}
	props.Product_variables.Pdk.Enabled = proptools.BoolPtr(false)
	props.No_standard_libs = module.Library.Module.properties.No_standard_libs
	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
func (module *sdkLibrary) HeaderJars(ctx android.BaseContext, sdkVersion string) android.Paths {
	// This module is just a wrapper for the stubs.
	if ctx.Config().UnbundledBuild() {
	if ctx.Config().UnbundledBuildPrebuiltSdks() {
		return module.PrebuiltJars(ctx, sdkVersion)
	} else {
		if strings.HasPrefix(sdkVersion, "system_") {
@@ -612,7 +614,7 @@ func (module *sdkLibrary) HeaderJars(ctx android.BaseContext, sdkVersion string)
// to satisfy SdkLibraryDependency interface
func (module *sdkLibrary) ImplementationJars(ctx android.BaseContext, sdkVersion string) android.Paths {
	// This module is just a wrapper for the stubs.
	if ctx.Config().UnbundledBuild() {
	if ctx.Config().UnbundledBuildPrebuiltSdks() {
		return module.PrebuiltJars(ctx, sdkVersion)
	} else {
		if strings.HasPrefix(sdkVersion, "system_") {