Kapt: Add tests for the command-line 'kapt' tool

This commit is contained in:
Yan Zhulanow
2018-10-31 12:08:28 +09:00
parent 6e5eb0fdd4
commit 69ec958aab
36 changed files with 852 additions and 1 deletions
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.cli.common.arguments
import org.jetbrains.annotations.TestOnly
import java.io.File
import java.io.FileNotFoundException
import java.io.IOException
@@ -35,6 +36,12 @@ fun preprocessCommandLineArguments(args: List<String>, errors: ArgumentParseErro
}
}
@TestOnly
fun readArgumentsFromArgFile(content: String): List<String> {
val reader = content.reader()
return generateSequence { reader.parseNextArgument() }.toList()
}
private fun File.expand(errors: ArgumentParseErrors): List<String> {
return try {
bufferedReader(Charsets.UTF_8).use {