tree: 85de3e408c6742c69dcf9581db48ab9879045d46 [path history] [tgz]
  1. src/
  2. build.gradle.kts
  3. Readme.md
repo/gradle-build-conventions/compiler-tests-convention/Readme.md

compiler-test-convention

Description

This plugin adds dependencies to the test tasks, building the required jars and tracking them as inputs, but it passes the absolute paths to the test as systemProperties.

This plugin is key for:

  • make tests cacheable, avoiding execution if no input changed
  • allow Gradle Predictive Test Selection to understand the code changes and have an accurate prediction

Usage

Apply it:

plugins {
    id("compiler-test-convention")
}

Add dependencies to the test classpath (kotlin-stdlib, kotlin-stdlib-jvm-minimal-for-test, and kotlin-reflect are always added):

compilerTests {
    withStdlibCommon()
    withTestJar()
    withAnnotations()
    ...
}