From 2bcb9ad885e074b5e84493942b9cbc76176614a9 Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Wed, 29 Jul 2020 12:11:53 +0200 Subject: [PATCH] Build change: don't fail when error output has only one line --- build.gradle | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 186c5960..04c0ca47 100644 --- a/build.gradle +++ b/build.gradle @@ -7,6 +7,7 @@ buildscript { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } + def printOutput(def output) { return tasks.create("printOutput") { for (line in output.toString().readLines()) { @@ -14,6 +15,7 @@ def printOutput(def output) { } } } + allprojects { apply plugin: 'java' apply plugin: 'kotlin' @@ -92,9 +94,11 @@ sourceSets { } } } + static def isTaskDir(File dir) { return new File(dir, "src").exists() } + mainClassName = project.hasProperty("mainClass") ? project.getProperty("mainClass") : "" test { outputs.upToDateWhen { false } @@ -103,11 +107,13 @@ test { def message = result.exception?.message ?: "Wrong answer" def lines = message.readLines() println "#educational_plugin FAILED + " + lines[0] - lines[1..-1].forEach { line -> - println "#educational_plugin" + line + if (lines.size() > 1) { + lines[1..-1].forEach { line -> + println "#educational_plugin" + line + } } // we need this to separate output of different tests - println + println "" } } }