From 42963f1601b373207393df86bb5141c369a0d7fe Mon Sep 17 00:00:00 2001 From: Elena Lepilkina Date: Tue, 19 Feb 2019 11:55:45 +0300 Subject: [PATCH] Split didn't work rigth for files with spaces in names. Change to array of arguments. --- .../buildSrc/src/main/kotlin/RegressionsReporter.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/performance/buildSrc/src/main/kotlin/RegressionsReporter.kt b/performance/buildSrc/src/main/kotlin/RegressionsReporter.kt index 0dc70e6c7c6..0356f0f90e8 100644 --- a/performance/buildSrc/src/main/kotlin/RegressionsReporter.kt +++ b/performance/buildSrc/src/main/kotlin/RegressionsReporter.kt @@ -25,11 +25,11 @@ import java.util.Base64 import java.util.Properties // Run command line from string. -fun String.runCommand(workingDir: File = File("."), +fun Array.runCommand(workingDir: File = File("."), timeoutAmount: Long = 60, timeoutUnit: TimeUnit = TimeUnit.SECONDS): String { return try { - ProcessBuilder(*this.split("\\s".toRegex()).toTypedArray()) + ProcessBuilder(*this) .directory(workingDir) .redirectOutput(ProcessBuilder.Redirect.PIPE) .redirectError(ProcessBuilder.Redirect.PIPE) @@ -211,7 +211,7 @@ open class RegressionsReporter : DefaultTask() { val target = System.getProperty("os.name").replace("\\s".toRegex(), "") // Generate comparison report. - val output = "$analyzer -r html $currentBenchmarksReportFile bintray:$compareToBuildNumber:$target:$bintrayFileName -o $htmlReport" + val output = arrayOf("$analyzer", "-r", "html", "$currentBenchmarksReportFile", "bintray:$compareToBuildNumber:$target:$bintrayFileName", "-o", "$htmlReport") .runCommand() if (output.contains("Uncaught exception")) { @@ -219,7 +219,7 @@ open class RegressionsReporter : DefaultTask() { "bintray:$compareToBuildNumber:$target:$bintrayFileName with $analyzer! " + "Please check files existance and their correctness.") } - "$analyzer -r statistics $currentBenchmarksReportFile bintray:$compareToBuildNumber:$target:$bintrayFileName -o \"$summaryFile\"" + arrayOf("$analyzer", "-r", "statistics", "$currentBenchmarksReportFile", "bintray:$compareToBuildNumber:$target:$bintrayFileName", "-o", "$summaryFile") .runCommand() val reportLink = "http://kotlin-native-performance.labs.jb.gg/?" +