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

Commit ae6c5207 authored by Colin Cross's avatar Colin Cross
Browse files

Move ImageMutator after archMutator

Move the ImageMutator to be registered just after the archMutator
in preparation for moving it between osMutator and archMutator.
Requries updating variants in a few tests that now run the
ImageMutator.

Bug: 142286466
Test: no change to build.ninja
Test: all soong tests
Change-Id: Ia9d2a7bc0e225bedec3c9a83ea04f471a931bf47
parent f3c24c12
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@

package android

// ImageInterface is implemented by modules that need to be split by the ImageMutator.
// ImageInterface is implemented by modules that need to be split by the imageMutator.
type ImageInterface interface {
	// ImageMutatorBegin is called before any other method in the ImageInterface.
	ImageMutatorBegin(ctx BaseModuleContext)
@@ -48,9 +48,9 @@ const (
	RecoveryVariation string = "recovery"
)

// ImageMutator creates variants for modules that implement the ImageInterface that
// imageMutator creates variants for modules that implement the ImageInterface that
// allow them to build differently for each partition (recovery, core, vendor, etc.).
func ImageMutator(ctx BottomUpMutatorContext) {
func imageMutator(ctx BottomUpMutatorContext) {
	if ctx.Os() != Android {
		return
	}
+1 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ func registerArchMutator(ctx RegisterMutatorsContext) {
	ctx.BottomUp("os", osMutator).Parallel()
	ctx.BottomUp("arch", archMutator).Parallel()
	ctx.TopDown("arch_hooks", archHookMutator).Parallel()
	ctx.BottomUp("image", imageMutator).Parallel()
}

var preDeps = []RegisterMutatorFunc{
+0 −3
Original line number Diff line number Diff line
@@ -29,9 +29,6 @@ func testPrebuiltEtc(t *testing.T, bp string) (*TestContext, Config) {
	ctx.RegisterModuleType("prebuilt_usr_share_host", PrebuiltUserShareHostFactory)
	ctx.RegisterModuleType("prebuilt_font", PrebuiltFontFactory)
	ctx.RegisterModuleType("prebuilt_firmware", PrebuiltFirmwareFactory)
	ctx.PreDepsMutators(func(ctx RegisterMutatorsContext) {
		ctx.BottomUp("prebuilt_etc", ImageMutator).Parallel()
	})
	ctx.Register()
	mockFiles := map[string][]byte{
		"Android.bp": []byte(bp),
+0 −1
Original line number Diff line number Diff line
@@ -140,7 +140,6 @@ func testApexContext(t *testing.T, bp string, handlers ...testCustomizer) (*andr
		ctx.BottomUp("prebuilts", android.PrebuiltMutator).Parallel()
	})
	ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) {
		ctx.BottomUp("image", android.ImageMutator).Parallel()
		ctx.BottomUp("link", cc.LinkageMutator).Parallel()
		ctx.BottomUp("vndk", cc.VndkMutator).Parallel()
		ctx.BottomUp("test_per_src", cc.TestPerSrcMutator).Parallel()
+1 −2
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ func init() {

	android.PreDepsMutators(func(ctx android.RegisterMutatorsContext) {
		ctx.BottomUp("vndk", VndkMutator).Parallel()
		ctx.BottomUp("image", android.ImageMutator).Parallel()
		ctx.BottomUp("link", LinkageMutator).Parallel()
		ctx.BottomUp("ndk_api", ndkApiMutator).Parallel()
		ctx.BottomUp("test_per_src", TestPerSrcMutator).Parallel()
@@ -218,7 +217,7 @@ type BaseProperties struct {
	// Make this module available when building for recovery
	Recovery_available *bool

	// Set by ImageMutator
	// Set by imageMutator
	CoreVariantNeeded     bool     `blueprint:"mutated"`
	RecoveryVariantNeeded bool     `blueprint:"mutated"`
	VendorVariants        []string `blueprint:"mutated"`
Loading