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

Commit 2aff024c authored by Jiyong Park's avatar Jiyong Park Committed by Gerrit Code Review
Browse files

Merge "Don't install sdk variants, not platform variants" into main

parents 992011ea acd5f590
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -119,16 +119,15 @@ func (c *Module) AndroidMkEntries() []android.AndroidMkEntries {
				} else if c.InProduct() {
					entries.SetBool("LOCAL_IN_PRODUCT", true)
				}
				if c.Properties.IsSdkVariant && c.Properties.SdkAndPlatformVariantVisibleToMake {
					// Make the SDK variant uninstallable so that there are not two rules to install
					// to the same location.
					entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", true)
				if c.Properties.SdkAndPlatformVariantVisibleToMake {
					// Add the unsuffixed name to SOONG_SDK_VARIANT_MODULES so that Make can rewrite
					// dependencies to the .sdk suffix when building a module that uses the SDK.
					entries.SetString("SOONG_SDK_VARIANT_MODULES",
						"$(SOONG_SDK_VARIANT_MODULES) $(patsubst %.sdk,%,$(LOCAL_MODULE))")
				}
				android.SetAconfigFileMkEntries(c.AndroidModuleBase(), entries, c.mergedAconfigFiles)

				entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", c.IsSkipInstall())
			},
		},
		ExtraFooters: []android.AndroidMkExtraFootersFunc{
+6 −3
Original line number Diff line number Diff line
@@ -49,15 +49,18 @@ func sdkMutator(ctx android.BottomUpMutatorContext) {
			modules[1].(*Module).Properties.IsSdkVariant = true

			if ctx.Config().UnbundledBuildApps() {
				// For an unbundled apps build, hide the platform variant from Make.
				// For an unbundled apps build, hide the platform variant from Make
				// so that other Make modules don't link against it, but against the
				// SDK variant.
				modules[0].(*Module).Properties.HideFromMake = true
				modules[0].(*Module).Properties.PreventInstall = true
			} else {
				// For a platform build, mark the SDK variant so that it gets a ".sdk" suffix when
				// exposed to Make.
				modules[1].(*Module).Properties.SdkAndPlatformVariantVisibleToMake = true
				modules[1].(*Module).Properties.PreventInstall = true
			}
			// SDK variant never gets installed because the variant is to be embedded in
			// APKs, not to be installed to the platform.
			modules[1].(*Module).Properties.PreventInstall = true
			ctx.AliasVariation("")
		} else {
			if isCcModule {