autonomousapps / autonomousapps/dependency-analysis-gradle-plugin

kaptTest not detected as kapt usage

Open
#776 12 comments 0 reactions 0 assignees View on GitHub
bug toolchain:android toolchain:kotlin
Dominant language
Kotlin
Stars
2.2k
Forks
158
Avg merge
16h 25m
Merged PRs (30d)
46

Description

**Build scan link**
http://gradle.affirm-dev.com/s/3irzggszoazni

**Plugin version**
1.13.1

**Gradle version**
7.5

**(Optional) Android Gradle Plugin (AGP) version**
7.2.1

**`reason` output for bugs relating to incorrect advice**
> Unused plugins that can be removed:
> kotlin-kapt: this project has the kotlin-kapt (org.jetbrains.kotlin.kapt) plugin applied, but there are no used annotation processors.

**Describe the bug**
I have a `kaptTest` dependency on Dagger. The plugin suggests KAPT removal.

**To Reproduce**
Steps to reproduce the behavior:
1) Add a `kaptTest` dependency on Dagger (`com.google.dagger:dagger:2.42`).
2) Run dependency analysis.

**Expected behavior**
When I have `kaptTest` dependencies then the plugin shouldn't suggest KAPT plugin removal.

Contributor guide

Open the contributing guide

Research direction

Reproduce with a kaptTest dependency on com.google.dagger:dagger:2.42 using plugin 1.13.1, Gradle 7.5, and AGP 7.2.1, then trace the dependency-analysis logic that decides whether kapt is used. Done means the advice no longer recommends removing kotlin-kapt when kaptTest processors are present, with a regression test covering the case.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
build-system
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.