Disable KotlinMppTestLogger for non test executions.

Issue #KT-36716 Fixed
This commit is contained in:
Konstantin Tskhovrebov
2020-03-02 13:40:56 +03:00
parent 35055d1895
commit 60d592716d
5 changed files with 283 additions and 19 deletions
@@ -84,23 +84,4 @@ class KotlinMppTestLogger {
t.printStackTrace(new PrintWriter(sw))
sw.toString()
}
}
gradle.taskGraph.beforeTask { task ->
def taskSuperClass = task.class
while (taskSuperClass != Object.class) {
if (taskSuperClass.canonicalName == "org.jetbrains.kotlin.gradle.tasks.KotlinTest") {
try {
KotlinMppTestLogger.logTestReportLocation(task.reports?.html?.entryPoint?.path)
KotlinMppTestLogger.configureTestEventLogging(task)
task.testLogging.showStandardStreams = false
}
catch (all) {
logger.error("", all)
}
return
} else {
taskSuperClass = taskSuperClass.superclass
}
}
}
@@ -0,0 +1,18 @@
gradle.taskGraph.beforeTask { task ->
def taskSuperClass = task.class
while (taskSuperClass != Object.class) {
if (taskSuperClass.canonicalName == "org.jetbrains.kotlin.gradle.tasks.KotlinTest") {
try {
KotlinMppTestLogger.logTestReportLocation(task.reports?.html?.entryPoint?.path)
KotlinMppTestLogger.configureTestEventLogging(task)
task.testLogging.showStandardStreams = false
}
catch (all) {
logger.error("", all)
}
return
} else {
taskSuperClass = taskSuperClass.superclass
}
}
}