diff options
author | Paul Duffin <paulduffin@google.com> | 2021-07-13 17:03:50 +0100 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2021-07-13 17:03:50 +0100 |
commit | b1b4d856e171b0c6089ea32bbca6ea4a2496565b (patch) | |
tree | 2418d9e5b15b05a676425c38e80bdf45e6a7fd7b | |
parent | 49e0e811556dc82a3457783b3bf5a690af447183 (diff) | |
download | soong-b1b4d856e171b0c6089ea32bbca6ea4a2496565b.tar.gz |
Add ClassLoaderContextMap.Dump()
Test: n/a
Change-Id: I1e1ad0093301a463d8d03b07cf58710b65e3dc6d
-rw-r--r-- | dexpreopt/class_loader_context.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dexpreopt/class_loader_context.go b/dexpreopt/class_loader_context.go index f76a205aa..b79f2d7a6 100644 --- a/dexpreopt/class_loader_context.go +++ b/dexpreopt/class_loader_context.go @@ -15,6 +15,7 @@ package dexpreopt import ( + "encoding/json" "fmt" "sort" "strconv" @@ -360,6 +361,15 @@ func (clcMap ClassLoaderContextMap) UsesLibs() (ulibs []string) { return ulibs } +func (clcMap ClassLoaderContextMap) Dump() string { + jsonCLC := toJsonClassLoaderContext(clcMap) + bytes, err := json.MarshalIndent(jsonCLC, "", " ") + if err != nil { + panic(err) + } + return string(bytes) +} + // Now that the full unconditional context is known, reconstruct conditional context. // Apply filters for individual libraries, mirroring what the PackageManager does when it // constructs class loader context on device. |