Merge "Check consistency of the BootJars/UpdatableBootJars config"
This commit is contained in:
@@ -17,6 +17,7 @@ package dexpreopt
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/google/blueprint"
|
"github.com/google/blueprint"
|
||||||
@@ -522,7 +523,27 @@ func ParseGlobalSoongConfig(ctx android.PathContext, data []byte) (*GlobalSoongC
|
|||||||
return config, nil
|
return config, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// checkBootJarsConfigConsistency checks the consistency of BootJars and UpdatableBootJars fields in
|
||||||
|
// DexpreoptGlobalConfig and Config.productVariables.
|
||||||
|
func checkBootJarsConfigConsistency(ctx android.SingletonContext, dexpreoptConfig *GlobalConfig, config android.Config) {
|
||||||
|
compareBootJars := func(property string, dexpreoptJars, variableJars android.ConfiguredJarList) {
|
||||||
|
dexpreoptPairs := dexpreoptJars.CopyOfApexJarPairs()
|
||||||
|
variablePairs := variableJars.CopyOfApexJarPairs()
|
||||||
|
if !reflect.DeepEqual(dexpreoptPairs, variablePairs) {
|
||||||
|
ctx.Errorf("Inconsistent configuration of %[1]s\n"+
|
||||||
|
" dexpreopt.GlobalConfig.%[1]s = %[2]s\n"+
|
||||||
|
" productVariables.%[1]s = %[3]s",
|
||||||
|
property, dexpreoptPairs, variablePairs)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compareBootJars("BootJars", dexpreoptConfig.BootJars, config.NonUpdatableBootJars())
|
||||||
|
compareBootJars("UpdatableBootJars", dexpreoptConfig.UpdatableBootJars, config.UpdatableBootJars())
|
||||||
|
}
|
||||||
|
|
||||||
func (s *globalSoongConfigSingleton) GenerateBuildActions(ctx android.SingletonContext) {
|
func (s *globalSoongConfigSingleton) GenerateBuildActions(ctx android.SingletonContext) {
|
||||||
|
checkBootJarsConfigConsistency(ctx, GetGlobalConfig(ctx), ctx.Config())
|
||||||
|
|
||||||
if GetGlobalConfig(ctx).DisablePreopt {
|
if GetGlobalConfig(ctx).DisablePreopt {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user