autonomousapps / autonomousapps/dependency-analysis-gradle-plugin
Kotlin Android project with jvmTarget 11 still sees kotlin-stdlib suggested
- Dominant language
- Kotlin
- Stars
- 2.2k
- Forks
- 158
- Avg merge
- 16h 25m
- Merged PRs (30d)
- 46
Description
**Build scan link**
**Plugin version**
1.1.0
**Gradle version**
7.4.2
**(Optional) Android Gradle Plugin (AGP) version**
7.1.3
**Describe the bug**
We use jvmTarget 11 in our repo and let KGP apply the stdlib dep for us. With this, it adds the -jdk8 artifact. However, the plugin suggests adding the kotlin-stdlib dep anyway when it should be treated as a bundle dep and/or recognize that the jdk8 artifact includes it.
**To Reproduce**
Steps to reproduce the behavior:
See above
**Expected behavior**
See above
**Additional context**
```json
{
"projectPath": ":services:users:test",
"dependencyAdvice": [
{
"coordinates": {
"type": "module",
"identifier": "androidx.annotation:annotation",
"resolvedVersion": "1.3.0"
},
"fromConfiguration": "implementation",
"toConfiguration": "compileOnly"
},
{
"coordinates": {
"type": "module",
"identifier": "com.google.dagger:dagger",
"resolvedVersion": "2.41"
},
"fromConfiguration": "implementation"
},
{
"coordinates": {
"type": "module",
"identifier": "com.google.truth:truth",
"resolvedVersion": "1.1.3"
},
"fromConfiguration": "testImplementation"
},
{
"coordinates": {
"type": "module",
"identifier": "com.slack.lint:slack-lint-annotations",
"resolvedVersion": "00009"
},
"fromConfiguration": "implementation"
},
{
"coordinates": {
"type": "module",
"identifier": "com.squareup.anvil:annotations",
"resolvedVersion": "2.4.0"
},
"fromConfiguration": "releaseImplementation"
},
{
"coordinates": {
"type": "module",
"identifier": "com.squareup.anvil:annotations",
"resolvedVersion": "2.4.0"
},
"fromConfiguration": "releaseUnitTestImplementation"
},
{
"coordinates": {
"type": "module",
"identifier": "io.reactivex.rxjava3:rxjava",
"resolvedVersion": "3.1.4"
},
"fromConfiguration": "implementation",
"toConfiguration": "api"
},
{
"coordinates": {
"type": "module",
"identifier": "javax.inject:javax.inject",
"resolvedVersion": "1"
},
"fromConfiguration": "implementation"
},
{
"coordinates": {
"type": "module",
"identifier": "junit:junit",
"resolvedVersion": "4.13.2"
},
"fromConfiguration": "testImplementation"
},
{
"coordinates": {
"type": "module",
"identifier": "org.jetbrains.kotlin:kotlin-stdlib",
"resolvedVersion": "1.6.21"
},
"toConfiguration": "api"
},
{
"coordinates": {
"type": "project",
"identifier": ":libraries:foundation:anvil:injection"
},
"fromConfiguration": "implementation"
},
{
"coordinates": {
"type": "project",
"identifier": ":libraries:model"
},
"fromConfiguration": "implementation",
"toConfiguration": "api"
},
{
"coordinates": {
"type": "project",
"identifier": ":services:users"
},
"fromConfiguration": "implementation",
"toConfiguration": "api"
}
],
"pluginAdvice": [],
"shouldFail": false
}
```
Contributor guide
Research direction
Reproduce the dependency advice with Kotlin plugin 1.1.0, Gradle 7.4.2, and AGP 7.1.3 using the configuration described in the issue. Trace how the plugin treats kotlin-stdlib and kotlin-stdlib-jdk8, then verify that the advice no longer suggests kotlin-stdlib when the bundled dependency is already present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- build-system, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100