Skip to content

Commit

Permalink
Merge pull request #530 from kennethshackleton/jmh-cc-friendly
Browse files Browse the repository at this point in the history
Make our JMH Gradle plugin configuration cache friendly.
  • Loading branch information
kennethshackleton authored Jun 3, 2024
2 parents eb65359 + 0e1a051 commit 7edee0f
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 7edee0f

Please sign in to comment.