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

Merge pull request #455 from pabl0rg/upgrade-to-kotlinc-1-1-51

upgrade to kotlinc 1.1.51
This commit is contained in:
Erik C. Thauvin 2017-11-02 17:26:42 -07:00 committed by GitHub
commit 82b89edaee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 10 deletions

View file

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

View file

@ -9,7 +9,7 @@ object Constants {
val BUILD_FILE_NAME = "Build.kt"
val BUILD_FILE_DIRECTORY = "kobalt/src"
val BUILD_FILE_PATH = KFiles.joinDir(BUILD_FILE_DIRECTORY, BUILD_FILE_NAME)
val KOTLIN_COMPILER_VERSION = "1.1.2"
val KOTLIN_COMPILER_VERSION = "1.1.51"
internal val DEFAULT_REPOS = listOf<HostConfig>(
// "https://maven-central.storage.googleapis.com/",

View file

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