From 1b0cf98d4d7b842fffcc62a1c7cf50cba0f97277 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 19 Oct 2021 10:59:47 +0200 Subject: build(jmh): Fix duplicate classpath entries This change fixes an issue with the JMH plugin where entries would be included twice on the classpath or entries that did not belong on the classpath were also included. --- .../src/main/kotlin/benchmark-conventions.gradle.kts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'buildSrc') diff --git a/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts b/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts index 65608e8f..7d8775c6 100644 --- a/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts @@ -20,6 +20,7 @@ * SOFTWARE. */ +import me.champeau.jmh.JMHTask import org.jetbrains.kotlin.allopen.gradle.* plugins { @@ -37,4 +38,19 @@ jmh { profilers.add("stack") profilers.add("gc") + + includeTests.set(false) // Do not include tests by default +} + +tasks.named("jmh", JMHTask::class) { + outputs.upToDateWhen { false } // XXX Do not cache the output of this task + + testRuntimeClasspath.setFrom() // XXX Clear test runtime classpath to eliminate duplicate dependencies on classpath +} + +dependencies { + constraints { + val libs = Libs(project) + jmh(libs["commons.math3"]) // XXX Force JMH to use the same commons-math3 version as OpenDC + } } -- cgit v1.2.3