Make the enabled property configurable

This allows using select statements with it.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191
Merged-In: If355d24506e3f117d27b21442a6c02bca3402dc7
This commit is contained in:
Cole Faust
2024-04-11 17:43:00 -07:00
parent 01bd5b1ddf
commit a963b94cde
53 changed files with 170 additions and 107 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 ||