Make the enabled property configurable

This allows using select statements with it.

Ignore-AOSP-First: This needs to be in a topic with changes in interal-only repositories, I'll cherrypick to aosp after.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191
This commit is contained in:
Cole Faust
2024-04-11 17:43:00 -07:00
parent e594a22bc7
commit 0e0d749062
53 changed files with 189 additions and 131 deletions

View File

@@ -849,7 +849,7 @@ func translateAndroidModule(ctx SingletonContext, w io.Writer, moduleInfoJSONs *
mod blueprint.Module, provider AndroidMkDataProvider) error {
amod := mod.(Module).base()
if shouldSkipAndroidMkProcessing(amod) {
if shouldSkipAndroidMkProcessing(ctx, amod) {
return nil
}
@@ -939,7 +939,7 @@ func WriteAndroidMkData(w io.Writer, data AndroidMkData) {
func translateAndroidMkEntriesModule(ctx SingletonContext, w io.Writer, moduleInfoJSONs *[]*ModuleInfoJSON,
mod blueprint.Module, provider AndroidMkEntriesProvider) error {
if shouldSkipAndroidMkProcessing(mod.(Module).base()) {
if shouldSkipAndroidMkProcessing(ctx, mod.(Module).base()) {
return nil
}
@@ -961,11 +961,11 @@ func translateAndroidMkEntriesModule(ctx SingletonContext, w io.Writer, moduleIn
return nil
}
func ShouldSkipAndroidMkProcessing(module Module) bool {
return shouldSkipAndroidMkProcessing(module.base())
func ShouldSkipAndroidMkProcessing(ctx ConfigAndErrorContext, module Module) bool {
return shouldSkipAndroidMkProcessing(ctx, module.base())
}
func shouldSkipAndroidMkProcessing(module *ModuleBase) bool {
func shouldSkipAndroidMkProcessing(ctx ConfigAndErrorContext, 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?
@@ -984,7 +984,7 @@ func shouldSkipAndroidMkProcessing(module *ModuleBase) bool {
return true
}
return !module.Enabled() ||
return !module.Enabled(ctx) ||
module.commonProperties.HideFromMake ||
// Make does not understand LinuxBionic
module.Os() == LinuxBionic ||