Add GetOutputsFromModuleNames in Context am: 4589dfd812 am: 5f0243476d

Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2501987

Change-Id: Ifb76a04c9cd213d0de233f0dfa8a7a48997eed46
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jeongik Cha 2023-03-28 04:55:17 +00:00 committed by Automerger Merge Worker
commit 3098a7708d

View file

@ -2705,6 +2705,30 @@ func getNinjaStringsWithNilPkgNames(nStrs []ninjaString) []string {
return strs
}
func (c *Context) GetOutputsFromModuleNames(moduleNames []string) map[string][]string {
modulesToOutputs := make(map[string][]string)
for _, m := range c.modulesSorted {
if inList(m.Name(), moduleNames) {
jmWithActions := jsonModuleWithActionsFromModuleInfo(m)
for _, a := range jmWithActions.Module["Actions"].([]JSONAction) {
modulesToOutputs[m.Name()] = append(modulesToOutputs[m.Name()], a.Outputs...)
}
// There could be several modules with the same name, so keep looping
}
}
return modulesToOutputs
}
func inList(s string, l []string) bool {
for _, element := range l {
if s == element {
return true
}
}
return false
}
// PrintJSONGraph prints info of modules in a JSON file.
func (c *Context) PrintJSONGraphAndActions(wGraph io.Writer, wActions io.Writer) {
modulesToGraph := make([]*JsonModule, 0)