Skip to content

buildSrc dependencies leaks are not visible in gradlew buildEnvironment #8301

@Tolriq

Description

@Tolriq

Expected Behavior

I have read #4741 and understood that it's normal that the buildSrc dependencies currently leak even if using implementation.

But due to the lack of resolution this can cause build issues because any dependency declared in buildSrc will override later declarations.
While this is an issue the main issue is that gradlew buildEnvironment does not report the dependencies from buildSrc but the normal declarations. Making very very hard to debug dependencies issues when there's no direct build issues.

Current Behavior

gradlew buildEnvironment does not return the real dependencies that are used!

Context

My project is build with wrong dependencies used and since there was no errors I had no way to know that I was using the wrong ones.

Steps to Reproduce (for bugs)

Gradle 5.1.1 / Windows

In buildSrc/build.gradle.kts

dependencies {
    implementation("com.android.tools.build:gradle:3.3.0")
}

in the application root build.gradle.kts

buildscript {
    dependencies {
        classpath("com.android.tools.build:gradle:3.4.0-beta1")
     }
}

Running gradlew buildEnvironment will produce

classpath
+--- com.android.tools.build:gradle:3.4.0-beta01

But in reality version 3.3.0 will be used. If the plugin does not log it's version it's virtually impossible to know that wrong dependency is used.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions