summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts16
-rw-r--r--opendc-simulator/opendc-simulator-flow/build.gradle.kts2
2 files changed, 18 insertions, 0 deletions
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
+ }
}
diff --git a/opendc-simulator/opendc-simulator-flow/build.gradle.kts b/opendc-simulator/opendc-simulator-flow/build.gradle.kts
index 05e21c3c..f5b67851 100644
--- a/opendc-simulator/opendc-simulator-flow/build.gradle.kts
+++ b/opendc-simulator/opendc-simulator-flow/build.gradle.kts
@@ -36,4 +36,6 @@ dependencies {
testImplementation(projects.opendcSimulator.opendcSimulatorCore)
testImplementation(libs.slf4j.simple)
+
+ jmhImplementation(projects.opendcSimulator.opendcSimulatorCore)
}