diff --git a/android/image.go b/android/image.go index 5ec1b16f5..8424cf8b5 100644 --- a/android/image.go +++ b/android/image.go @@ -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 } diff --git a/android/mutator.go b/android/mutator.go index 0d253eb5c..eba0e2fd4 100644 --- a/android/mutator.go +++ b/android/mutator.go @@ -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{ diff --git a/android/prebuilt_etc_test.go b/android/prebuilt_etc_test.go index 3855dac8f..2c4123f3b 100644 --- a/android/prebuilt_etc_test.go +++ b/android/prebuilt_etc_test.go @@ -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), diff --git a/apex/apex_test.go b/apex/apex_test.go index 509d76039..2d38a186d 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -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() diff --git a/cc/cc.go b/cc/cc.go index 733bda683..e80e2a297 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -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"` diff --git a/cc/genrule_test.go b/cc/genrule_test.go index 785e3e1e4..9f159e54d 100644 --- a/cc/genrule_test.go +++ b/cc/genrule_test.go @@ -74,13 +74,13 @@ func TestArchGenruleCmd(t *testing.T) { t.Fatal(errs) } - gen := ctx.ModuleForTests("gen", "android_arm_armv7-a-neon").Output("out_arm") + gen := ctx.ModuleForTests("gen", "android_arm_armv7-a-neon_core").Output("out_arm") expected := []string{"foo"} if !reflect.DeepEqual(expected, gen.Inputs.Strings()) { t.Errorf(`want arm inputs %v, got %v`, expected, gen.Inputs.Strings()) } - gen = ctx.ModuleForTests("gen", "android_arm64_armv8-a").Output("out_arm64") + gen = ctx.ModuleForTests("gen", "android_arm64_armv8-a_core").Output("out_arm64") expected = []string{"bar"} if !reflect.DeepEqual(expected, gen.Inputs.Strings()) { t.Errorf(`want arm64 inputs %v, got %v`, expected, gen.Inputs.Strings()) diff --git a/cc/testing.go b/cc/testing.go index 3b10f876f..18cc83f87 100644 --- a/cc/testing.go +++ b/cc/testing.go @@ -271,7 +271,6 @@ func CreateTestContext(bp string, fs map[string][]byte, ctx.RegisterModuleType("vndk_prebuilt_shared", VndkPrebuiltSharedFactory) ctx.RegisterModuleType("vndk_libraries_txt", VndkLibrariesTxtFactory) ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) { - ctx.BottomUp("image", android.ImageMutator).Parallel() ctx.BottomUp("link", LinkageMutator).Parallel() ctx.BottomUp("vndk", VndkMutator).Parallel() ctx.BottomUp("version", VersionMutator).Parallel() diff --git a/java/java_test.go b/java/java_test.go index b8fae8e8a..bfd80c363 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -1177,7 +1177,7 @@ func TestJavaSdkLibrary(t *testing.T) { ctx.ModuleForTests("foo"+sdkDocsSuffix, "android_common") ctx.ModuleForTests("foo"+sdkDocsSuffix+sdkSystemApiSuffix, "android_common") ctx.ModuleForTests("foo"+sdkDocsSuffix+sdkTestApiSuffix, "android_common") - ctx.ModuleForTests("foo"+sdkXmlFileSuffix, "android_arm64_armv8-a") + ctx.ModuleForTests("foo"+sdkXmlFileSuffix, "android_arm64_armv8-a_core") ctx.ModuleForTests("foo.api.public.28", "") ctx.ModuleForTests("foo.api.system.28", "") ctx.ModuleForTests("foo.api.test.28", "") diff --git a/rust/testing.go b/rust/testing.go index 45dbbbdcf..2067f8249 100644 --- a/rust/testing.go +++ b/rust/testing.go @@ -185,7 +185,6 @@ func CreateTestContext(bp string) *android.TestContext { ctx.RegisterModuleType("toolchain_library", cc.ToolchainLibraryFactory) ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) { // cc mutators - ctx.BottomUp("image", android.ImageMutator).Parallel() ctx.BottomUp("link", cc.LinkageMutator).Parallel() ctx.BottomUp("version", cc.VersionMutator).Parallel() ctx.BottomUp("begin", cc.BeginMutator).Parallel() diff --git a/sdk/testing.go b/sdk/testing.go index 47a58b1b4..604fa1690 100644 --- a/sdk/testing.go +++ b/sdk/testing.go @@ -58,7 +58,6 @@ func testSdkContext(bp string, fs map[string][]byte) (*android.TestContext, andr ctx.RegisterModuleType("llndk_library", cc.LlndkLibraryFactory) ctx.RegisterModuleType("toolchain_library", cc.ToolchainLibraryFactory) 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() diff --git a/sysprop/sysprop_test.go b/sysprop/sysprop_test.go index 5e0eb35c7..81f4c5376 100644 --- a/sysprop/sysprop_test.go +++ b/sysprop/sysprop_test.go @@ -73,7 +73,6 @@ func testContext(config android.Config, bp string, ctx.RegisterModuleType("llndk_library", cc.LlndkLibraryFactory) ctx.RegisterModuleType("toolchain_library", cc.ToolchainLibraryFactory) 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("version", cc.VersionMutator).Parallel() diff --git a/xml/xml_test.go b/xml/xml_test.go index 0a1156670..f42ba7762 100644 --- a/xml/xml_test.go +++ b/xml/xml_test.go @@ -104,7 +104,7 @@ func TestPrebuiltEtcXml(t *testing.T) { {rule: "xmllint-minimal", input: "baz.xml"}, } { t.Run(tc.schemaType, func(t *testing.T) { - rule := ctx.ModuleForTests(tc.input, "android_arm64_armv8-a").Rule(tc.rule) + rule := ctx.ModuleForTests(tc.input, "android_arm64_armv8-a_core").Rule(tc.rule) assertEqual(t, "input", tc.input, rule.Input.String()) if tc.schemaType != "" { assertEqual(t, "schema", tc.schema, rule.Args[tc.schemaType]) @@ -112,6 +112,6 @@ func TestPrebuiltEtcXml(t *testing.T) { }) } - m := ctx.ModuleForTests("foo.xml", "android_arm64_armv8-a").Module().(*prebuiltEtcXml) + m := ctx.ModuleForTests("foo.xml", "android_arm64_armv8-a_core").Module().(*prebuiltEtcXml) assertEqual(t, "installDir", buildDir+"/target/product/test_device/system/etc", m.InstallDirPath().String()) }