Merge "Support pre-build-action hook in blueprint" am: df4ad24151
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2094704 Change-Id: Iea76743f2ae4fa3e5691092722f956df49d201cd Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
94222dc0f7
2 changed files with 13 additions and 0 deletions
|
@ -113,6 +113,13 @@ func RunBlueprint(args Args, stopBefore StopBefore, ctx *blueprint.Context, conf
|
||||||
return ninjaDeps
|
return ninjaDeps
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ctx.BeforePrepareBuildActionsHook != nil {
|
||||||
|
err := ctx.BeforePrepareBuildActionsHook()
|
||||||
|
if err != nil {
|
||||||
|
fatalErrors([]error{err})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extraDeps, errs = ctx.PrepareBuildActions(config)
|
extraDeps, errs = ctx.PrepareBuildActions(config)
|
||||||
if len(errs) > 0 {
|
if len(errs) > 0 {
|
||||||
fatalErrors(errs)
|
fatalErrors(errs)
|
||||||
|
|
|
@ -75,6 +75,8 @@ type Context struct {
|
||||||
// Used for metrics-related event logging.
|
// Used for metrics-related event logging.
|
||||||
EventHandler *metrics.EventHandler
|
EventHandler *metrics.EventHandler
|
||||||
|
|
||||||
|
BeforePrepareBuildActionsHook func() error
|
||||||
|
|
||||||
moduleFactories map[string]ModuleFactory
|
moduleFactories map[string]ModuleFactory
|
||||||
nameInterface NameInterface
|
nameInterface NameInterface
|
||||||
moduleGroups []*moduleGroup
|
moduleGroups []*moduleGroup
|
||||||
|
@ -4095,6 +4097,10 @@ func (c *Context) EndEvent(name string) {
|
||||||
c.EventHandler.End(name)
|
c.EventHandler.End(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Context) SetBeforePrepareBuildActionsHook(hookFn func() error) {
|
||||||
|
c.BeforePrepareBuildActionsHook = hookFn
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Context) writeLocalBuildActions(nw *ninjaWriter,
|
func (c *Context) writeLocalBuildActions(nw *ninjaWriter,
|
||||||
defs *localBuildActions) error {
|
defs *localBuildActions) error {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue