aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-05-25 01:02:09 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-05-25 01:02:09 +0000
commit01a189ec9f63e7c91a7ef79e6931587c8ef4063e (patch)
treee1ba8c01ad13d485e97071294f90ca3be9c1c531
parentb74d385f999dd055375c6435c56cc378258efb23 (diff)
parenta90cba820b6b51ee23a404d048600b4816f8773b (diff)
downloadblueprint-android12-s5-release.tar.gz
Snap for 7394644 from a90cba820b6b51ee23a404d048600b4816f8773b to sc-releaseandroid-vts-12.0_r9android-vts-12.0_r8android-vts-12.0_r7android-vts-12.0_r6android-vts-12.0_r5android-vts-12.0_r4android-vts-12.0_r3android-vts-12.0_r2android-vts-12.0_r12android-vts-12.0_r11android-vts-12.0_r10android-vts-12.0_r1android-security-12.0.0_r59android-security-12.0.0_r58android-security-12.0.0_r57android-security-12.0.0_r56android-security-12.0.0_r55android-security-12.0.0_r54android-security-12.0.0_r53android-security-12.0.0_r52android-security-12.0.0_r51android-security-12.0.0_r50android-security-12.0.0_r49android-security-12.0.0_r48android-security-12.0.0_r47android-security-12.0.0_r46android-security-12.0.0_r45android-security-12.0.0_r44android-security-12.0.0_r43android-security-12.0.0_r42android-security-12.0.0_r41android-security-12.0.0_r40android-security-12.0.0_r39android-security-12.0.0_r38android-security-12.0.0_r37android-security-12.0.0_r36android-security-12.0.0_r35android-security-12.0.0_r34android-platform-12.0.0_r9android-platform-12.0.0_r8android-platform-12.0.0_r7android-platform-12.0.0_r6android-platform-12.0.0_r5android-platform-12.0.0_r4android-platform-12.0.0_r31android-platform-12.0.0_r30android-platform-12.0.0_r3android-platform-12.0.0_r29android-platform-12.0.0_r28android-platform-12.0.0_r27android-platform-12.0.0_r26android-platform-12.0.0_r25android-platform-12.0.0_r24android-platform-12.0.0_r23android-platform-12.0.0_r22android-platform-12.0.0_r21android-platform-12.0.0_r20android-platform-12.0.0_r2android-platform-12.0.0_r19android-platform-12.0.0_r18android-platform-12.0.0_r17android-platform-12.0.0_r16android-platform-12.0.0_r15android-platform-12.0.0_r14android-platform-12.0.0_r13android-platform-12.0.0_r12android-platform-12.0.0_r11android-platform-12.0.0_r10android-platform-12.0.0_r1android-cts-12.0_r9android-cts-12.0_r8android-cts-12.0_r7android-cts-12.0_r6android-cts-12.0_r5android-cts-12.0_r4android-cts-12.0_r3android-cts-12.0_r2android-cts-12.0_r12android-cts-12.0_r11android-cts-12.0_r10android-cts-12.0_r1android-12.0.0_r9android-12.0.0_r8android-12.0.0_r34android-12.0.0_r33android-12.0.0_r31android-12.0.0_r30android-12.0.0_r3android-12.0.0_r25android-12.0.0_r2android-12.0.0_r11android-12.0.0_r10android-12.0.0_r1android12-tests-releaseandroid12-security-releaseandroid12-s5-releaseandroid12-s4-releaseandroid12-s3-releaseandroid12-s2-releaseandroid12-s1-releaseandroid12-releaseandroid12-platform-release
Change-Id: I926126ff70dc9c58b6de80a0d3d6d894025d636d
-rw-r--r--context.go8
-rw-r--r--module_ctx.go7
2 files changed, 10 insertions, 5 deletions
diff --git a/context.go b/context.go
index f55b4b6..e891c23 100644
--- a/context.go
+++ b/context.go
@@ -747,6 +747,7 @@ func (c *Context) ParseFileList(rootDir string, filePaths []string,
type newModuleInfo struct {
*moduleInfo
+ deps []string
added chan<- struct{}
}
@@ -772,12 +773,12 @@ func (c *Context) ParseFileList(rootDir string, filePaths []string,
// registered by name. This allows load hooks to set and/or modify any aspect
// of the module (including names) using information that is not available when
// the module factory is called.
- newModules, errs := runAndRemoveLoadHooks(c, config, module, &scopedModuleFactories)
+ newModules, newDeps, errs := runAndRemoveLoadHooks(c, config, module, &scopedModuleFactories)
if len(errs) > 0 {
return errs
}
- moduleCh <- newModuleInfo{module, addedCh}
+ moduleCh <- newModuleInfo{module, newDeps, addedCh}
<-addedCh
for _, n := range newModules {
errs = addModule(n)
@@ -820,6 +821,7 @@ func (c *Context) ParseFileList(rootDir string, filePaths []string,
doneCh <- struct{}{}
}()
+ var hookDeps []string
loop:
for {
select {
@@ -827,6 +829,7 @@ loop:
errs = append(errs, newErrs...)
case module := <-moduleCh:
newErrs := c.addModule(module.moduleInfo)
+ hookDeps = append(hookDeps, module.deps...)
if module.added != nil {
module.added <- struct{}{}
}
@@ -841,6 +844,7 @@ loop:
}
}
+ deps = append(deps, hookDeps...)
return deps, errs
}
diff --git a/module_ctx.go b/module_ctx.go
index 7e8acf6..a074e37 100644
--- a/module_ctx.go
+++ b/module_ctx.go
@@ -1339,7 +1339,7 @@ func AddLoadHook(module Module, hook LoadHook) {
}
func runAndRemoveLoadHooks(ctx *Context, config interface{}, module *moduleInfo,
- scopedModuleFactories *map[string]ModuleFactory) (newModules []*moduleInfo, errs []error) {
+ scopedModuleFactories *map[string]ModuleFactory) (newModules []*moduleInfo, deps []string, errs []error) {
if v, exists := pendingHooks.Load(module.logicModule); exists {
hooks := v.(*[]LoadHook)
@@ -1355,14 +1355,15 @@ func runAndRemoveLoadHooks(ctx *Context, config interface{}, module *moduleInfo,
for _, hook := range *hooks {
hook(mctx)
newModules = append(newModules, mctx.newModules...)
+ deps = append(deps, mctx.ninjaFileDeps...)
errs = append(errs, mctx.errs...)
}
pendingHooks.Delete(module.logicModule)
- return newModules, errs
+ return newModules, deps, errs
}
- return nil, nil
+ return nil, nil, nil
}
// Check the syntax of a generated blueprint file.