Skip to content

Commit

Permalink
Configuration cache friendly JMH plugin.
Browse files Browse the repository at this point in the history
Signed-off-by: Kenneth J. Shackleton <[email protected]>
  • Loading branch information
kennethshackleton committed Jun 3, 2024
1 parent eb65359 commit 0e1a051
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions buildSrc/src/main/kotlin/JmhPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ class JmhPlugin : Plugin<Project> {
}
}
tasks.register("jmh", JavaExec::class.java) {
val reportDir = "$buildDir/reports/jmh"
val reportFile = "$reportDir/jmh.json"
val reportDir = layout.buildDirectory.dir("reports/jmh")
val reportFile = layout.buildDirectory.file("reports/jmh/jmh.json")
group = "benchmark"
dependsOn("jmhClasses")
mainClass.set("org.openjdk.jmh.Main")
args(
"-rf", "json",
"-rff", reportFile
"-rff", reportFile.get().asFile.absolutePath
)
classpath(sourceSets.getByName("jmh").runtimeClasspath)
doFirst { mkdir(reportDir) }
doFirst { reportDir.get().asFile.mkdir() }
outputs.apply {
file(reportFile)
file(reportFile.get().asFile)
upToDateWhen { false }
}
}
Expand Down

0 comments on commit 0e1a051

Please sign in to comment.