From 0d661b126fa029f52036fb3841096a6e3d080cbb Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Thu, 9 Feb 2017 10:46:58 -0800 Subject: [PATCH] Better separate kotlinc flag management. --- .../com/beust/kobalt/plugin/kotlin/KotlinCompiler.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinCompiler.kt b/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinCompiler.kt index f309d4ce..8c9418f9 100644 --- a/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinCompiler.kt +++ b/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinCompiler.kt @@ -93,9 +93,12 @@ class KotlinCompiler @Inject constructor( val compilerClasspath = compilerDep.jarFile.get().path + File.pathSeparator + compilerEmbeddableDependencies(null).map { it.jarFile.get().path } .joinToString(File.pathSeparator) - val xFlagsString = kotlinConfig(project)?.args?.joinToString(" ") - ?: settings.kobaltCompilerFlags - val xFlagsArray = xFlagsString?.split(" ")?.toTypedArray() ?: emptyArray() + val xFlagsString = listOf(kotlinConfig(project)?.args?.joinToString(" "), + settings.kobaltCompilerFlags) + .filterNotNull() + .joinToString(" ") + + val xFlagsArray = xFlagsString.split(" ").toTypedArray() ?: emptyArray() val newArgs = listOf( "-classpath", compilerClasspath, K2JVMCompiler::class.java.name,