Move scripting configuration into compiler plugin

This commit is contained in:
Ilya Chernikov
2018-02-26 19:20:53 +01:00
parent 1514a113b8
commit d05f67127d
23 changed files with 452 additions and 168 deletions
@@ -100,20 +100,6 @@ class CompilerApiTest : KotlinIntegrationTestBase() {
}
}
fun testScriptResolverEnvironmentArgsParsing() {
fun args(body: K2JVMCompilerArguments.() -> Unit): K2JVMCompilerArguments =
K2JVMCompilerArguments().apply(body)
val longStr = (1..100).joinToString { """\" $it aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \\""" }
val unescapeRe = """\\(["\\])""".toRegex()
val messageCollector = TestMessageCollector()
Assert.assertEquals(hashMapOf("abc" to "def", "11" to "ab cd \\ \"", "long" to unescapeRe.replace(longStr, "\$1")),
K2JVMCompiler.createScriptResolverEnvironment(
args { scriptResolverEnvironment = arrayOf("abc=def", """11="ab cd \\ \""""", "long=\"$longStr\"") },
messageCollector))
}
fun testHelloAppLocal() {
val messageCollector = TestMessageCollector()
val jar = tmpdir.absolutePath + File.separator + "hello.jar"