Fix running twice jvmTask for benchmarks (#4011)
This commit is contained in:
@@ -25,10 +25,7 @@ open class RunJvmTask : JavaExec() {
|
|||||||
@Option(option = "verbose", description = "Verbose mode of running benchmarks")
|
@Option(option = "verbose", description = "Verbose mode of running benchmarks")
|
||||||
var verbose: Boolean = false
|
var verbose: Boolean = false
|
||||||
|
|
||||||
override fun configure(configureClosure: Closure<Any>): Task {
|
@JvmOverloads
|
||||||
return super.configure(configureClosure)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun executeTask(output: java.io.OutputStream? = null) {
|
private fun executeTask(output: java.io.OutputStream? = null) {
|
||||||
val filterArgs = filter.splitCommaSeparatedOption("-f")
|
val filterArgs = filter.splitCommaSeparatedOption("-f")
|
||||||
val filterRegexArgs = filterRegex.splitCommaSeparatedOption("-fr")
|
val filterRegexArgs = filterRegex.splitCommaSeparatedOption("-fr")
|
||||||
@@ -37,11 +34,11 @@ open class RunJvmTask : JavaExec() {
|
|||||||
if (verbose) {
|
if (verbose) {
|
||||||
args("-v")
|
args("-v")
|
||||||
}
|
}
|
||||||
exec()
|
super.exec()
|
||||||
}
|
}
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
fun run() {
|
override fun exec() {
|
||||||
if (outputFileName != null)
|
if (outputFileName != null)
|
||||||
File(outputFileName).outputStream().use { output -> executeTask(output) }
|
File(outputFileName).outputStream().use { output -> executeTask(output) }
|
||||||
else
|
else
|
||||||
|
|||||||
+1
-1
@@ -65,7 +65,7 @@ open class KotlinNativeBenchmarkingPlugin: BenchmarkingPlugin() {
|
|||||||
|
|
||||||
override fun Project.configureJvmTask(): Task {
|
override fun Project.configureJvmTask(): Task {
|
||||||
return tasks.create("jvmRun", RunJvmTask::class.java) { task ->
|
return tasks.create("jvmRun", RunJvmTask::class.java) { task ->
|
||||||
task.dependsOn("build")
|
task.dependsOn("jvmJar")
|
||||||
val mainCompilation = kotlin.jvm().compilations.getByName("main")
|
val mainCompilation = kotlin.jvm().compilations.getByName("main")
|
||||||
val runtimeDependencies = configurations.getByName(mainCompilation.runtimeDependencyConfigurationName)
|
val runtimeDependencies = configurations.getByName(mainCompilation.runtimeDependencyConfigurationName)
|
||||||
task.classpath(files(mainCompilation.output.allOutputs, runtimeDependencies))
|
task.classpath(files(mainCompilation.output.allOutputs, runtimeDependencies))
|
||||||
|
|||||||
Reference in New Issue
Block a user