Add FinalDeps mutator phase, where CreateVariations is disallowed.
This is for use to add dependencies between specific module variants, without getting the dependencies potentially duplicated as more variants are created. Moved genrule tool dependency registration to this phase, to avoid potential splitting of its dependencies, and for consistency with the same kind of dependency on dex2oat in https://r.android.com/1205730. Test: m nothing Bug: 145934348 Change-Id: I1f9e75354e359cef5f41d14e5016b0a67d7655d7
This commit is contained in:
@@ -50,9 +50,9 @@ func NewTestArchContext() *TestContext {
|
||||
|
||||
type TestContext struct {
|
||||
*Context
|
||||
preArch, preDeps, postDeps []RegisterMutatorFunc
|
||||
NameResolver *NameResolver
|
||||
config Config
|
||||
preArch, preDeps, postDeps, finalDeps []RegisterMutatorFunc
|
||||
NameResolver *NameResolver
|
||||
config Config
|
||||
}
|
||||
|
||||
func (ctx *TestContext) PreArchMutators(f RegisterMutatorFunc) {
|
||||
@@ -72,12 +72,16 @@ func (ctx *TestContext) PostDepsMutators(f RegisterMutatorFunc) {
|
||||
ctx.postDeps = append(ctx.postDeps, f)
|
||||
}
|
||||
|
||||
func (ctx *TestContext) FinalDepsMutators(f RegisterMutatorFunc) {
|
||||
ctx.finalDeps = append(ctx.finalDeps, f)
|
||||
}
|
||||
|
||||
func (ctx *TestContext) Register(config Config) {
|
||||
ctx.SetFs(config.fs)
|
||||
if config.mockBpList != "" {
|
||||
ctx.SetModuleListFile(config.mockBpList)
|
||||
}
|
||||
registerMutators(ctx.Context.Context, ctx.preArch, ctx.preDeps, ctx.postDeps)
|
||||
registerMutators(ctx.Context.Context, ctx.preArch, ctx.preDeps, ctx.postDeps, ctx.finalDeps)
|
||||
|
||||
ctx.RegisterSingletonType("env", EnvSingleton)
|
||||
|
||||
|
Reference in New Issue
Block a user