Revert changes from 6e67e1e78d in Gradle integration tests

To fix the JPS build.
This commit is contained in:
Alexander Udalov
2020-06-11 17:26:07 +02:00
parent 5d827d9b5c
commit 01b6142500
4 changed files with 18 additions and 18 deletions
@@ -354,11 +354,11 @@ abstract class BaseGradleIT {
val errors = "(?m)^.*\\[ERROR] \\[\\S+] (.*)$".toRegex().findAll(output) val errors = "(?m)^.*\\[ERROR] \\[\\S+] (.*)$".toRegex().findAll(output)
val errorMessage = buildString { val errorMessage = buildString {
appendLine("Gradle build failed") appendln("Gradle build failed")
appendLine() appendln()
if (errors.any()) { if (errors.any()) {
appendLine("Possible errors:") appendln("Possible errors:")
errors.forEach { match -> appendLine(match.groupValues[1]) } errors.forEach { match -> appendln(match.groupValues[1]) }
} }
} }
fail(errorMessage) fail(errorMessage)
@@ -669,10 +669,10 @@ Finished executing task ':$taskName'|
} }
val xmlString = buildString { val xmlString = buildString {
appendLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>") appendln("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
appendLine("<results>") appendln("<results>")
files.forEach { files.forEach {
appendLine( appendln(
it.readText() it.readText()
.trimTrailingWhitespaces() .trimTrailingWhitespaces()
.replace(projectDir.absolutePath, "/\$PROJECT_DIR$") .replace(projectDir.absolutePath, "/\$PROJECT_DIR$")
@@ -680,7 +680,7 @@ Finished executing task ':$taskName'|
.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n", "") .replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n", "")
) )
} }
appendLine("</results>") appendln("</results>")
} }
val doc = SAXBuilder().build(xmlString.reader()) val doc = SAXBuilder().build(xmlString.reader())
@@ -70,7 +70,7 @@ class KotlinGradleIT : BaseGradleIT() {
wd1.deleteRecursively() wd1.deleteRecursively()
if (wd1.exists()) { if (wd1.exists()) {
val files = buildString { val files = buildString {
wd1.walk().forEach { appendLine(" " + it.relativeTo(wd1).path) } wd1.walk().forEach { appendln(" " + it.relativeTo(wd1).path) }
} }
error("Some files in $wd1 were not removed:\n$files") error("Some files in $wd1 were not removed:\n$files")
} }
@@ -52,11 +52,11 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() {
// create Gradle Kotlin source sets for project roots: // create Gradle Kotlin source sets for project roots:
val scriptCustomization = buildString { val scriptCustomization = buildString {
appendLine() appendln()
appendLine("kotlin {\n sourceSets {") appendln("kotlin {\n sourceSets {")
sourceRoots.forEach { sourceRoot -> sourceRoots.forEach { sourceRoot ->
if (sourceRoot.kotlinSourceSetName != "commonMain") { if (sourceRoot.kotlinSourceSetName != "commonMain") {
appendLine( appendln(
""" create("${sourceRoot.kotlinSourceSetName}") { """ create("${sourceRoot.kotlinSourceSetName}") {
| dependsOn(getByName("commonMain")) | dependsOn(getByName("commonMain"))
| listOf(${cliCompiler.targets.joinToString { "$it()" }}).forEach { | listOf(${cliCompiler.targets.joinToString { "$it()" }}).forEach {
@@ -67,7 +67,7 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() {
""".trimMargin() """.trimMargin()
) )
} else { } else {
appendLine(" // commonMain source set used for common module") appendln(" // commonMain source set used for common module")
} }
} }
@@ -76,11 +76,11 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() {
sourceRoot.dependencies.forEach { dependency -> sourceRoot.dependencies.forEach { dependency ->
sourceRoots.find { it.qualifiedName == dependency }?.let { depSourceRoot -> sourceRoots.find { it.qualifiedName == dependency }?.let { depSourceRoot ->
val depSourceSet = depSourceRoot.kotlinSourceSetName val depSourceSet = depSourceRoot.kotlinSourceSetName
appendLine(""" getByName("${sourceRoot.kotlinSourceSetName}").dependsOn(getByName("$depSourceSet"))""") appendln(""" getByName("${sourceRoot.kotlinSourceSetName}").dependsOn(getByName("$depSourceSet"))""")
} }
} }
} }
appendLine(" }\n}") appendln(" }\n}")
} }
gradleBuildScript().appendText("\n" + scriptCustomization) gradleBuildScript().appendText("\n" + scriptCustomization)
@@ -39,7 +39,7 @@ fun runProcess(
if (options?.forceOutputToStdout ?: false) { if (options?.forceOutputToStdout ?: false) {
println(it) println(it)
} }
sb.appendLine(it) sb.appendln(it)
} }
val exitCode = process.waitFor() val exitCode = process.waitFor()