Merge "Revert "Make the enabled property configurable"" into aosp-main-future am: c4466a6387
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/27180893 Change-Id: I1d88f9b7033829eeabaaf11deca41c8b41acf0ba Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -509,7 +509,7 @@ func TestAndroidAppImport_ArchVariants(t *testing.T) {
|
||||
|
||||
variant := ctx.ModuleForTests("foo", "android_common")
|
||||
if test.expected == "" {
|
||||
if variant.Module().Enabled(android.PanickingConfigAndErrorContext(ctx)) {
|
||||
if variant.Module().Enabled() {
|
||||
t.Error("module should have been disabled, but wasn't")
|
||||
}
|
||||
rule := variant.MaybeRule("genProvenanceMetaData")
|
||||
@@ -586,7 +586,7 @@ func TestAndroidAppImport_SoongConfigVariables(t *testing.T) {
|
||||
|
||||
variant := ctx.ModuleForTests("foo", "android_common")
|
||||
if test.expected == "" {
|
||||
if variant.Module().Enabled(android.PanickingConfigAndErrorContext(ctx)) {
|
||||
if variant.Module().Enabled() {
|
||||
t.Error("module should have been disabled, but wasn't")
|
||||
}
|
||||
rule := variant.MaybeRule("genProvenanceMetaData")
|
||||
@@ -629,7 +629,7 @@ func TestAndroidAppImport_overridesDisabledAndroidApp(t *testing.T) {
|
||||
if !a.prebuilt.UsePrebuilt() {
|
||||
t.Errorf("prebuilt foo module is not active")
|
||||
}
|
||||
if !a.Enabled(android.PanickingConfigAndErrorContext(ctx)) {
|
||||
if !a.Enabled() {
|
||||
t.Errorf("prebuilt foo module is disabled")
|
||||
}
|
||||
}
|
||||
|
@@ -21,8 +21,8 @@ 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 {
|
||||
if !module.Enabled(ctx) {
|
||||
func isActiveModule(module android.Module) bool {
|
||||
if !module.Enabled() {
|
||||
return false
|
||||
}
|
||||
return android.IsModulePreferred(module)
|
||||
|
@@ -127,10 +127,7 @@ func reportMissingVariationDependency(ctx android.BottomUpMutatorContext, variat
|
||||
// added by addDependencyOntoApexModulePair.
|
||||
func gatherApexModulePairDepsWithTag(ctx android.BaseModuleContext, tag blueprint.DependencyTag) []android.Module {
|
||||
var modules []android.Module
|
||||
isActiveModulePred := func(module android.Module) bool {
|
||||
return isActiveModule(ctx, module)
|
||||
}
|
||||
ctx.VisitDirectDepsIf(isActiveModulePred, func(module android.Module) {
|
||||
ctx.VisitDirectDepsIf(isActiveModule, func(module android.Module) {
|
||||
t := ctx.OtherModuleDependencyTag(module)
|
||||
if t == tag {
|
||||
modules = append(modules, module)
|
||||
|
@@ -474,7 +474,7 @@ func (b *BootclasspathFragmentModule) GenerateAndroidBuildActions(ctx android.Mo
|
||||
// Only perform a consistency check if this module is the active module. That will prevent an
|
||||
// unused prebuilt that was created without instrumentation from breaking an instrumentation
|
||||
// build.
|
||||
if isActiveModule(ctx, ctx.Module()) {
|
||||
if isActiveModule(ctx.Module()) {
|
||||
b.bootclasspathFragmentPropertyCheck(ctx)
|
||||
}
|
||||
|
||||
@@ -519,7 +519,7 @@ func (b *BootclasspathFragmentModule) GenerateAndroidBuildActions(ctx android.Mo
|
||||
// empty string if this module should not provide a boot image profile.
|
||||
func (b *BootclasspathFragmentModule) getProfileProviderApex(ctx android.BaseModuleContext) string {
|
||||
// Only use the profile from the module that is preferred.
|
||||
if !isActiveModule(ctx, ctx.Module()) {
|
||||
if !isActiveModule(ctx.Module()) {
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -590,7 +590,7 @@ func (b *BootclasspathFragmentModule) configuredJars(ctx android.ModuleContext)
|
||||
// So ignore it even if it is not in PRODUCT_APEX_BOOT_JARS.
|
||||
// TODO(b/202896428): Add better way to handle this.
|
||||
_, unknown = android.RemoveFromList("android.car-module", unknown)
|
||||
if isActiveModule(ctx, ctx.Module()) && len(unknown) > 0 {
|
||||
if isActiveModule(ctx.Module()) && len(unknown) > 0 {
|
||||
ctx.ModuleErrorf("%s in contents must also be declared in PRODUCT_APEX_BOOT_JARS", unknown)
|
||||
}
|
||||
}
|
||||
|
@@ -562,7 +562,7 @@ func gatherBootclasspathFragments(ctx android.ModuleContext) map[string]android.
|
||||
return ctx.Config().Once(dexBootJarsFragmentsKey, func() interface{} {
|
||||
fragments := make(map[string]android.Module)
|
||||
ctx.WalkDeps(func(child, parent android.Module) bool {
|
||||
if !isActiveModule(ctx, child) {
|
||||
if !isActiveModule(child) {
|
||||
return false
|
||||
}
|
||||
tag := ctx.OtherModuleDependencyTag(child)
|
||||
@@ -1125,7 +1125,7 @@ func buildBootImageVariant(ctx android.ModuleContext, image *bootImageVariant, p
|
||||
image.unstrippedInstalls = unstrippedInstalls
|
||||
|
||||
// Only set the licenseMetadataFile from the active module.
|
||||
if isActiveModule(ctx, ctx.Module()) {
|
||||
if isActiveModule(ctx.Module()) {
|
||||
image.licenseMetadataFile = android.OptionalPathForPath(ctx.LicenseMetadataFile())
|
||||
}
|
||||
|
||||
|
16
java/fuzz.go
16
java/fuzz.go
@@ -69,13 +69,13 @@ func JavaFuzzFactory() android.Module {
|
||||
|
||||
android.AddLoadHook(module, func(ctx android.LoadHookContext) {
|
||||
disableLinuxBionic := struct {
|
||||
Enabled proptools.Configurable[bool]
|
||||
}{
|
||||
Enabled: android.CreateSelectOsToBool(map[string]*bool{
|
||||
"": nil,
|
||||
"linux_bionic": proptools.BoolPtr(false),
|
||||
}),
|
||||
}
|
||||
Target struct {
|
||||
Linux_bionic struct {
|
||||
Enabled *bool
|
||||
}
|
||||
}
|
||||
}{}
|
||||
disableLinuxBionic.Target.Linux_bionic.Enabled = proptools.BoolPtr(false)
|
||||
ctx.AppendProperties(&disableLinuxBionic)
|
||||
})
|
||||
|
||||
@@ -179,7 +179,7 @@ func (s *javaFuzzPackager) GenerateBuildActions(ctx android.SingletonContext) {
|
||||
javaFuzzModule.ApexModuleBase,
|
||||
}
|
||||
|
||||
if ok := fuzz.IsValid(ctx, fuzzModuleValidator); !ok {
|
||||
if ok := fuzz.IsValid(fuzzModuleValidator); !ok {
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -1428,7 +1428,7 @@ func deferReportingMissingBootDexJar(ctx android.ModuleContext, module android.M
|
||||
// should not contribute to anything. So, rather than have a missing dex jar cause a Soong
|
||||
// failure defer the error reporting to Ninja. Unless the prebuilt build target is explicitly
|
||||
// built Ninja should never use the dex jar file.
|
||||
if !isActiveModule(ctx, module) {
|
||||
if !isActiveModule(module) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
@@ -53,7 +53,7 @@ func jacocoDepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
}
|
||||
|
||||
j, ok := ctx.Module().(instrumentable)
|
||||
if !ctx.Module().Enabled(ctx) || !ok {
|
||||
if !ctx.Module().Enabled() || !ok {
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -48,7 +48,7 @@ func (j *jdepsGeneratorSingleton) GenerateBuildActions(ctx android.SingletonCont
|
||||
moduleInfos := make(map[string]android.IdeInfo)
|
||||
|
||||
ctx.VisitAllModules(func(module android.Module) {
|
||||
if !module.Enabled(ctx) {
|
||||
if !module.Enabled() {
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -19,7 +19,6 @@ import (
|
||||
"path/filepath"
|
||||
|
||||
"android/soong/android"
|
||||
|
||||
"github.com/google/blueprint"
|
||||
"github.com/google/blueprint/proptools"
|
||||
)
|
||||
@@ -234,7 +233,7 @@ func (p *platformCompatConfigSingleton) GenerateBuildActions(ctx android.Singlet
|
||||
var compatConfigMetadata android.Paths
|
||||
|
||||
ctx.VisitAllModules(func(module android.Module) {
|
||||
if !module.Enabled(ctx) {
|
||||
if !module.Enabled() {
|
||||
return
|
||||
}
|
||||
if c, ok := module.(platformCompatConfigMetadataProvider); ok {
|
||||
|
@@ -2294,7 +2294,7 @@ func (module *SdkLibrary) getApiDir() string {
|
||||
// once for public API level and once for system API level
|
||||
func (module *SdkLibrary) CreateInternalModules(mctx android.DefaultableHookContext) {
|
||||
// If the module has been disabled then don't create any child modules.
|
||||
if !module.Enabled(mctx) {
|
||||
if !module.Enabled() {
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user