autonomousapps / autonomousapps/dependency-analysis-gradle-plugin

`com.android.test` projects recommend removing dependencies that provide instrumentation tests

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

Description

**Plugin version**
2.17.0

**Gradle version**
8.12.1

**JDK version**
17

**(Optional) Kotlin and Kotlin Gradle Plugin (KGP) version**
2.0.21

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

**Describe the bug**
Running `fixDependencies` on an empty com.android.test project that has only android library dependencies to provide ui tests will end up removing the dependencies.

**To Reproduce**
Basic project structure to repro this:
```
:app (com.android.app)
:test-app (com.android.test)
targetProjectPath ':app'
depends on :test-suite
:test-suite (com.android.library)

```

**Expected behavior**
If a `com.android.test` project includes a dependency on an android library that has classes in an `androidTest` configuration, it should not be marked unused.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `fixDependencies` with the described `:app`, `:test-app`, and `:test-suite` project structure and the `androidTest` sources in the library. Trace how dependencies of `com.android.test` projects are classified, then verify that the dependency providing instrumentation tests is retained rather than reported as unused.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.