Merge "Defer dexpreopt failure with missing implementation jar" am: 9d373d8cb0

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1849413

Change-Id: Iee2b931d37923fe823905e16a144dd8c5c9de862
This commit is contained in:
Ulyana Trafimovich
2021-10-07 11:54:14 +00:00
committed by Automerger Merge Worker

View File

@@ -598,11 +598,18 @@ func toJsonClassLoaderContext(clcMap ClassLoaderContextMap) jsonClassLoaderConte
func toJsonClassLoaderContextRec(clcs []*ClassLoaderContext) []*jsonClassLoaderContext {
jClcs := make([]*jsonClassLoaderContext, len(clcs))
for i, clc := range clcs {
var host string
if clc.Host == nil {
// Defer build failure to when this CLC is actually used.
host = fmt.Sprintf("implementation-jar-for-%s-is-not-available.jar", clc.Name)
} else {
host = clc.Host.String()
}
jClcs[i] = &jsonClassLoaderContext{
Name: clc.Name,
Optional: clc.Optional,
Implicit: clc.Implicit,
Host: clc.Host.String(),
Host: host,
Device: clc.Device,
Subcontexts: toJsonClassLoaderContextRec(clc.Subcontexts),
}