CoverJet Gradle plugin

October 27, 2025 ยท View on GitHub

Build codecov GitHub issues GitHub stars

CoverJet is lightweight Gradle plugin that uses IntelliJ Coverage engine to collect coverage data. Also, the plugin provides infrastructure to collect coverage from GradleRunner tests(See Gradle Runner tests).

Installation

Compatibility

CoverJet compatibility table:

CoverJet pluginGradlemin JVMKotlin
0.1.+8.14+ - 9.1+172.1.20+
0.0.+7.6.4 - 8.13+172.0+

Apply plugin

Kotlin
plugins {
    id("io.github.gw-kit.cover-jet") version "<the-plugin-version>"
}

The latest release version is GitHub Release

Configuration

Kotlin
coverJet {
    // Default: 1.0.744
    intellijCoverageVersion.set("<agent-version>")
}

Execute

./gradlew test 

The test coverage data in binary format will be saved by the path build/coverage/<test-task-name>.ic.

Gradle Runner tests

This section is useful for plugin developers who want to collect coverage data from GradleRunner tests. Since, GradleRunner tests are executed in a separate JVM, the coverage data is not collected by default. CoverJet plugin generates all required JVM agent properties to collect coverage data.

The only action required from plugin dev is to configure the GradleRunner in the next way:

val projectRoot: File = File("<path-to-project>")
val gradleRunner = GradleRunner.create()
    .withPluginClasspath()
    .withProjectDir(projectRoot)
    // other configurations if needed
    .apply {
        // gradle testkit support
        val testKitPath: String = System.getProperty("io.github.gwkit.coverjet.test-kit")
        File(projectDir, "gradle.properties").appendText(
            File(testKitPath).readText()
        )
    }

Generate reports

Coming soon...