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 errorMessage = buildString {
appendLine("Gradle build failed")
appendLine()
appendln("Gradle build failed")
appendln()
if (errors.any()) {
appendLine("Possible errors:")
errors.forEach { match -> appendLine(match.groupValues[1]) }
appendln("Possible errors:")
errors.forEach { match -> appendln(match.groupValues[1]) }
}
}
fail(errorMessage)
@@ -669,10 +669,10 @@ Finished executing task ':$taskName'|
}
val xmlString = buildString {
appendLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
appendLine("<results>")
appendln("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
appendln("<results>")
files.forEach {
appendLine(
appendln(
it.readText()
.trimTrailingWhitespaces()
.replace(projectDir.absolutePath, "/\$PROJECT_DIR$")
@@ -680,7 +680,7 @@ Finished executing task ':$taskName'|
.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n", "")
)
}
appendLine("</results>")
appendln("</results>")
}
val doc = SAXBuilder().build(xmlString.reader())
@@ -70,7 +70,7 @@ class KotlinGradleIT : BaseGradleIT() {
wd1.deleteRecursively()
if (wd1.exists()) {
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")
}
@@ -52,11 +52,11 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() {
// create Gradle Kotlin source sets for project roots:
val scriptCustomization = buildString {
appendLine()
appendLine("kotlin {\n sourceSets {")
appendln()
appendln("kotlin {\n sourceSets {")
sourceRoots.forEach { sourceRoot ->
if (sourceRoot.kotlinSourceSetName != "commonMain") {
appendLine(
appendln(
""" create("${sourceRoot.kotlinSourceSetName}") {
| dependsOn(getByName("commonMain"))
| listOf(${cliCompiler.targets.joinToString { "$it()" }}).forEach {
@@ -67,7 +67,7 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() {
""".trimMargin()
)
} 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 ->
sourceRoots.find { it.qualifiedName == dependency }?.let { depSourceRoot ->
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)
@@ -223,4 +223,4 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() {
@Parameterized.Parameter(2)
lateinit var sourceRoots: List<TestCaseSourceRoot>
}
}
@@ -39,7 +39,7 @@ fun runProcess(
if (options?.forceOutputToStdout ?: false) {
println(it)
}
sb.appendLine(it)
sb.appendln(it)
}
val exitCode = process.waitFor()
@@ -53,4 +53,4 @@ fun createGradleCommand(wrapperDir: File, tailParameters: List<String>): List<St
listOf("/bin/bash", "${wrapperDir.absolutePath}/gradlew") + tailParameters
}
val isWindows: Boolean = System.getProperty("os.name")!!.contains("Windows")
val isWindows: Boolean = System.getProperty("os.name")!!.contains("Windows")