summaryrefslogtreecommitdiff
path: root/android/module.go
diff options
context:
space:
mode:
author Priyanka Advani <padvani@google.com> 2024-05-01 20:02:36 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-05-01 20:02:41 +0000
commited5276f0827915166e89b72bf26f7e65f68d2dd5 (patch)
tree87afdde2eda7687d2b50a801a0a93c7df194848a /android/module.go
parent0e0d7490625c713bb71c254bd55129b0a30898a3 (diff)
Revert "Make the enabled property configurable"
Revert submission 27162921-configurable_enabled_property Reason for revert: Droid-monitor created revert due to Build breakage in b/338253720. Will be verifying through ABTD before submission. Reverted changes: /q/submissionid:27162921-configurable_enabled_property Change-Id: I2d144f9d297373a13a1190b173d10c966181ad84
Diffstat (limited to 'android/module.go')
-rw-r--r--android/module.go19
1 files changed, 11 insertions, 8 deletions
diff --git a/android/module.go b/android/module.go
index 5d69ba1d6..effca0346 100644
--- a/android/module.go
+++ b/android/module.go
@@ -60,7 +60,7 @@ type Module interface {
base() *ModuleBase
Disable()
- Enabled(ctx ConfigAndErrorContext) bool
+ Enabled() bool
Target() Target
MultiTargets() []Target
@@ -287,7 +287,7 @@ type commonProperties struct {
// but are not usually required (e.g. superceded by a prebuilt) should not be
// disabled as that will prevent them from being built by the checkbuild target
// and so prevent early detection of changes that have broken those modules.
- Enabled proptools.Configurable[bool] `android:"arch_variant,replace_instead_of_append"`
+ Enabled *bool `android:"arch_variant"`
// Controls the visibility of this module to other modules. Allowable values are one or more of
// these formats:
@@ -1392,11 +1392,14 @@ func (m *ModuleBase) PartitionTag(config DeviceConfig) string {
return partition
}
-func (m *ModuleBase) Enabled(ctx ConfigAndErrorContext) bool {
+func (m *ModuleBase) Enabled() bool {
if m.commonProperties.ForcedDisabled {
return false
}
- return m.commonProperties.Enabled.GetOrDefault(m.ConfigurableEvaluator(ctx), !m.Os().DefaultDisabled)
+ if m.commonProperties.Enabled == nil {
+ return !m.Os().DefaultDisabled
+ }
+ return *m.commonProperties.Enabled
}
func (m *ModuleBase) Disable() {
@@ -1640,7 +1643,7 @@ func (m *ModuleBase) generateModuleTarget(ctx ModuleContext) {
// not be created if the module is not exported to make.
// Those could depend on the build target and fail to compile
// for the current build target.
- if !ctx.Config().KatiEnabled() || !shouldSkipAndroidMkProcessing(ctx, a) {
+ if !ctx.Config().KatiEnabled() || !shouldSkipAndroidMkProcessing(a) {
allCheckbuildFiles = append(allCheckbuildFiles, a.checkbuildFiles...)
}
})
@@ -1832,7 +1835,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
checkDistProperties(ctx, fmt.Sprintf("dists[%d]", i), &m.distProperties.Dists[i])
}
- if m.Enabled(ctx) {
+ if m.Enabled() {
// ensure all direct android.Module deps are enabled
ctx.VisitDirectDepsBlueprint(func(bm blueprint.Module) {
if m, ok := bm.(Module); ok {
@@ -2133,7 +2136,7 @@ func (m *ModuleBase) ConfigurableEvaluator(ctx ConfigAndErrorContext) proptools.
}
func (e configurationEvalutor) PropertyErrorf(property string, fmt string, args ...interface{}) {
- e.ctx.OtherModulePropertyErrorf(e.m, property, fmt, args...)
+ e.ctx.OtherModulePropertyErrorf(e.m, property, fmt, args)
}
func (e configurationEvalutor) EvaluateConfiguration(condition proptools.ConfigurableCondition, property string) proptools.ConfigurableValue {
@@ -2532,7 +2535,7 @@ func (c *buildTargetSingleton) GenerateBuildActions(ctx SingletonContext) {
}
osDeps := map[osAndCross]Paths{}
ctx.VisitAllModules(func(module Module) {
- if module.Enabled(ctx) {
+ if module.Enabled() {
key := osAndCross{os: module.Target().Os, hostCross: module.Target().HostCross}
osDeps[key] = append(osDeps[key], module.base().checkbuildFiles...)
}