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
diff --git a/cc/cc.go b/cc/cc.go
index 7fd4a2e..e3954d7 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -2508,7 +2508,7 @@
}
func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) {
- if !c.Enabled(actx) {
+ if !c.Enabled() {
return
}
@@ -2756,7 +2756,7 @@
}
func BeginMutator(ctx android.BottomUpMutatorContext) {
- if c, ok := ctx.Module().(*Module); ok && c.Enabled(ctx) {
+ if c, ok := ctx.Module().(*Module); ok && c.Enabled() {
c.beginMutator(ctx)
}
}
diff --git a/cc/fuzz.go b/cc/fuzz.go
index 6144046..2436f33 100644
--- a/cc/fuzz.go
+++ b/cc/fuzz.go
@@ -352,14 +352,18 @@
Sanitize struct {
Fuzzer *bool
}
- Enabled proptools.Configurable[bool]
+ Target struct {
+ Darwin struct {
+ Enabled *bool
+ }
+ Linux_bionic struct {
+ Enabled *bool
+ }
+ }
}{}
extraProps.Sanitize.Fuzzer = BoolPtr(true)
- extraProps.Enabled = android.CreateSelectOsToBool(map[string]*bool{
- "": nil,
- "darwin": proptools.BoolPtr(false),
- "linux_bionic": proptools.BoolPtr(false),
- })
+ extraProps.Target.Darwin.Enabled = BoolPtr(false)
+ extraProps.Target.Linux_bionic.Enabled = BoolPtr(false)
ctx.AppendProperties(&extraProps)
targetFramework := fuzz.GetFramework(ctx, fuzz.Cc)
@@ -429,7 +433,7 @@
return
}
// Discard non-fuzz targets.
- if ok := fuzz.IsValid(ctx, ccModule.FuzzModuleStruct()); !ok {
+ if ok := fuzz.IsValid(ccModule.FuzzModuleStruct()); !ok {
return
}
diff --git a/cc/makevars.go b/cc/makevars.go
index 51bcbf0..9251d6a 100644
--- a/cc/makevars.go
+++ b/cc/makevars.go
@@ -279,7 +279,7 @@
sanitizerLibs := android.SortedStringValues(sanitizerVariables)
var sanitizerLibStems []string
ctx.VisitAllModules(func(m android.Module) {
- if !m.Enabled(ctx) {
+ if !m.Enabled() {
return
}
diff --git a/cc/ndk_abi.go b/cc/ndk_abi.go
index 5beeab1..86166dc 100644
--- a/cc/ndk_abi.go
+++ b/cc/ndk_abi.go
@@ -40,7 +40,7 @@
func (n *ndkAbiDumpSingleton) GenerateBuildActions(ctx android.SingletonContext) {
var depPaths android.Paths
ctx.VisitAllModules(func(module android.Module) {
- if !module.Enabled(ctx) {
+ if !module.Enabled() {
return
}
@@ -78,7 +78,7 @@
func (n *ndkAbiDiffSingleton) GenerateBuildActions(ctx android.SingletonContext) {
var depPaths android.Paths
ctx.VisitAllModules(func(module android.Module) {
- if m, ok := module.(android.Module); ok && !m.Enabled(ctx) {
+ if m, ok := module.(android.Module); ok && !m.Enabled() {
return
}
diff --git a/cc/ndk_library.go b/cc/ndk_library.go
index f326068..25231fd 100644
--- a/cc/ndk_library.go
+++ b/cc/ndk_library.go
@@ -148,7 +148,7 @@
}
func (this *stubDecorator) stubsVersions(ctx android.BaseMutatorContext) []string {
- if !ctx.Module().Enabled(ctx) {
+ if !ctx.Module().Enabled() {
return nil
}
if ctx.Target().NativeBridge == android.NativeBridgeEnabled {
diff --git a/cc/ndk_sysroot.go b/cc/ndk_sysroot.go
index 3c48f68..e815172 100644
--- a/cc/ndk_sysroot.go
+++ b/cc/ndk_sysroot.go
@@ -150,7 +150,7 @@
var installPaths android.Paths
var licensePaths android.Paths
ctx.VisitAllModules(func(module android.Module) {
- if m, ok := module.(android.Module); ok && !m.Enabled(ctx) {
+ if m, ok := module.(android.Module); ok && !m.Enabled() {
return
}
diff --git a/cc/sanitize.go b/cc/sanitize.go
index ef037c3..db046ec 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -858,7 +858,7 @@
flags.Local.CFlags = append(flags.Local.CFlags, cfiCflags...)
flags.Local.AsFlags = append(flags.Local.AsFlags, cfiAsflags...)
- flags.CFlagsDeps = append(flags.CFlagsDeps, android.PathForSource(ctx, cfiBlocklistPath+"/"+cfiBlocklistFilename))
+ flags.CFlagsDeps = append(flags.CFlagsDeps, android.PathForSource(ctx, cfiBlocklistPath + "/" + cfiBlocklistFilename))
if Bool(s.Properties.Sanitize.Config.Cfi_assembly_support) {
flags.Local.CFlags = append(flags.Local.CFlags, cfiAssemblySupportFlag)
}
@@ -1371,7 +1371,7 @@
// Add the dependency to the runtime library for each of the sanitizer variants
func sanitizerRuntimeMutator(mctx android.BottomUpMutatorContext) {
if c, ok := mctx.Module().(*Module); ok && c.sanitize != nil {
- if !c.Enabled(mctx) {
+ if !c.Enabled() {
return
}
var sanitizers []string
diff --git a/cc/tidy.go b/cc/tidy.go
index ec1e8a2..76ac7d5 100644
--- a/cc/tidy.go
+++ b/cc/tidy.go
@@ -220,7 +220,7 @@
// (1) Collect all obj/tidy files into OS-specific groups.
ctx.VisitAllModuleVariants(module, func(variant android.Module) {
- if ctx.Config().KatiEnabled() && android.ShouldSkipAndroidMkProcessing(ctx, variant) {
+ if ctx.Config().KatiEnabled() && android.ShouldSkipAndroidMkProcessing(variant) {
return
}
if m, ok := variant.(*Module); ok {
diff --git a/cc/vndk.go b/cc/vndk.go
index 0463685..14b44b6 100644
--- a/cc/vndk.go
+++ b/cc/vndk.go
@@ -323,8 +323,8 @@
}
// Check for modules that mustn't be VNDK
-func shouldSkipVndkMutator(ctx android.ConfigAndErrorContext, m *Module) bool {
- if !m.Enabled(ctx) {
+func shouldSkipVndkMutator(m *Module) bool {
+ if !m.Enabled() {
return true
}
if !m.Device() {
@@ -339,7 +339,7 @@
}
func IsForVndkApex(mctx android.BottomUpMutatorContext, m *Module) bool {
- if shouldSkipVndkMutator(mctx, m) {
+ if shouldSkipVndkMutator(m) {
return false
}
@@ -370,7 +370,7 @@
return
}
- if shouldSkipVndkMutator(mctx, m) {
+ if shouldSkipVndkMutator(m) {
return
}
@@ -577,7 +577,6 @@
func (txt *vndkLibrariesTxt) OutputFiles(tag string) (android.Paths, error) {
return android.Paths{txt.outputFile}, nil
}
-
func getVndkFileName(m *Module) (string, error) {
if library, ok := m.linker.(*libraryDecorator); ok {
return library.getLibNameHelper(m.BaseModuleName(), true, false) + ".so", nil