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

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

Change-Id: I83c494949f7463ee81a55486bc508bad084af5ed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jeongik Cha 2023-03-28 05:23:31 +00:00 committed by Automerger Merge Worker
commit 85db9526c1

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)