Upgraded Kotlin from 1.5.21 to 1.5.30. Also upgraded kotlinx.coroutines and kotlin logging. Now using languageSettings.optIn everywhere instead of compiler options.

This commit is contained in:
Daan Vanden Bosch 2021-09-06 14:17:20 +02:00
parent 7cdeb1b816
commit 19d3030d20
11 changed files with 37 additions and 17 deletions

View File

@ -7,6 +7,6 @@ repositories {
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21")
implementation("org.jetbrains.kotlin:kotlin-serialization:1.5.21")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30")
implementation("org.jetbrains.kotlin:kotlin-serialization:1.5.30")
}

View File

@ -6,6 +6,3 @@ val EXPERIMENTAL_ANNOTATIONS: List<String> = listOf(
"kotlin.contracts.ExperimentalContracts",
"kotlin.time.ExperimentalTime",
)
val EXPERIMENTAL_ANNOTATION_COMPILER_ARGS: List<String> =
EXPERIMENTAL_ANNOTATIONS.map { "-Xopt-in=$it" }

View File

@ -8,9 +8,9 @@ repositories {
mavenCentral()
}
project.extra["coroutinesVersion"] = "1.5.1"
project.extra["coroutinesVersion"] = "1.5.2"
project.extra["junitVersion"] = "5.7.1"
project.extra["kotlinLoggingVersion"] = "2.0.6"
project.extra["kotlinLoggingVersion"] = "2.0.11"
project.extra["ktorVersion"] = "1.6.1"
project.extra["log4jVersion"] = "2.14.1"
project.extra["serializationVersion"] = "1.2.2"

View File

@ -8,10 +8,8 @@ plugins {
kotlin {
js {
compilations.all {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + EXPERIMENTAL_ANNOTATION_COMPILER_ARGS
}
compilations.configureEach {
EXPERIMENTAL_ANNOTATIONS.forEach(languageSettings::optIn)
}
browser {
testTask {

View File

@ -10,12 +10,16 @@ plugins {
val junitVersion: String by project.extra
val log4jVersion: String by project.extra
kotlin {
sourceSets.configureEach {
EXPERIMENTAL_ANNOTATIONS.forEach(languageSettings::optIn)
}
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = freeCompilerArgs +
EXPERIMENTAL_ANNOTATION_COMPILER_ARGS +
"-Xjvm-default=all"
freeCompilerArgs = freeCompilerArgs + "-Xjvm-default=all"
}
}

View File

@ -23,16 +23,17 @@ kotlin {
}
jvm {
compilations.all {
compilations.configureEach {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = freeCompilerArgs + "-Xjvm-default=all"
}
}
}
sourceSets {
all {
EXPERIMENTAL_ANNOTATIONS.forEach(languageSettings::useExperimentalAnnotation)
configureEach {
EXPERIMENTAL_ANNOTATIONS.forEach(languageSettings::optIn)
}
commonMain {

View File

@ -21,6 +21,10 @@ val serializationVersion: String by project.extra
kotlin {
sourceSets {
all {
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
}
commonMain {
kotlin.setSrcDirs(kotlin.srcDirs + generatedCommonSrc)
dependencies {

View File

@ -4,6 +4,10 @@ plugins {
kotlin {
js {
compilations.configureEach {
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
}
binaries.executable()
}
}

View File

@ -2,6 +2,12 @@ plugins {
id("world.phantasmal.jvm")
}
kotlin {
sourceSets.configureEach {
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
}
}
dependencies {
implementation(project(":psolib"))
implementation(project(":web:shared"))

View File

@ -5,6 +5,9 @@ plugins {
kotlin {
js {
compilations.configureEach {
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
}
browser {
commonWebpackConfig {
cssSupport.enabled = true

View File

@ -7,6 +7,9 @@ val serializationVersion: String by project.extra
kotlin {
sourceSets {
configureEach {
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
}
commonMain {
dependencies {
api(project(":psolib"))