Gradle plugin for JVM projects written in Java, Kotlin, Groovy, or Scala; and Android projects written in Java or Kotlin. Provides advice for managing dependencies and other applied plugins
Apache License 2.0
1.67k
stars
115
forks
source link
Unnecessary advice in the report for flavors or buildTypes dependencies #1082
Describe the bug
Our project has some flavors (google, huawei) and build types (debug, release). The following dependencies have been added to the project/build.gradle.kts:
When a dependency is declared common to both flavors or build types, the plugin advises adding one of two specific configurations:
if <buildType><configuration> is added, then it is recommended to replace it with google<buildType><configuration>
if is added, then it is recommended to replace it with Debug
When we replace dependencies as advised, we get the following:
if <buildType><configuration> is replaced with google<buildType><configuration>, the project failed building, since this dependency is also necessary for huawei flavor
if is replaced with Debug, the plugin advises adding the missing <flavor>Release<configuration> dependency
This seems like a bug, since adding several specific dependencies instead of one general one seems redundant.
To Reproduce./gradlew buildHealth or ./gradlew :proj:projectHealth in a project with some flavors and build types
Expected behavior
A report without advice on replacing general dependencies with specific ones.
Plugin version 1.25.0
Gradle version 8.3
JDK version 17
(Optional)
reason
output for bugs relating to incorrect advicereason
for ":some-libs-debug"Describe the bug Our project has some flavors (
google
,huawei
) and build types (debug
,release
). The following dependencies have been added to the project/build.gradle.kts:The report provides the following advice for these dependencies
When a dependency is declared common to both flavors or build types, the plugin advises adding one of two specific configurations:
<buildType><configuration>
is added, then it is recommended to replace it withgoogle<buildType><configuration>
When we replace dependencies as advised, we get the following:
<buildType><configuration>
is replaced withgoogle<buildType><configuration>
, the project failed building, since this dependency is also necessary forhuawei
flavor<flavor>Release<configuration>
dependencyThis seems like a bug, since adding several specific dependencies instead of one general one seems redundant.
To Reproduce
./gradlew buildHealth
or./gradlew :proj:projectHealth
in a project with some flavors and build typesExpected behavior A report without advice on replacing general dependencies with specific ones.