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