Rename ConfigAndErrorContext to ConfigurableEvaluatorContext

I'm going to be adding some methods to this interface, give it
a name based on how it's going to be used, not based on what methods
it contains.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I9bba04ba756c4dbe00625e2d04af81e78a11cae9
This commit is contained in:
Cole Faust
2024-09-11 11:35:46 -07:00
parent 28b806c9eb
commit e8a8783154
11 changed files with 23 additions and 23 deletions

View File

@@ -983,11 +983,11 @@ func translateAndroidMkEntriesModule(ctx SingletonContext, w io.Writer, moduleIn
return nil return nil
} }
func ShouldSkipAndroidMkProcessing(ctx ConfigAndErrorContext, module Module) bool { func ShouldSkipAndroidMkProcessing(ctx ConfigurableEvaluatorContext, module Module) bool {
return shouldSkipAndroidMkProcessing(ctx, module.base()) return shouldSkipAndroidMkProcessing(ctx, module.base())
} }
func shouldSkipAndroidMkProcessing(ctx ConfigAndErrorContext, module *ModuleBase) bool { func shouldSkipAndroidMkProcessing(ctx ConfigurableEvaluatorContext, module *ModuleBase) bool {
if !module.commonProperties.NamespaceExportedToMake { if !module.commonProperties.NamespaceExportedToMake {
// TODO(jeffrygaston) do we want to validate that there are no modules being // TODO(jeffrygaston) do we want to validate that there are no modules being
// exported to Kati that depend on this module? // exported to Kati that depend on this module?

View File

@@ -58,7 +58,7 @@ type Module interface {
base() *ModuleBase base() *ModuleBase
Disable() Disable()
Enabled(ctx ConfigAndErrorContext) bool Enabled(ctx ConfigurableEvaluatorContext) bool
Target() Target Target() Target
MultiTargets() []Target MultiTargets() []Target
@@ -109,12 +109,12 @@ type Module interface {
// Get information about the properties that can contain visibility rules. // Get information about the properties that can contain visibility rules.
visibilityProperties() []visibilityProperty visibilityProperties() []visibilityProperty
RequiredModuleNames(ctx ConfigAndErrorContext) []string RequiredModuleNames(ctx ConfigurableEvaluatorContext) []string
HostRequiredModuleNames() []string HostRequiredModuleNames() []string
TargetRequiredModuleNames() []string TargetRequiredModuleNames() []string
VintfFragmentModuleNames(ctx ConfigAndErrorContext) []string VintfFragmentModuleNames(ctx ConfigurableEvaluatorContext) []string
ConfigurableEvaluator(ctx ConfigAndErrorContext) proptools.ConfigurableEvaluator ConfigurableEvaluator(ctx ConfigurableEvaluatorContext) proptools.ConfigurableEvaluator
} }
// Qualified id for a module // Qualified id for a module
@@ -1339,7 +1339,7 @@ func (m *ModuleBase) PartitionTag(config DeviceConfig) string {
return partition return partition
} }
func (m *ModuleBase) Enabled(ctx ConfigAndErrorContext) bool { func (m *ModuleBase) Enabled(ctx ConfigurableEvaluatorContext) bool {
if m.commonProperties.ForcedDisabled { if m.commonProperties.ForcedDisabled {
return false return false
} }
@@ -1536,7 +1536,7 @@ func (m *ModuleBase) InRecovery() bool {
return m.base().commonProperties.ImageVariation == RecoveryVariation return m.base().commonProperties.ImageVariation == RecoveryVariation
} }
func (m *ModuleBase) RequiredModuleNames(ctx ConfigAndErrorContext) []string { func (m *ModuleBase) RequiredModuleNames(ctx ConfigurableEvaluatorContext) []string {
return m.base().commonProperties.Required.GetOrDefault(m.ConfigurableEvaluator(ctx), nil) return m.base().commonProperties.Required.GetOrDefault(m.ConfigurableEvaluator(ctx), nil)
} }
@@ -1548,7 +1548,7 @@ func (m *ModuleBase) TargetRequiredModuleNames() []string {
return m.base().commonProperties.Target_required return m.base().commonProperties.Target_required
} }
func (m *ModuleBase) VintfFragmentModuleNames(ctx ConfigAndErrorContext) []string { func (m *ModuleBase) VintfFragmentModuleNames(ctx ConfigurableEvaluatorContext) []string {
return m.base().commonProperties.Vintf_fragment_modules.GetOrDefault(m.ConfigurableEvaluator(ctx), nil) return m.base().commonProperties.Vintf_fragment_modules.GetOrDefault(m.ConfigurableEvaluator(ctx), nil)
} }
@@ -2204,17 +2204,17 @@ func (m *ModuleBase) IsNativeBridgeSupported() bool {
return proptools.Bool(m.commonProperties.Native_bridge_supported) return proptools.Bool(m.commonProperties.Native_bridge_supported)
} }
type ConfigAndErrorContext interface { type ConfigurableEvaluatorContext interface {
Config() Config Config() Config
OtherModulePropertyErrorf(module Module, property string, fmt string, args ...interface{}) OtherModulePropertyErrorf(module Module, property string, fmt string, args ...interface{})
} }
type configurationEvalutor struct { type configurationEvalutor struct {
ctx ConfigAndErrorContext ctx ConfigurableEvaluatorContext
m Module m Module
} }
func (m *ModuleBase) ConfigurableEvaluator(ctx ConfigAndErrorContext) proptools.ConfigurableEvaluator { func (m *ModuleBase) ConfigurableEvaluator(ctx ConfigurableEvaluatorContext) proptools.ConfigurableEvaluator {
return configurationEvalutor{ return configurationEvalutor{
ctx: ctx, ctx: ctx,
m: m.module, m: m.module,

View File

@@ -194,7 +194,7 @@ type ModuleContext interface {
InstallInVendor() bool InstallInVendor() bool
InstallForceOS() (*OsType, *ArchType) InstallForceOS() (*OsType, *ArchType)
RequiredModuleNames(ctx ConfigAndErrorContext) []string RequiredModuleNames(ctx ConfigurableEvaluatorContext) []string
HostRequiredModuleNames() []string HostRequiredModuleNames() []string
TargetRequiredModuleNames() []string TargetRequiredModuleNames() []string
@@ -855,7 +855,7 @@ func (m *moduleContext) ExpandOptionalSource(srcFile *string, _ string) Optional
return OptionalPath{} return OptionalPath{}
} }
func (m *moduleContext) RequiredModuleNames(ctx ConfigAndErrorContext) []string { func (m *moduleContext) RequiredModuleNames(ctx ConfigurableEvaluatorContext) []string {
return m.module.RequiredModuleNames(ctx) return m.module.RequiredModuleNames(ctx)
} }

View File

@@ -813,7 +813,7 @@ type SdkMemberProperties interface {
// SdkMemberContext provides access to information common to a specific member. // SdkMemberContext provides access to information common to a specific member.
type SdkMemberContext interface { type SdkMemberContext interface {
ConfigAndErrorContext ConfigurableEvaluatorContext
// SdkModuleContext returns the module context of the sdk common os variant which is creating the // SdkModuleContext returns the module context of the sdk common os variant which is creating the
// snapshot. // snapshot.

View File

@@ -1326,7 +1326,7 @@ func (ctx *panickingConfigAndErrorContext) Config() Config {
return ctx.ctx.Config() return ctx.ctx.Config()
} }
func PanickingConfigAndErrorContext(ctx *TestContext) ConfigAndErrorContext { func PanickingConfigAndErrorContext(ctx *TestContext) ConfigurableEvaluatorContext {
return &panickingConfigAndErrorContext{ return &panickingConfigAndErrorContext{
ctx: ctx, ctx: ctx,
} }

View File

@@ -613,7 +613,7 @@ type linker interface {
coverageOutputFilePath() android.OptionalPath coverageOutputFilePath() android.OptionalPath
// Get the deps that have been explicitly specified in the properties. // Get the deps that have been explicitly specified in the properties.
linkerSpecifiedDeps(ctx android.ConfigAndErrorContext, module *Module, specifiedDeps specifiedDeps) specifiedDeps linkerSpecifiedDeps(ctx android.ConfigurableEvaluatorContext, module *Module, specifiedDeps specifiedDeps) specifiedDeps
moduleInfoJSON(ctx ModuleContext, moduleInfoJSON *android.ModuleInfoJSON) moduleInfoJSON(ctx ModuleContext, moduleInfoJSON *android.ModuleInfoJSON)
} }
@@ -970,7 +970,7 @@ func (c *Module) HiddenFromMake() bool {
return c.Properties.HideFromMake return c.Properties.HideFromMake
} }
func (c *Module) RequiredModuleNames(ctx android.ConfigAndErrorContext) []string { func (c *Module) RequiredModuleNames(ctx android.ConfigurableEvaluatorContext) []string {
required := android.CopyOf(c.ModuleBase.RequiredModuleNames(ctx)) required := android.CopyOf(c.ModuleBase.RequiredModuleNames(ctx))
if c.ImageVariation().Variation == android.CoreVariation { if c.ImageVariation().Variation == android.CoreVariation {
required = append(required, c.Properties.Target.Platform.Required...) required = append(required, c.Properties.Target.Platform.Required...)

View File

@@ -919,7 +919,7 @@ func (library *libraryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
return deps return deps
} }
func (library *libraryDecorator) linkerSpecifiedDeps(ctx android.ConfigAndErrorContext, module *Module, specifiedDeps specifiedDeps) specifiedDeps { func (library *libraryDecorator) linkerSpecifiedDeps(ctx android.ConfigurableEvaluatorContext, module *Module, specifiedDeps specifiedDeps) specifiedDeps {
specifiedDeps = library.baseLinker.linkerSpecifiedDeps(ctx, module, specifiedDeps) specifiedDeps = library.baseLinker.linkerSpecifiedDeps(ctx, module, specifiedDeps)
var properties StaticOrSharedProperties var properties StaticOrSharedProperties
if library.static() { if library.static() {

View File

@@ -645,7 +645,7 @@ func (linker *baseLinker) link(ctx ModuleContext,
panic(fmt.Errorf("baseLinker doesn't know how to link")) panic(fmt.Errorf("baseLinker doesn't know how to link"))
} }
func (linker *baseLinker) linkerSpecifiedDeps(ctx android.ConfigAndErrorContext, module *Module, specifiedDeps specifiedDeps) specifiedDeps { func (linker *baseLinker) linkerSpecifiedDeps(ctx android.ConfigurableEvaluatorContext, module *Module, specifiedDeps specifiedDeps) specifiedDeps {
eval := module.ConfigurableEvaluator(ctx) eval := module.ConfigurableEvaluator(ctx)
specifiedDeps.sharedLibs = append(specifiedDeps.sharedLibs, linker.Properties.Shared_libs.GetOrDefault(eval, nil)...) specifiedDeps.sharedLibs = append(specifiedDeps.sharedLibs, linker.Properties.Shared_libs.GetOrDefault(eval, nil)...)

View File

@@ -203,7 +203,7 @@ func (object *objectLinker) link(ctx ModuleContext,
return outputFile return outputFile
} }
func (object *objectLinker) linkerSpecifiedDeps(ctx android.ConfigAndErrorContext, module *Module, specifiedDeps specifiedDeps) specifiedDeps { func (object *objectLinker) linkerSpecifiedDeps(ctx android.ConfigurableEvaluatorContext, module *Module, specifiedDeps specifiedDeps) specifiedDeps {
eval := module.ConfigurableEvaluator(ctx) eval := module.ConfigurableEvaluator(ctx)
specifiedDeps.sharedLibs = append(specifiedDeps.sharedLibs, object.Properties.Shared_libs.GetOrDefault(eval, nil)...) specifiedDeps.sharedLibs = append(specifiedDeps.sharedLibs, object.Properties.Shared_libs.GetOrDefault(eval, nil)...)

View File

@@ -449,7 +449,7 @@ func IsValidFrameworkForModule(targetFramework Framework, lang Lang, moduleFrame
} }
} }
func IsValid(ctx android.ConfigAndErrorContext, fuzzModule FuzzModule) bool { func IsValid(ctx android.ConfigurableEvaluatorContext, fuzzModule FuzzModule) bool {
// Discard ramdisk + vendor_ramdisk + recovery modules, they're duplicates of // Discard ramdisk + vendor_ramdisk + recovery modules, they're duplicates of
// fuzz targets we're going to package anyway. // fuzz targets we're going to package anyway.
if !fuzzModule.Enabled(ctx) || fuzzModule.InRamdisk() || fuzzModule.InVendorRamdisk() || fuzzModule.InRecovery() { if !fuzzModule.Enabled(ctx) || fuzzModule.InRamdisk() || fuzzModule.InVendorRamdisk() || fuzzModule.InRecovery() {

View File

@@ -21,7 +21,7 @@ import (
// isActiveModule returns true if the given module should be considered for boot // isActiveModule returns true if the given module should be considered for boot
// jars, i.e. if it's enabled and the preferred one in case of source and // jars, i.e. if it's enabled and the preferred one in case of source and
// prebuilt alternatives. // prebuilt alternatives.
func isActiveModule(ctx android.ConfigAndErrorContext, module android.Module) bool { func isActiveModule(ctx android.ConfigurableEvaluatorContext, module android.Module) bool {
if !module.Enabled(ctx) { if !module.Enabled(ctx) {
return false return false
} }