Loading android/override_module.go +1 −1 Original line number Diff line number Diff line Loading @@ -295,7 +295,7 @@ func performOverrideMutator(ctx BottomUpMutatorContext) { } func overridableModuleDepsMutator(ctx BottomUpMutatorContext) { if b, ok := ctx.Module().(OverridableModule); ok { if b, ok := ctx.Module().(OverridableModule); ok && b.Enabled() { b.OverridablePropertiesDepsMutator(ctx) } } Loading apex/apex.go +23 −22 Original line number Diff line number Diff line Loading @@ -111,9 +111,6 @@ type apexBundleProperties struct { // List of java libraries that are embedded inside this APEX bundle. Java_libs []string // List of prebuilt files that are embedded inside this APEX bundle. Prebuilts []string // List of platform_compat_config files that are embedded inside this APEX bundle. Compat_configs []string Loading Loading @@ -291,6 +288,9 @@ type overridableProperties struct { // List of APKs that are embedded inside this APEX. Apps []string // List of prebuilt files that are embedded inside this APEX bundle. Prebuilts []string // List of runtime resource overlays (RROs) that are embedded inside this APEX. Rros []string Loading Loading @@ -684,7 +684,6 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) { // each target os/architectures, appropriate dependencies are selected by their // target.<os>.multilib.<type> groups and are added as (direct) dependencies. targets := ctx.MultiTargets() config := ctx.DeviceConfig() imageVariation := a.getImageVariation(ctx) a.combineProperties(ctx) Loading Loading @@ -758,23 +757,6 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) { } } if prebuilts := a.properties.Prebuilts; len(prebuilts) > 0 { // For prebuilt_etc, use the first variant (64 on 64/32bit device, 32 on 32bit device) // regardless of the TARGET_PREFER_* setting. See b/144532908 archForPrebuiltEtc := config.Arches()[0] for _, arch := range config.Arches() { // Prefer 64-bit arch if there is any if arch.ArchType.Multilib == "lib64" { archForPrebuiltEtc = arch break } } ctx.AddFarVariationDependencies([]blueprint.Variation{ {Mutator: "os", Variation: ctx.Os().String()}, {Mutator: "arch", Variation: archForPrebuiltEtc.String()}, }, prebuiltTag, prebuilts...) } // Common-arch dependencies come next commonVariation := ctx.Config().AndroidCommonTarget.Variations() ctx.AddFarVariationDependencies(commonVariation, bcpfTag, a.properties.Bootclasspath_fragments...) Loading Loading @@ -814,6 +796,25 @@ func (a *apexBundle) OverridablePropertiesDepsMutator(ctx android.BottomUpMutato ctx.AddFarVariationDependencies(commonVariation, androidAppTag, a.overridableProperties.Apps...) ctx.AddFarVariationDependencies(commonVariation, bpfTag, a.overridableProperties.Bpfs...) ctx.AddFarVariationDependencies(commonVariation, rroTag, a.overridableProperties.Rros...) if prebuilts := a.overridableProperties.Prebuilts; len(prebuilts) > 0 { // For prebuilt_etc, use the first variant (64 on 64/32bit device, 32 on 32bit device) // regardless of the TARGET_PREFER_* setting. See b/144532908 arches := ctx.DeviceConfig().Arches() if len(arches) != 0 { archForPrebuiltEtc := arches[0] for _, arch := range arches { // Prefer 64-bit arch if there is any if arch.ArchType.Multilib == "lib64" { archForPrebuiltEtc = arch break } } ctx.AddFarVariationDependencies([]blueprint.Variation{ {Mutator: "os", Variation: ctx.Os().String()}, {Mutator: "arch", Variation: archForPrebuiltEtc.String()}, }, prebuiltTag, prebuilts...) } } // Dependencies for signing if String(a.overridableProperties.Key) == "" { Loading Loading @@ -3282,7 +3283,7 @@ func apexBundleBp2BuildInternal(ctx android.TopDownMutatorContext, module *apexB nativeSharedLibsLabelList := android.BazelLabelForModuleDeps(ctx, nativeSharedLibs) nativeSharedLibsLabelListAttribute := bazel.MakeLabelListAttribute(nativeSharedLibsLabelList) prebuilts := module.properties.Prebuilts prebuilts := module.overridableProperties.Prebuilts prebuiltsLabelList := android.BazelLabelForModuleDeps(ctx, prebuilts) prebuiltsLabelListAttribute := bazel.MakeLabelListAttribute(prebuiltsLabelList) Loading apex/apex_test.go +15 −0 Original line number Diff line number Diff line Loading @@ -6080,6 +6080,7 @@ func TestOverrideApex(t *testing.T) { key: "myapex.key", apps: ["app"], bpfs: ["bpf"], prebuilts: ["myetc"], overrides: ["oldapex"], updatable: false, } Loading @@ -6089,6 +6090,7 @@ func TestOverrideApex(t *testing.T) { base: "myapex", apps: ["override_app"], bpfs: ["override_bpf"], prebuilts: ["override_myetc"], overrides: ["unknownapex"], logging_parent: "com.foo.bar", package_name: "test.overridden.package", Loading Loading @@ -6137,6 +6139,16 @@ func TestOverrideApex(t *testing.T) { name: "override_bpf", srcs: ["override_bpf.c"], } prebuilt_etc { name: "myetc", src: "myprebuilt", } prebuilt_etc { name: "override_myetc", src: "override_myprebuilt", } `, withManifestPackageNameOverrides([]string{"myapex:com.android.myapex"})) originalVariant := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(android.OverridableModule) Loading @@ -6158,6 +6170,9 @@ func TestOverrideApex(t *testing.T) { ensureNotContains(t, copyCmds, "image.apex/etc/bpf/bpf.o") ensureContains(t, copyCmds, "image.apex/etc/bpf/override_bpf.o") ensureNotContains(t, copyCmds, "image.apex/etc/myetc") ensureContains(t, copyCmds, "image.apex/etc/override_myetc") apexBundle := module.Module().(*apexBundle) name := apexBundle.Name() if name != "override_myapex" { Loading Loading
android/override_module.go +1 −1 Original line number Diff line number Diff line Loading @@ -295,7 +295,7 @@ func performOverrideMutator(ctx BottomUpMutatorContext) { } func overridableModuleDepsMutator(ctx BottomUpMutatorContext) { if b, ok := ctx.Module().(OverridableModule); ok { if b, ok := ctx.Module().(OverridableModule); ok && b.Enabled() { b.OverridablePropertiesDepsMutator(ctx) } } Loading
apex/apex.go +23 −22 Original line number Diff line number Diff line Loading @@ -111,9 +111,6 @@ type apexBundleProperties struct { // List of java libraries that are embedded inside this APEX bundle. Java_libs []string // List of prebuilt files that are embedded inside this APEX bundle. Prebuilts []string // List of platform_compat_config files that are embedded inside this APEX bundle. Compat_configs []string Loading Loading @@ -291,6 +288,9 @@ type overridableProperties struct { // List of APKs that are embedded inside this APEX. Apps []string // List of prebuilt files that are embedded inside this APEX bundle. Prebuilts []string // List of runtime resource overlays (RROs) that are embedded inside this APEX. Rros []string Loading Loading @@ -684,7 +684,6 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) { // each target os/architectures, appropriate dependencies are selected by their // target.<os>.multilib.<type> groups and are added as (direct) dependencies. targets := ctx.MultiTargets() config := ctx.DeviceConfig() imageVariation := a.getImageVariation(ctx) a.combineProperties(ctx) Loading Loading @@ -758,23 +757,6 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) { } } if prebuilts := a.properties.Prebuilts; len(prebuilts) > 0 { // For prebuilt_etc, use the first variant (64 on 64/32bit device, 32 on 32bit device) // regardless of the TARGET_PREFER_* setting. See b/144532908 archForPrebuiltEtc := config.Arches()[0] for _, arch := range config.Arches() { // Prefer 64-bit arch if there is any if arch.ArchType.Multilib == "lib64" { archForPrebuiltEtc = arch break } } ctx.AddFarVariationDependencies([]blueprint.Variation{ {Mutator: "os", Variation: ctx.Os().String()}, {Mutator: "arch", Variation: archForPrebuiltEtc.String()}, }, prebuiltTag, prebuilts...) } // Common-arch dependencies come next commonVariation := ctx.Config().AndroidCommonTarget.Variations() ctx.AddFarVariationDependencies(commonVariation, bcpfTag, a.properties.Bootclasspath_fragments...) Loading Loading @@ -814,6 +796,25 @@ func (a *apexBundle) OverridablePropertiesDepsMutator(ctx android.BottomUpMutato ctx.AddFarVariationDependencies(commonVariation, androidAppTag, a.overridableProperties.Apps...) ctx.AddFarVariationDependencies(commonVariation, bpfTag, a.overridableProperties.Bpfs...) ctx.AddFarVariationDependencies(commonVariation, rroTag, a.overridableProperties.Rros...) if prebuilts := a.overridableProperties.Prebuilts; len(prebuilts) > 0 { // For prebuilt_etc, use the first variant (64 on 64/32bit device, 32 on 32bit device) // regardless of the TARGET_PREFER_* setting. See b/144532908 arches := ctx.DeviceConfig().Arches() if len(arches) != 0 { archForPrebuiltEtc := arches[0] for _, arch := range arches { // Prefer 64-bit arch if there is any if arch.ArchType.Multilib == "lib64" { archForPrebuiltEtc = arch break } } ctx.AddFarVariationDependencies([]blueprint.Variation{ {Mutator: "os", Variation: ctx.Os().String()}, {Mutator: "arch", Variation: archForPrebuiltEtc.String()}, }, prebuiltTag, prebuilts...) } } // Dependencies for signing if String(a.overridableProperties.Key) == "" { Loading Loading @@ -3282,7 +3283,7 @@ func apexBundleBp2BuildInternal(ctx android.TopDownMutatorContext, module *apexB nativeSharedLibsLabelList := android.BazelLabelForModuleDeps(ctx, nativeSharedLibs) nativeSharedLibsLabelListAttribute := bazel.MakeLabelListAttribute(nativeSharedLibsLabelList) prebuilts := module.properties.Prebuilts prebuilts := module.overridableProperties.Prebuilts prebuiltsLabelList := android.BazelLabelForModuleDeps(ctx, prebuilts) prebuiltsLabelListAttribute := bazel.MakeLabelListAttribute(prebuiltsLabelList) Loading
apex/apex_test.go +15 −0 Original line number Diff line number Diff line Loading @@ -6080,6 +6080,7 @@ func TestOverrideApex(t *testing.T) { key: "myapex.key", apps: ["app"], bpfs: ["bpf"], prebuilts: ["myetc"], overrides: ["oldapex"], updatable: false, } Loading @@ -6089,6 +6090,7 @@ func TestOverrideApex(t *testing.T) { base: "myapex", apps: ["override_app"], bpfs: ["override_bpf"], prebuilts: ["override_myetc"], overrides: ["unknownapex"], logging_parent: "com.foo.bar", package_name: "test.overridden.package", Loading Loading @@ -6137,6 +6139,16 @@ func TestOverrideApex(t *testing.T) { name: "override_bpf", srcs: ["override_bpf.c"], } prebuilt_etc { name: "myetc", src: "myprebuilt", } prebuilt_etc { name: "override_myetc", src: "override_myprebuilt", } `, withManifestPackageNameOverrides([]string{"myapex:com.android.myapex"})) originalVariant := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(android.OverridableModule) Loading @@ -6158,6 +6170,9 @@ func TestOverrideApex(t *testing.T) { ensureNotContains(t, copyCmds, "image.apex/etc/bpf/bpf.o") ensureContains(t, copyCmds, "image.apex/etc/bpf/override_bpf.o") ensureNotContains(t, copyCmds, "image.apex/etc/myetc") ensureContains(t, copyCmds, "image.apex/etc/override_myetc") apexBundle := module.Module().(*apexBundle) name := apexBundle.Name() if name != "override_myapex" { Loading