forked from JetBrains/kotlin-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made benchmark application flexible to run separate benchmarks (JetBr…
- Loading branch information
LepilkinaElena
authored
Feb 13, 2019
1 parent
1a43a2a
commit c258bcf
Showing
58 changed files
with
770 additions
and
738 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license | ||
* that can be found in the license/LICENSE.txt file. | ||
*/ | ||
|
||
import groovy.lang.Closure | ||
import org.gradle.api.tasks.JavaExec | ||
import org.gradle.api.Task | ||
import org.gradle.api.tasks.TaskAction | ||
import org.gradle.api.tasks.options.Option | ||
import org.gradle.api.tasks.Input | ||
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget | ||
import javax.inject.Inject | ||
import java.io.File | ||
|
||
open class RunJvmTask: JavaExec() { | ||
var outputFileName: String? = null | ||
@Input | ||
@Option(option = "filter", description = "filter") | ||
var filter: String = "" | ||
|
||
override fun configure(configureClosure: Closure<Any>): Task { | ||
return super.configure(configureClosure) | ||
} | ||
|
||
private fun executeTask(output: java.io.OutputStream? = null) { | ||
val filterArgs = filter.split("\\s*,\\s*".toRegex()) | ||
.map{ if (it.isNotEmpty()) listOf("-f", it) else listOf(null) }.flatten().filterNotNull() | ||
args(filterArgs) | ||
exec() | ||
} | ||
|
||
@TaskAction | ||
fun run() { | ||
if (outputFileName != null) | ||
File(outputFileName).outputStream().use { output -> executeTask(output)} | ||
else | ||
executeTask() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.