Fix running twice jvmTask for benchmarks (#4011)

This commit is contained in:
LepilkinaElena
2020-03-23 11:31:07 +03:00
committed by GitHub
parent fd56af92ac
commit bc5f144d2a
3 changed files with 4 additions and 7 deletions
@@ -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
@@ -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))