From 912e1c6bd3b07393256d7b9f32736e7ab0e0b1ba Mon Sep 17 00:00:00 2001 From: Douglas Q Hawkins Date: Mon, 22 Jun 2026 19:37:33 -0400 Subject: [PATCH] Wire -Pjmh.includes and -PtestJvm into internal-api JMH config Without this, -Pjmh.includes is silently ignored by the me.champeau.jmh plugin, requiring a full fat-jar build to run a single benchmark. -PtestJvm was also ignored for JMH execution, defaulting to the Gradle daemon JVM regardless of the requested version. Co-Authored-By: Claude Sonnet 4.6 --- internal-api/build.gradle.kts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal-api/build.gradle.kts b/internal-api/build.gradle.kts index fc95dd9e1f1..826d972f95b 100644 --- a/internal-api/build.gradle.kts +++ b/internal-api/build.gradle.kts @@ -1,3 +1,4 @@ +import datadog.gradle.plugin.testJvmConstraints.TestJvmSpec import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis import groovy.lang.Closure @@ -282,4 +283,13 @@ dependencies { jmh { jmhVersion = libs.versions.jmh.get() duplicateClassesStrategy = DuplicatesStrategy.EXCLUDE + + if (project.hasProperty("jmh.includes")) { + includes.add(project.property("jmh.includes") as String) + } + + if (project.hasProperty("testJvm")) { + val testJvmSpec = TestJvmSpec(project) + jvm.set(testJvmSpec.javaTestLauncher.map { it.executablePath.asFile.absolutePath }) + } }