1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

upgrade to kotlinc 1.1.51

This commit is contained in:
Juan Liska 2017-11-02 17:26:29 -06:00
parent 86e39cbb58
commit 629949edd4
2 changed files with 11 additions and 9 deletions

View file

@ -32,7 +32,7 @@ object Versions {
val maven = "3.3.9" val maven = "3.3.9"
val mavenResolver = "1.0.3" val mavenResolver = "1.0.3"
val slf4j = "1.7.3" val slf4j = "1.7.3"
val kotlin = "1.1.2" val kotlin = "1.1.51"
val aether = "1.0.2.v20150114" val aether = "1.0.2.v20150114"
val testng = "6.11" val testng = "6.11"

View file

@ -8,10 +8,12 @@ import com.beust.kobalt.maven.dependency.FileDependency
import com.beust.kobalt.misc.* import com.beust.kobalt.misc.*
import org.jetbrains.kotlin.cli.common.ExitCode import org.jetbrains.kotlin.cli.common.ExitCode
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
import org.jetbrains.kotlin.cli.common.arguments.parseCommandLineArguments
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.cli.common.messages.MessageCollector import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.config.Services import org.jetbrains.kotlin.config.Services
import org.jetbrains.kotlin.incremental.ICReporter import org.jetbrains.kotlin.incremental.ICReporter
import org.jetbrains.kotlin.incremental.makeIncrementally import org.jetbrains.kotlin.incremental.makeIncrementally
@ -148,14 +150,14 @@ class KotlinCompiler @Inject constructor(
(settings.kobaltCompilerFlags?.split(" ") ?: listOf<String>()) (settings.kobaltCompilerFlags?.split(" ") ?: listOf<String>())
val args = K2JVMCompilerArguments() val args = K2JVMCompilerArguments()
val compiler = K2JVMCompiler() val compiler = K2JVMCompiler()
compiler.parseArguments(args2.toTypedArray(), args) parseCommandLineArguments(args2, args)
// Override important arguments with our values // Override important arguments with our values
args.apply { args.apply {
moduleName = projectName moduleName = projectName
destination = outputDir destination = outputDir
classpath = classpathString classpath = classpathString
freeArgs = sourceFiles freeArgs = sourceFiles.toMutableList()
friendPaths = friends friendPaths = friends
} }
@ -179,9 +181,9 @@ class KotlinCompiler @Inject constructor(
"single-module" -> args.singleModule = true "single-module" -> args.singleModule = true
"load-builtins-from-dependencies" -> args.loadBuiltInsFromDependencies = true "load-builtins-from-dependencies" -> args.loadBuiltInsFromDependencies = true
"coroutines=enable" -> args.coroutinesEnable = true "coroutines=enable" -> args.coroutinesState = LanguageFeature.State.ENABLED.name
"coroutines=warn" -> args.coroutinesWarn = true "coroutines=warn" -> args.coroutinesState = LanguageFeature.State.ENABLED_WITH_WARNING.name
"coroutines=error" -> args.coroutinesError = true "coroutines=error" -> args.coroutinesState = LanguageFeature.State.ENABLED_WITH_ERROR.name
"no-inline" -> args.noInline = true "no-inline" -> args.noInline = true
"multi-platform" -> args.multiPlatform = true "multi-platform" -> args.multiPlatform = true
"no-check-impl" -> args.noCheckImpl = true "no-check-impl" -> args.noCheckImpl = true
@ -214,7 +216,7 @@ class KotlinCompiler @Inject constructor(
+ " " + sourceFiles.joinToString(" ")) + " " + sourceFiles.joinToString(" "))
logk(2, " Additional kotlinc arguments: " logk(2, " Additional kotlinc arguments: "
+ " -moduleName " + args.moduleName + " -moduleName " + args.moduleName
+ " -friendPaths " + args.friendPaths.joinToString(";")) + " -friendPaths " + args.friendPaths?.joinToString(";"))
val collector = object : MessageCollector { val collector = object : MessageCollector {
override fun clear() { override fun clear() {
throw UnsupportedOperationException("not implemented") throw UnsupportedOperationException("not implemented")
@ -233,8 +235,8 @@ class KotlinCompiler @Inject constructor(
s s
} }
override fun report(severity: CompilerMessageSeverity, override fun report(severity: CompilerMessageSeverity, message: String,
message: String, location: CompilerMessageLocation) { location: CompilerMessageLocation?) {
if (severity.isError) { if (severity.isError) {
"Couldn't compile file: ${dump(location, message)}".let { fullMessage -> "Couldn't compile file: ${dump(location, message)}".let { fullMessage ->
throw KobaltException(fullMessage) throw KobaltException(fullMessage)