autonomousapps / autonomousapps/dependency-analysis-gradle-plugin

Plugin doesn't detect unused dependency in KMP gradle.build.kts file

Open
#762 1 comment 9 reactions 0 assignees View on GitHub
enhancement
Dominant language
Kotlin
Stars
2.2k
Forks
158
Avg merge
16h 25m
Merged PRs (30d)
46

Description

**Plugin version**
1.11.0

**Gradle version**
7.4.2

**Describe the bug**
We have project which consist of shared KMP modules and classic android modules. For android modules the plugin works +- fine, but I noticed it doesn't work at all for KMP modules. For example the KMP gradle.build.kts file looks like this

```
kotlin.sourceSets {
val commonMain by getting {
dependencies {
implementation(project(":shared:dependency1"))
implementation(project(":shared:dependency2"))
}
}
}
```

I tried to add random dependency3 (which is not used in this module) just to check whether the plugin would detect the dependency or no, and the dependency remained undetected

Should current version of plugin work in this case?

**To Reproduce**
add random dependency to KMP gradle.build.kts file

**Expected behavior**
dependency would be recognized as unused

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the report with the Kotlin Multiplatform gradle.build.kts configuration shown, using plugin version 1.11.0 and Gradle 7.4.2. Compare dependency analysis for the shared KMP module with the classic Android module, and confirm that an unused dependency is reported as unused when the investigation is complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.