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:
@@ -983,11 +983,11 @@ func translateAndroidMkEntriesModule(ctx SingletonContext, w io.Writer, moduleIn
|
||||
return nil
|
||||
}
|
||||
|
||||
func ShouldSkipAndroidMkProcessing(ctx ConfigAndErrorContext, module Module) bool {
|
||||
func ShouldSkipAndroidMkProcessing(ctx ConfigurableEvaluatorContext, module Module) bool {
|
||||
return shouldSkipAndroidMkProcessing(ctx, module.base())
|
||||
}
|
||||
|
||||
func shouldSkipAndroidMkProcessing(ctx ConfigAndErrorContext, module *ModuleBase) bool {
|
||||
func shouldSkipAndroidMkProcessing(ctx ConfigurableEvaluatorContext, module *ModuleBase) bool {
|
||||
if !module.commonProperties.NamespaceExportedToMake {
|
||||
// TODO(jeffrygaston) do we want to validate that there are no modules being
|
||||
// exported to Kati that depend on this module?
|
||||
|
@@ -58,7 +58,7 @@ type Module interface {
|
||||
|
||||
base() *ModuleBase
|
||||
Disable()
|
||||
Enabled(ctx ConfigAndErrorContext) bool
|
||||
Enabled(ctx ConfigurableEvaluatorContext) bool
|
||||
Target() Target
|
||||
MultiTargets() []Target
|
||||
|
||||
@@ -109,12 +109,12 @@ type Module interface {
|
||||
// Get information about the properties that can contain visibility rules.
|
||||
visibilityProperties() []visibilityProperty
|
||||
|
||||
RequiredModuleNames(ctx ConfigAndErrorContext) []string
|
||||
RequiredModuleNames(ctx ConfigurableEvaluatorContext) []string
|
||||
HostRequiredModuleNames() []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
|
||||
@@ -1339,7 +1339,7 @@ func (m *ModuleBase) PartitionTag(config DeviceConfig) string {
|
||||
return partition
|
||||
}
|
||||
|
||||
func (m *ModuleBase) Enabled(ctx ConfigAndErrorContext) bool {
|
||||
func (m *ModuleBase) Enabled(ctx ConfigurableEvaluatorContext) bool {
|
||||
if m.commonProperties.ForcedDisabled {
|
||||
return false
|
||||
}
|
||||
@@ -1536,7 +1536,7 @@ func (m *ModuleBase) InRecovery() bool {
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -1548,7 +1548,7 @@ func (m *ModuleBase) TargetRequiredModuleNames() []string {
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -2204,17 +2204,17 @@ func (m *ModuleBase) IsNativeBridgeSupported() bool {
|
||||
return proptools.Bool(m.commonProperties.Native_bridge_supported)
|
||||
}
|
||||
|
||||
type ConfigAndErrorContext interface {
|
||||
type ConfigurableEvaluatorContext interface {
|
||||
Config() Config
|
||||
OtherModulePropertyErrorf(module Module, property string, fmt string, args ...interface{})
|
||||
}
|
||||
|
||||
type configurationEvalutor struct {
|
||||
ctx ConfigAndErrorContext
|
||||
ctx ConfigurableEvaluatorContext
|
||||
m Module
|
||||
}
|
||||
|
||||
func (m *ModuleBase) ConfigurableEvaluator(ctx ConfigAndErrorContext) proptools.ConfigurableEvaluator {
|
||||
func (m *ModuleBase) ConfigurableEvaluator(ctx ConfigurableEvaluatorContext) proptools.ConfigurableEvaluator {
|
||||
return configurationEvalutor{
|
||||
ctx: ctx,
|
||||
m: m.module,
|
||||
|
@@ -194,7 +194,7 @@ type ModuleContext interface {
|
||||
InstallInVendor() bool
|
||||
InstallForceOS() (*OsType, *ArchType)
|
||||
|
||||
RequiredModuleNames(ctx ConfigAndErrorContext) []string
|
||||
RequiredModuleNames(ctx ConfigurableEvaluatorContext) []string
|
||||
HostRequiredModuleNames() []string
|
||||
TargetRequiredModuleNames() []string
|
||||
|
||||
@@ -855,7 +855,7 @@ func (m *moduleContext) ExpandOptionalSource(srcFile *string, _ string) Optional
|
||||
return OptionalPath{}
|
||||
}
|
||||
|
||||
func (m *moduleContext) RequiredModuleNames(ctx ConfigAndErrorContext) []string {
|
||||
func (m *moduleContext) RequiredModuleNames(ctx ConfigurableEvaluatorContext) []string {
|
||||
return m.module.RequiredModuleNames(ctx)
|
||||
}
|
||||
|
||||
|
@@ -813,7 +813,7 @@ type SdkMemberProperties interface {
|
||||
|
||||
// SdkMemberContext provides access to information common to a specific member.
|
||||
type SdkMemberContext interface {
|
||||
ConfigAndErrorContext
|
||||
ConfigurableEvaluatorContext
|
||||
|
||||
// SdkModuleContext returns the module context of the sdk common os variant which is creating the
|
||||
// snapshot.
|
||||
|
@@ -1326,7 +1326,7 @@ func (ctx *panickingConfigAndErrorContext) Config() Config {
|
||||
return ctx.ctx.Config()
|
||||
}
|
||||
|
||||
func PanickingConfigAndErrorContext(ctx *TestContext) ConfigAndErrorContext {
|
||||
func PanickingConfigAndErrorContext(ctx *TestContext) ConfigurableEvaluatorContext {
|
||||
return &panickingConfigAndErrorContext{
|
||||
ctx: ctx,
|
||||
}
|
||||
|
4
cc/cc.go
4
cc/cc.go
@@ -613,7 +613,7 @@ type linker interface {
|
||||
coverageOutputFilePath() android.OptionalPath
|
||||
|
||||
// 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)
|
||||
}
|
||||
@@ -970,7 +970,7 @@ func (c *Module) HiddenFromMake() bool {
|
||||
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))
|
||||
if c.ImageVariation().Variation == android.CoreVariation {
|
||||
required = append(required, c.Properties.Target.Platform.Required...)
|
||||
|
@@ -919,7 +919,7 @@ func (library *libraryDecorator) linkerDeps(ctx DepsContext, deps Deps) 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)
|
||||
var properties StaticOrSharedProperties
|
||||
if library.static() {
|
||||
|
@@ -645,7 +645,7 @@ func (linker *baseLinker) link(ctx ModuleContext,
|
||||
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)
|
||||
specifiedDeps.sharedLibs = append(specifiedDeps.sharedLibs, linker.Properties.Shared_libs.GetOrDefault(eval, nil)...)
|
||||
|
||||
|
@@ -203,7 +203,7 @@ func (object *objectLinker) link(ctx ModuleContext,
|
||||
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)
|
||||
specifiedDeps.sharedLibs = append(specifiedDeps.sharedLibs, object.Properties.Shared_libs.GetOrDefault(eval, nil)...)
|
||||
|
||||
|
@@ -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
|
||||
// fuzz targets we're going to package anyway.
|
||||
if !fuzzModule.Enabled(ctx) || fuzzModule.InRamdisk() || fuzzModule.InVendorRamdisk() || fuzzModule.InRecovery() {
|
||||
|
@@ -21,7 +21,7 @@ import (
|
||||
// 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
|
||||
// prebuilt alternatives.
|
||||
func isActiveModule(ctx android.ConfigAndErrorContext, module android.Module) bool {
|
||||
func isActiveModule(ctx android.ConfigurableEvaluatorContext, module android.Module) bool {
|
||||
if !module.Enabled(ctx) {
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user