[Gradle, MPP] Make init script for tests compatible w/ conf cache
Avoid using `beforeTask` API and switch to ones that are compatible with Gradle configuration cache.
This commit is contained in:
committed by
Alexander Likhachev
parent
df77cd303f
commit
4e5f6492d9
+16
-14
@@ -1,18 +1,20 @@
|
||||
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
|
||||
gradle.taskGraph.whenReady { taskGraph ->
|
||||
taskGraph.allTasks.each { 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
|
||||
}
|
||||
catch (all) {
|
||||
logger.error("", all)
|
||||
}
|
||||
return
|
||||
} else {
|
||||
taskSuperClass = taskSuperClass.superclass
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user