From c7ec11755669f86e2efcf2ab5d10c604f4abd6e5 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Fri, 9 Feb 2024 16:26:16 -0800 Subject: [PATCH] Add tag data to soong-debug-info.json. It's not super useful because of Go's stupid restriction on not letting you reflect private fields. Test: m nothing Change-Id: I1f73f06f5e64eaf4adce58a667b98b131aede53f --- context.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/context.go b/context.go index d2adf3a..23e45e8 100644 --- a/context.go +++ b/context.go @@ -4955,16 +4955,17 @@ func funcName(f interface{}) string { // json representation of a dependency type depJson struct { - Name string `json:"name"` - Variant string `json:"variant"` - TagType string `json:"tag_type,omitempty"` + Name string `json:"name"` + Variant string `json:"variant"` + TagType string `json:"tag_type"` + TagData interface{} `json:"tag_data"` } // json representation of a provider type providerJson struct { - Type string `json:"type,omitempty"` - Debug string `json:"debug,omitempty"` // from GetDebugString on the provider data - Fields interface{} `json:"fields,omitempty"` + Type string `json:"type"` + Debug string `json:"debug"` // from GetDebugString on the provider data + Fields interface{} `json:"fields"` } // interface for getting debug info from various data. @@ -5090,6 +5091,7 @@ func getModuleDebugJson(module *moduleInfo) []byte { t := reflect.TypeOf(dep.tag) if t != nil { result[i].TagType = t.PkgPath() + "." + t.Name() + result[i].TagData = debugPropertyMap(reflect.ValueOf(dep.tag)) } } return result