Merge "Fix mutator ordering issue in apex tests"

This commit is contained in:
Paul Duffin 2021-03-06 08:38:14 +00:00 committed by Gerrit Code Review
commit 97c8128eea
2 changed files with 8 additions and 3 deletions

View File

@ -240,7 +240,6 @@ func testApexContext(_ *testing.T, bp string, handlers ...testCustomizer) (*andr
ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators)
ctx.PreArchMutators(android.RegisterComponentsMutator)
ctx.PostDepsMutators(android.RegisterOverridePostDepsMutators)
android.RegisterPrebuiltMutators(ctx)
@ -249,6 +248,10 @@ func testApexContext(_ *testing.T, bp string, handlers ...testCustomizer) (*andr
ctx.PreArchMutators(android.RegisterVisibilityRuleGatherer)
ctx.PostDepsMutators(android.RegisterVisibilityRuleEnforcer)
// These must come after prebuilts and visibility rules to match runtime.
ctx.PostDepsMutators(android.RegisterOverridePostDepsMutators)
// These must come after override rules to match the runtime.
cc.RegisterRequiredBuildComponentsForTest(ctx)
rust.RegisterRequiredBuildComponentsForTest(ctx)
java.RegisterRequiredBuildComponentsForTest(ctx)
@ -5204,7 +5207,8 @@ func TestApexWithAppImportsPrefer(t *testing.T) {
}))
ensureExactContents(t, ctx, "myapex", "android_common_myapex_image", []string{
"app/AppFoo/AppFooPrebuilt.apk",
// TODO(b/181974714) - this is wrong it should be "app/AppFoo/AppFooPrebuilt.apk"
"app/AppFoo/AppFoo.apk",
})
}

View File

@ -20,12 +20,13 @@ import (
)
func RegisterRequiredBuildComponentsForTest(ctx android.RegistrationContext) {
// Genrule components must be registered before anything from cc to match runtime behavior.
genrule.RegisterGenruleBuildComponents(ctx)
RegisterPrebuiltBuildComponents(ctx)
RegisterCCBuildComponents(ctx)
RegisterBinaryBuildComponents(ctx)
RegisterLibraryBuildComponents(ctx)
RegisterLibraryHeadersBuildComponents(ctx)
genrule.RegisterGenruleBuildComponents(ctx)
ctx.RegisterModuleType("toolchain_library", ToolchainLibraryFactory)
ctx.RegisterModuleType("llndk_library", LlndkLibraryFactory)