diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/app_import_test.go | 6 | ||||
-rw-r--r-- | java/boot_jars.go | 4 | ||||
-rw-r--r-- | java/bootclasspath.go | 5 | ||||
-rw-r--r-- | java/bootclasspath_fragment.go | 6 | ||||
-rw-r--r-- | java/dexpreopt_bootjars.go | 4 | ||||
-rw-r--r-- | java/fuzz.go | 2 | ||||
-rw-r--r-- | java/hiddenapi_modular.go | 2 | ||||
-rw-r--r-- | java/jacoco.go | 2 | ||||
-rw-r--r-- | java/jdeps.go | 2 | ||||
-rw-r--r-- | java/platform_compat_config.go | 3 | ||||
-rw-r--r-- | java/sdk_library.go | 2 |
11 files changed, 21 insertions, 17 deletions
diff --git a/java/app_import_test.go b/java/app_import_test.go index 5de50e794..496fc1308 100644 --- a/java/app_import_test.go +++ b/java/app_import_test.go @@ -509,7 +509,7 @@ func TestAndroidAppImport_ArchVariants(t *testing.T) { variant := ctx.ModuleForTests("foo", "android_common") if test.expected == "" { - if variant.Module().Enabled() { + if variant.Module().Enabled(android.PanickingConfigAndErrorContext(ctx)) { 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() { + if variant.Module().Enabled(android.PanickingConfigAndErrorContext(ctx)) { 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() { + if !a.Enabled(android.PanickingConfigAndErrorContext(ctx)) { t.Errorf("prebuilt foo module is disabled") } } diff --git a/java/boot_jars.go b/java/boot_jars.go index 5d40ec389..6223dede8 100644 --- a/java/boot_jars.go +++ b/java/boot_jars.go @@ -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(module android.Module) bool { - if !module.Enabled() { +func isActiveModule(ctx android.ConfigAndErrorContext, module android.Module) bool { + if !module.Enabled(ctx) { return false } return android.IsModulePreferred(module) diff --git a/java/bootclasspath.go b/java/bootclasspath.go index c7dc3afae..77ddf5c05 100644 --- a/java/bootclasspath.go +++ b/java/bootclasspath.go @@ -127,7 +127,10 @@ func reportMissingVariationDependency(ctx android.BottomUpMutatorContext, variat // added by addDependencyOntoApexModulePair. func gatherApexModulePairDepsWithTag(ctx android.BaseModuleContext, tag blueprint.DependencyTag) []android.Module { var modules []android.Module - ctx.VisitDirectDepsIf(isActiveModule, func(module android.Module) { + isActiveModulePred := func(module android.Module) bool { + return isActiveModule(ctx, module) + } + ctx.VisitDirectDepsIf(isActiveModulePred, func(module android.Module) { t := ctx.OtherModuleDependencyTag(module) if t == tag { modules = append(modules, module) diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go index cc3da7656..82a34ca9d 100644 --- a/java/bootclasspath_fragment.go +++ b/java/bootclasspath_fragment.go @@ -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.Module()) { + if isActiveModule(ctx, 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.Module()) { + if !isActiveModule(ctx, 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.Module()) && len(unknown) > 0 { + if isActiveModule(ctx, ctx.Module()) && len(unknown) > 0 { ctx.ModuleErrorf("%s in contents must also be declared in PRODUCT_APEX_BOOT_JARS", unknown) } } diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go index f7e3cb93a..7229ca02d 100644 --- a/java/dexpreopt_bootjars.go +++ b/java/dexpreopt_bootjars.go @@ -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(child) { + if !isActiveModule(ctx, 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.Module()) { + if isActiveModule(ctx, ctx.Module()) { image.licenseMetadataFile = android.OptionalPathForPath(ctx.LicenseMetadataFile()) } diff --git a/java/fuzz.go b/java/fuzz.go index fb31ce794..d37c55804 100644 --- a/java/fuzz.go +++ b/java/fuzz.go @@ -179,7 +179,7 @@ func (s *javaFuzzPackager) GenerateBuildActions(ctx android.SingletonContext) { javaFuzzModule.ApexModuleBase, } - if ok := fuzz.IsValid(fuzzModuleValidator); !ok { + if ok := fuzz.IsValid(ctx, fuzzModuleValidator); !ok { return } diff --git a/java/hiddenapi_modular.go b/java/hiddenapi_modular.go index ae587eac3..cab5402e9 100644 --- a/java/hiddenapi_modular.go +++ b/java/hiddenapi_modular.go @@ -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(module) { + if !isActiveModule(ctx, module) { return true } diff --git a/java/jacoco.go b/java/jacoco.go index a820b3855..696a0cc37 100644 --- a/java/jacoco.go +++ b/java/jacoco.go @@ -53,7 +53,7 @@ func jacocoDepsMutator(ctx android.BottomUpMutatorContext) { } j, ok := ctx.Module().(instrumentable) - if !ctx.Module().Enabled() || !ok { + if !ctx.Module().Enabled(ctx) || !ok { return } diff --git a/java/jdeps.go b/java/jdeps.go index 91f7ce715..340026318 100644 --- a/java/jdeps.go +++ b/java/jdeps.go @@ -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() { + if !module.Enabled(ctx) { return } diff --git a/java/platform_compat_config.go b/java/platform_compat_config.go index 2fc6c02a6..99fa092be 100644 --- a/java/platform_compat_config.go +++ b/java/platform_compat_config.go @@ -19,6 +19,7 @@ import ( "path/filepath" "android/soong/android" + "github.com/google/blueprint" "github.com/google/blueprint/proptools" ) @@ -233,7 +234,7 @@ func (p *platformCompatConfigSingleton) GenerateBuildActions(ctx android.Singlet var compatConfigMetadata android.Paths ctx.VisitAllModules(func(module android.Module) { - if !module.Enabled() { + if !module.Enabled(ctx) { return } if c, ok := module.(platformCompatConfigMetadataProvider); ok { diff --git a/java/sdk_library.go b/java/sdk_library.go index 113071fbb..2b6c8f8de 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -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() { + if !module.Enabled(mctx) { return } |