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.

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

View File

@@ -104,6 +104,7 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo
return dexJarFile
}
globalSoong := dexpreopt.GetGlobalSoongConfig(ctx)
global := dexpreoptGlobalConfig(ctx)
bootImage := defaultBootImageConfig(ctx)
if global.UseApexImage {
@@ -189,7 +190,7 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo
PresignedPrebuilt: d.isPresignedPrebuilt,
}
dexpreoptRule, err := dexpreopt.GenerateDexpreoptRule(ctx, global, dexpreoptConfig)
dexpreoptRule, err := dexpreopt.GenerateDexpreoptRule(ctx, globalSoong, global, dexpreoptConfig)
if err != nil {
ctx.ModuleErrorf("error generating dexpreopt rule: %s", err.Error())
return dexJarFile