Replace appendln with appendLine in project

This commit is contained in:
Alexander Udalov
2020-06-09 21:09:45 +02:00
parent d1c88798df
commit 6e67e1e78d
76 changed files with 405 additions and 402 deletions
@@ -169,29 +169,29 @@ fun KaptOptions.collectJavaSourceFiles(sourcesToReprocess: SourcesToReprocess =
fun KaptOptions.logString(additionalInfo: String = "") = buildString {
val additionalInfoRendered = if (additionalInfo.isEmpty()) "" else " ($additionalInfo)"
appendln("Kapt3 is enabled$additionalInfoRendered.")
appendLine("Kapt3 is enabled$additionalInfoRendered.")
appendln("Annotation processing mode: ${mode.stringValue}")
appendln("Memory leak detection mode: ${detectMemoryLeaks.stringValue}")
KaptFlag.values().forEach { appendln(it.description + ": " + this@logString[it]) }
appendLine("Annotation processing mode: ${mode.stringValue}")
appendLine("Memory leak detection mode: ${detectMemoryLeaks.stringValue}")
KaptFlag.values().forEach { appendLine(it.description + ": " + this@logString[it]) }
appendln("Project base dir: $projectBaseDir")
appendln("Compile classpath: " + compileClasspath.joinToString())
appendln("Java source roots: " + javaSourceRoots.joinToString())
appendLine("Project base dir: $projectBaseDir")
appendLine("Compile classpath: " + compileClasspath.joinToString())
appendLine("Java source roots: " + javaSourceRoots.joinToString())
appendln("Sources output directory: $sourcesOutputDir")
appendln("Class files output directory: $classesOutputDir")
appendln("Stubs output directory: $stubsOutputDir")
appendln("Incremental data output directory: $incrementalDataOutputDir")
appendLine("Sources output directory: $sourcesOutputDir")
appendLine("Class files output directory: $classesOutputDir")
appendLine("Stubs output directory: $stubsOutputDir")
appendLine("Incremental data output directory: $incrementalDataOutputDir")
appendln("Annotation processing classpath: " + processingClasspath.joinToString())
appendln("Annotation processors: " + processors.joinToString())
appendLine("Annotation processing classpath: " + processingClasspath.joinToString())
appendLine("Annotation processors: " + processors.joinToString())
appendln("AP options: $processingOptions")
appendln("Javac options: $javacOptions")
appendLine("AP options: $processingOptions")
appendLine("Javac options: $javacOptions")
appendln("[incremental apt] Changed files: $changedFiles")
appendln("[incremental apt] Compiled sources directories: ${compiledSources.joinToString()}")
appendln("[incremental apt] Cache directory for incremental compilation: $incrementalCache")
appendln("[incremental apt] Changed classpath names: ${classpathChanges.joinToString()}")
appendLine("[incremental apt] Changed files: $changedFiles")
appendLine("[incremental apt] Compiled sources directories: ${compiledSources.joinToString()}")
appendLine("[incremental apt] Cache directory for incremental compilation: $incrementalCache")
appendLine("[incremental apt] Changed classpath names: ${classpathChanges.joinToString()}")
}
@@ -96,8 +96,8 @@ abstract class AbstractKaptToolIntegrationTest : TestCaseWithTmpdir() {
if (!process.waitFor(2, TimeUnit.MINUTES)) err("Process is still alive")
if (process.exitValue() != 0) {
throw GotResult(buildString {
append("Return code: ").appendln(process.exitValue()).appendln()
appendln(outputFile.readText())
append("Return code: ").appendLine(process.exitValue()).appendLine()
appendLine(outputFile.readText())
})
}
}
@@ -117,6 +117,6 @@ private val Section.args get() = readArgumentsFromArgFile(preprocessPathSeparato
private fun preprocessPathSeparators(text: String): String = buildString {
for (line in text.lineSequence()) {
val transformed = if (line.startsWith("-cp ")) line.replace(':', File.pathSeparatorChar) else line
appendln(transformed)
appendLine(transformed)
}
}
@@ -33,7 +33,7 @@ class Section(val name: String, val content: String) {
saveCurrent()
currentName = line.drop(2)
} else {
currentContent.appendln(line)
currentContent.appendLine(line)
}
}
@@ -45,8 +45,8 @@ class Section(val name: String, val content: String) {
fun List<Section>.render(): String = buildString {
for (section in this@render) {
append(SECTION_INDICATOR).appendln(section.name)
appendln(section.content).appendln()
append(SECTION_INDICATOR).appendLine(section.name)
appendLine(section.content).appendLine()
}
}.trim()
@@ -240,8 +240,8 @@ abstract class AbstractKapt3Extension(
for (leak in leaks) {
logger.warn(buildString {
appendln("Memory leak detected!")
appendln("Location: '${leak.className}', static field '${leak.fieldName}'")
appendLine("Memory leak detected!")
appendLine("Location: '${leak.className}', static field '${leak.fieldName}'")
append(leak.description)
})
}
@@ -42,9 +42,9 @@ class KotlinUSwitchExpression(
override fun asRenderString() = buildString {
val expr = expression?.let { "(" + it.asRenderString() + ") " } ?: ""
appendln("switch $expr {")
appendln(body.asRenderString())
appendln("}")
appendLine("switch $expr {")
appendLine(body.asRenderString())
appendLine("}")
}
override val switchIdentifier: UIdentifier
@@ -62,9 +62,9 @@ class KotlinUSwitchEntry(
override val body: UExpressionList by lz {
object : KotlinUExpressionList(sourcePsi, KotlinSpecialExpressionKinds.WHEN_ENTRY, this@KotlinUSwitchEntry) {
override fun asRenderString() = buildString {
appendln("{")
expressions.forEach { appendln(it.asRenderString().withMargin) }
appendln("}")
appendLine("{")
expressions.forEach { appendLine(it.asRenderString().withMargin) }
appendLine("}")
}
}.apply KotlinUExpressionList@{
val exprPsi = this@KotlinUSwitchEntry.sourcePsi.expression
@@ -43,7 +43,7 @@ class AlternativesRenderLogTest : AbstractKotlinUastTest() {
builder.append(" ".repeat(level))
builder.append("[${uElement.size}]:")
builder.append(uElement.joinToString(", ", "[", "]") { it.asLogString() })
builder.appendln()
builder.appendLine()
}
if (uElement.any()) level++
element.acceptChildren(this)
@@ -37,7 +37,7 @@ class MultiplesRequiredTypesTest : AbstractKotlinUastTest() {
if (uElement != null) {
builder.append(" ".repeat(level))
builder.append(uElement.asLogString())
builder.appendln()
builder.appendLine()
}
if (uElement != null) level++
element.acceptChildren(this)
@@ -23,7 +23,7 @@ abstract class IndentedPrintingVisitor(val shouldIndent: (PsiElement) -> Boolean
if (charSequence != null) {
builder.append(" ".repeat(level))
builder.append(charSequence)
builder.appendln()
builder.appendLine()
}
val shouldIndent = shouldIndent(element)
@@ -47,7 +47,7 @@ interface TypesTestBase {
val value = node.getExpressionType()
value?.let { builder.append(" : ").append(it) }
}
builder.appendln()
builder.appendLine()
level++
return false
}
@@ -54,7 +54,7 @@ interface ValuesTestBase {
val value = evaluationContext.valueOf(node)
builder.append(" = ").append(value)
}
builder.appendln()
builder.appendLine()
level++
return false
}