Skip to content

Bug: Android and other Gradle configurations (androidTestImplementation, debugImplementation, ksp, testFixturesImplementation) are not read #660

Closed

Description

@vibgrate-team

Context

GRADLE_CONFIG_NAMES in src/core-open/scanners/java-scanner.ts (around line 401) is:

implementation|api|compileOnly|runtimeOnly|testImplementation|testRuntimeOnly|testCompileOnly|annotationProcessor|kapt

The match is case-sensitive, so any configuration whose name has Implementation with a capital I is missed. In a typical Android or Kotlin module that means these lines are silently dropped from vg scan:

  • androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
  • debugImplementation, releaseImplementation, and other build-type or flavour variants
  • testFixturesImplementation, testFixturesApi
  • ksp("com.google.dagger:hilt-compiler:2.52"), kaptTest, kaptAndroidTest
  • developmentOnly (Spring Boot) and compileOnlyApi

What to do

  1. Extend the configuration matching to cover the names above. A pattern such as [a-z][A-Za-z]*(?:Implementation|Api|CompileOnly|RuntimeOnly) plus explicit ksp/kapt*/developmentOnly is one option; keep a word boundary at the start so it does not match inside other identifiers.
  2. Treat androidTest*, test*, testFixtures*, kaptTest, kaptAndroidTest and kspTest as development configurations in isGradleTestConfiguration.
  3. Add a build.gradle.kts fixture for an Android app module that uses each of them.

Acceptance

  • Each configuration listed above produces a row in vg scan
  • androidTestImplementation, testFixturesImplementation and kaptTest rows are in devDependencies
  • debugImplementation and ksp rows stay production
  • Existing Gradle tests still pass

Activity

  1. added
    bug
    on Nov 12, 2026
  2. vibgrate-team commented on Nov 12, 2026

    @vibgrate-team
    ContributorAuthor

    Confirmed. GRADLE_CONFIG_NAMES (line 401 of java-scanner.ts) is a fixed, case-sensitive list, so androidTestImplementation, debugImplementation, ksp and friends never match.

    Things to watch when widening it:

    • The same constant feeds the string regex (line 444), the Kotlin regex (line 451) and gradleCatalogUses (line 463), so one change covers all three. Make sure every use still has a boundary before the name, otherwise implementation will start matching inside longer identifiers.
    • isGradleTestConfiguration (line 349) decides devDependencies; extend it for the androidTest*, testFixtures*, kaptTest, kaptAndroidTest and kspTest names, while keeping debugImplementation and ksp as production.
    • The duplicate-merge logic around lines 396 and 627 prefers a production configuration over a test one; a fixture with the same coordinate under both implementation and androidTestImplementation is a good regression test.

    We'll pick this up from the team side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions