From 9b409c8331ff8580f316c2e55bce1e855ecae06d Mon Sep 17 00:00:00 2001 From: Graham Date: Wed, 10 Feb 2021 19:20:25 +0000 Subject: [PATCH] Improve JUnit dependencies This commit groups the testImplementation and testRuntimeOnly dependencies. It also depends on junit-jupiter-engine specifically at test runtime, rather than all of junit-jupiter. This is the configuration shown in the JUnit documentation. Signed-off-by: Graham --- build.gradle.kts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b18d657d..d598510b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -128,6 +128,9 @@ configure(subprojects.filter { it.isFree }) { strictly(Versions.junit) } } + + val testRuntimeOnly by configurations + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${Versions.junit}") } } @@ -219,13 +222,6 @@ configure(subprojects.filter { it.isFree }) { } } - plugins.withType { - dependencies { - val testRuntimeOnly by configurations - testRuntimeOnly("org.junit.jupiter:junit-jupiter:${Versions.junit}") - } - } - plugins.withType { dependencies { val runtimeOnly by configurations