Adjust task output detection for Gradle 4.9
This commit is contained in:
+13
-5
@@ -4,6 +4,7 @@ import com.intellij.testFramework.TestDataFile
|
||||
import org.gradle.api.logging.LogLevel
|
||||
import org.gradle.tooling.GradleConnector
|
||||
import org.gradle.util.GradleVersion
|
||||
import org.intellij.lang.annotations.Language
|
||||
import org.jdom.Element
|
||||
import org.jdom.input.SAXBuilder
|
||||
import org.jdom.output.Format
|
||||
@@ -537,11 +538,18 @@ abstract class BaseGradleIT {
|
||||
}
|
||||
|
||||
fun CompiledProject.getOutputForTask(taskName: String): String {
|
||||
val taskOutputRegex = ("(?:\\[LIFECYCLE] \\[class org\\.gradle(?:\\.internal\\.buildevents)?\\.TaskExecutionLogger] :$taskName|" +
|
||||
"\\[org\\.gradle\\.execution\\.plan\\.DefaultPlanExecutor\\] :$taskName.*?started)" +
|
||||
"([\\s\\S]+?)" +
|
||||
"(?:Finished executing task ':$taskName'|" +
|
||||
"\\[org\\.gradle\\.execution\\.plan\\.DefaultPlanExecutor\\] :$taskName.*?completed)").toRegex()
|
||||
@Language("RegExp")
|
||||
val taskOutputRegex = """
|
||||
(?:
|
||||
\[LIFECYCLE] \[class org\.gradle(?:\.internal\.buildevents)?\.TaskExecutionLogger] :$taskName|
|
||||
\[org\.gradle\.execution\.(?:plan|taskgraph)\.Default(?:Task)?PlanExecutor] :$taskName.*?started
|
||||
)
|
||||
([\s\S]+?)
|
||||
(?:
|
||||
Finished executing task ':$taskName'|
|
||||
\[org\.gradle\.execution\.(?:plan|taskgraph)\.Default(?:Task)?PlanExecutor] :$taskName.*?completed
|
||||
)
|
||||
""".trimIndent().replace("\n", "").toRegex()
|
||||
|
||||
return taskOutputRegex.find(output)?.run { groupValues[1] } ?: error("Cannot find output for task $taskName")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user