Fixed
Status Update
Comments
xa...@google.com <xa...@google.com>
ma...@google.com <ma...@google.com> #2
I think it makes sense to turn that into just a warning. Will open a PR.
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 41758888fca996a162c25530662c0ec621ca517d
Author: Marcello Albano <maralb@google.com>
Date: Thu Apr 11 15:50:08 2024
Changed exception to info log when benchmark variants are disabled
Currently if benchmark variants are disabled, an exception is thrown.
This PR changes the exception to a info log, in case it's intentional
Bug: 332772491
Test: ./gradlew :benchmark:benchmark-baseline-profile-gradle-plugin:test
Relnote: Changed exception to info log when benchmark variants are disabled
Change-Id: I8a517fac2e12c761d49259bf30471e66a04b5383
M benchmark/baseline-profile-gradle-plugin/src/main/kotlin/androidx/baselineprofile/gradle/consumer/BaselineProfileConsumerPlugin.kt
M benchmark/baseline-profile-gradle-plugin/src/main/kotlin/androidx/baselineprofile/gradle/utils/AgpPlugin.kt
M benchmark/baseline-profile-gradle-plugin/src/test/kotlin/androidx/baselineprofile/gradle/consumer/BaselineProfileConsumerPluginTest.kt
https://android-review.googlesource.com/3038151
Branch: androidx-main
commit 41758888fca996a162c25530662c0ec621ca517d
Author: Marcello Albano <maralb@google.com>
Date: Thu Apr 11 15:50:08 2024
Changed exception to info log when benchmark variants are disabled
Currently if benchmark variants are disabled, an exception is thrown.
This PR changes the exception to a info log, in case it's intentional
Bug: 332772491
Test: ./gradlew :benchmark:benchmark-baseline-profile-gradle-plugin:test
Relnote: Changed exception to info log when benchmark variants are disabled
Change-Id: I8a517fac2e12c761d49259bf30471e66a04b5383
M benchmark/baseline-profile-gradle-plugin/src/main/kotlin/androidx/baselineprofile/gradle/consumer/BaselineProfileConsumerPlugin.kt
M benchmark/baseline-profile-gradle-plugin/src/main/kotlin/androidx/baselineprofile/gradle/utils/AgpPlugin.kt
M benchmark/baseline-profile-gradle-plugin/src/test/kotlin/androidx/baselineprofile/gradle/consumer/BaselineProfileConsumerPluginTest.kt
ma...@google.com <ma...@google.com>
xa...@google.com <xa...@google.com> #4
If you output a warning for something that the user may be doing on purpose, there should be a way to disable the warning. We always get feedback that unremovable warning are a problem.
ma...@google.com <ma...@google.com> #5
With aosp/3052862 it's possible to suppress this warning with:
baselineProfile {
warnings {
disabledVariants = false
}
}
See
Description
The
androidx.baselineprofile
plugin generates additional<flavor>NonMinifiedRelease
and<flavor>BenchmarkRelease
variants for each original variant that's non-debuggable (release).Sometimes not all combinations of flavor + build type are needed so it makes sense to disable certain variants with the
androidComponents.beforeVariants
API.For example, a project has defined 1 flavor dimension "environment" with 4 flavors:
By default this produces 8 variants:
We can disable 4 of the variants that are irrelevant:
When baseline profile plugin is applied to the app module, before any variant filtering it adds the following variants:
Let's say I want to generate baseline profile and run benchmark with just the
devRelease
variant.The generated
devNonMinifiedRelease
anddevBenchmarkRelease
should be enough. So I would still filter outdevRelease
.I'm also able to filter out the generated
<mock|demo>NonMinifiedRelease
and<mock|demo>BenchmarkRelease
variants as well as the original<mock|demo>Release
.Now I also want to filter out
prodNonMinifiedRelease
andprodBenchmarkRelease
as I don't need to generate BP or run benchmark with theprod
flavor. So the variant filter looks like thisWith this the build fails during configuration:
It seems like the task wiring fails when a
release
variant (prodRelease
in this case) is enabled but the correspondingbenchmarkRelease
variant is disabled.Adding the
prodBenchmarkRelease
variant fixes it.But the
prodBenchmarkRelease
variant is useless while lot of tasks are registered for it.I'm not sure what the right solution should be as there seems to be a chicken and egg problem when variants are being filtered out by user but also being added by the plugin during configuration.
To reproduce, please checkout this sample .
app/build.gradle.kts
, comment out"prodBenchmarkRelease",
from line 170../gradlew
Studio Build: Android Studio Koala 2024.1.1 Canary 3
Version of Gradle Plugin: 8.5.0-alpha03
Version of Gradle: 8.7
Version of
androidx.baselineprofile
: 1.3.0-alpha02Version of Java: 21
OS: macOS