Merge "Improve optimize bp2build conditional." into main am: 8559872623
am: 6c49c4a1d5
am: 36b815461a
am: d75588773b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2762806 Change-Id: I7b84a024363c10abe56a07f1c0069fd38f52f8ae Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
15
java/app.go
15
java/app.go
@@ -1689,16 +1689,12 @@ func convertWithBp2build(ctx android.Bp2buildMutatorContext, a *AndroidApp) (boo
|
||||
//
|
||||
// TODO(b/192032291): Disable android_test_helper_app optimization by
|
||||
// default after auditing downstream usage.
|
||||
if a.dexProperties.Optimize.Enabled == nil {
|
||||
// Property was not explicitly defined.
|
||||
a.dexProperties.Optimize.Enabled = &a.dexProperties.Optimize.EnabledByDefault
|
||||
if a.dexProperties.Optimize.EnabledByDefault != a.dexer.effectiveOptimizeEnabled() {
|
||||
// Property is explicitly defined by default from default, so emit the Bazel attribute.
|
||||
appAttrs.Optimize = proptools.BoolPtr(a.dexer.effectiveOptimizeEnabled())
|
||||
}
|
||||
if Bool(a.dexProperties.Optimize.Enabled) {
|
||||
if !a.dexProperties.Optimize.EnabledByDefault {
|
||||
// explicitly enable optimize for module types that disable it by default
|
||||
appAttrs.Optimize = proptools.BoolPtr(true)
|
||||
}
|
||||
|
||||
if a.dexer.effectiveOptimizeEnabled() {
|
||||
handCraftedFlags := ""
|
||||
if Bool(a.dexProperties.Optimize.Ignore_warnings) {
|
||||
handCraftedFlags += "-ignorewarning "
|
||||
@@ -1728,9 +1724,6 @@ func convertWithBp2build(ctx android.Bp2buildMutatorContext, a *AndroidApp) (boo
|
||||
})
|
||||
appAttrs.Proguard_specs.Add(bazel.MakeLabelAttribute(":" + generatedFlagFileRuleName))
|
||||
}
|
||||
} else if a.dexProperties.Optimize.EnabledByDefault {
|
||||
// explicitly disable optimize for module types that enable it by default
|
||||
appAttrs.Optimize = proptools.BoolPtr(false)
|
||||
}
|
||||
|
||||
commonAttrs, bp2BuildInfo, supported := a.convertLibraryAttrsBp2Build(ctx)
|
||||
|
Reference in New Issue
Block a user