Add description to json module actions am: 6f42cdc60f

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

Change-Id: Ie0aa125f3c1f6966d83ab63f8ed9c0f0e222101c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Liz Kammer 2023-06-08 23:08:37 +00:00 committed by Automerger Merge Worker
commit 0467cc50a3

View file

@ -2734,6 +2734,7 @@ type JSONDataSupplier interface {
type JSONAction struct { type JSONAction struct {
Inputs []string Inputs []string
Outputs []string Outputs []string
Desc string
} }
// JSONActionSupplier allows JSON representation of additional actions that are not registered in // JSONActionSupplier allows JSON representation of additional actions that are not registered in
@ -2778,14 +2779,18 @@ func jsonModuleWithActionsFromModuleInfo(m *moduleInfo) *JsonModule {
} }
var actions []JSONAction var actions []JSONAction
for _, bDef := range m.actionDefs.buildDefs { for _, bDef := range m.actionDefs.buildDefs {
actions = append(actions, JSONAction{ a := JSONAction{
Inputs: append( Inputs: append(
getNinjaStringsWithNilPkgNames(bDef.Inputs), getNinjaStringsWithNilPkgNames(bDef.Inputs),
getNinjaStringsWithNilPkgNames(bDef.Implicits)...), getNinjaStringsWithNilPkgNames(bDef.Implicits)...),
Outputs: append( Outputs: append(
getNinjaStringsWithNilPkgNames(bDef.Outputs), getNinjaStringsWithNilPkgNames(bDef.Outputs),
getNinjaStringsWithNilPkgNames(bDef.ImplicitOutputs)...), getNinjaStringsWithNilPkgNames(bDef.ImplicitOutputs)...),
}) }
if d, ok := bDef.Variables["description"]; ok {
a.Desc = d.Value(nil)
}
actions = append(actions, a)
} }
if j, ok := m.logicModule.(JSONActionSupplier); ok { if j, ok := m.logicModule.(JSONActionSupplier); ok {