Make skip-cloning blueprint option public am: 1b5e9aba43
am: e5c8b9ae6f
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2623170 Change-Id: Id10626fccc803753763531c9e2ecfbc133760a04 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
3ed7ebd759
2 changed files with 10 additions and 4 deletions
12
context.go
12
context.go
|
@ -137,8 +137,12 @@ type Context struct {
|
||||||
// True for any mutators that have already run over all modules
|
// True for any mutators that have already run over all modules
|
||||||
finishedMutators map[*mutatorInfo]bool
|
finishedMutators map[*mutatorInfo]bool
|
||||||
|
|
||||||
// Can be set by tests to avoid invalidating Module values after mutators.
|
// If true, RunBlueprint will skip cloning modules at the end of RunBlueprint.
|
||||||
skipCloneModulesAfterMutators bool
|
// Cloning modules intentionally invalidates some Module values after
|
||||||
|
// mutators run (to ensure that mutators don't set such Module values in a way
|
||||||
|
// which ruins the integrity of the graph). However, keeping Module values
|
||||||
|
// changed by mutators may be a desirable outcome (such as for tooling or tests).
|
||||||
|
SkipCloneModulesAfterMutators bool
|
||||||
|
|
||||||
// String values that can be used to gate build graph traversal
|
// String values that can be used to gate build graph traversal
|
||||||
includeTags *IncludeTags
|
includeTags *IncludeTags
|
||||||
|
@ -1983,9 +1987,11 @@ func (c *Context) resolveDependencies(ctx context.Context, config interface{}) (
|
||||||
}
|
}
|
||||||
deps = append(deps, mutatorDeps...)
|
deps = append(deps, mutatorDeps...)
|
||||||
|
|
||||||
if !c.skipCloneModulesAfterMutators {
|
c.BeginEvent("clone_modules")
|
||||||
|
if !c.SkipCloneModulesAfterMutators {
|
||||||
c.cloneModules()
|
c.cloneModules()
|
||||||
}
|
}
|
||||||
|
defer c.EndEvent("clone_modules")
|
||||||
|
|
||||||
c.dependenciesReady = true
|
c.dependenciesReady = true
|
||||||
})
|
})
|
||||||
|
|
|
@ -283,7 +283,7 @@ func TestInvalidProvidersUsage(t *testing.T) {
|
||||||
ctx.RegisterTopDownMutator("parent", invalidProviderUsageParentMutator)
|
ctx.RegisterTopDownMutator("parent", invalidProviderUsageParentMutator)
|
||||||
|
|
||||||
// Don't invalidate the parent pointer and before GenerateBuildActions.
|
// Don't invalidate the parent pointer and before GenerateBuildActions.
|
||||||
ctx.skipCloneModulesAfterMutators = true
|
ctx.SkipCloneModulesAfterMutators = true
|
||||||
|
|
||||||
var parentBP, moduleUnderTestBP, childBP string
|
var parentBP, moduleUnderTestBP, childBP string
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue