Reland: Separate dexpreopt.GlobalSoongConfig to allow independent

caching of it.

Introduce a Once cache for GlobalSoongConfig to allow it to get binary
tool paths from ordinary module dependencies (coming in a future CL)
that are then reused in singletons.

This relands https://r.android.com/1205729.

Bug: 145934348
Test: m
Change-Id: I039d6e204bee5ddc16d8e2d85057fbec20e326fe
This commit is contained in:
Martin Stjernholm
2020-01-10 20:32:59 +00:00
parent 394b9b379a
commit 75a48d8ae2
8 changed files with 104 additions and 61 deletions

View File

@@ -39,8 +39,7 @@ func dexpreoptGlobalConfigRaw(ctx android.PathContext) globalConfigAndRaw {
if data, err := ctx.Config().DexpreoptGlobalConfig(ctx); err != nil {
panic(err)
} else if data != nil {
soongConfig := dexpreopt.CreateGlobalSoongConfig(ctx)
globalConfig, err := dexpreopt.LoadGlobalConfig(ctx, data, soongConfig)
globalConfig, err := dexpreopt.LoadGlobalConfig(ctx, data)
if err != nil {
panic(err)
}