Move namespace mutator earlier to support defaults

The prebuilts and defaults mutators start adding some dependencies, so
for them to be able to reference imported modules, we need to
run the namespace mutator earlier.

Test: m nothing
Test: Try to use a global defaults module from a namespace
Change-Id: I6e853d20e32251d0fd33c8b2dcc26c0695b808fd
This commit is contained in:
Dan Willemsen 2018-01-26 18:27:02 -08:00
parent ad4692d5af
commit 6e72ef7225
2 changed files with 2 additions and 2 deletions

View file

@ -76,6 +76,7 @@ var preArch = []RegisterMutatorFunc{
func(ctx RegisterMutatorsContext) {
ctx.TopDown("load_hooks", loadHookMutator).Parallel()
},
RegisterNamespaceMutator,
RegisterPrebuiltsPreArchMutators,
RegisterDefaultsPreArchMutators,
}
@ -86,7 +87,6 @@ func registerArchMutator(ctx RegisterMutatorsContext) {
}
var preDeps = []RegisterMutatorFunc{
RegisterNamespaceMutator,
registerArchMutator,
}

View file

@ -606,7 +606,7 @@ func setupTestFromFiles(bps map[string][]byte) (ctx *TestContext, errs []error)
ctx.MockFileSystem(bps)
ctx.RegisterModuleType("test_module", ModuleFactoryAdaptor(newTestModule))
ctx.RegisterModuleType("soong_namespace", ModuleFactoryAdaptor(NamespaceFactory))
ctx.PreDepsMutators(RegisterNamespaceMutator)
ctx.PreArchMutators(RegisterNamespaceMutator)
ctx.Register()
_, errs = ctx.ParseBlueprintsFiles("Android.bp")