Skip to content

Commit

Permalink
Update Kotlin versions and language settings
Browse files Browse the repository at this point in the history
- Update Kotlin JVM plugin version to use the latest version
- Set Kotlin language version to 2.0 for all source sets
- Set JVM target to 17 for all Kotlin compile tasks
- Add compiler arguments for experimental APIs and opt-ins
- Configure test tasks to use JUnit Platform
- Update Kotlin JVM plugin version in the root `build.gradle.kts` file
- Set Kotlin language version to 2.0 in the root `build.gradle.kts` file

Ignores changes to imports and requires.
  • Loading branch information
IRus committed Nov 9, 2023
1 parent 783d479 commit 3c6a63f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
10 changes: 9 additions & 1 deletion app-backend-jooq/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
plugins {
kotlin("jvm").version("1.9.0")
kotlin("jvm")
}

kotlin {
sourceSets.all {
languageSettings {
languageVersion = "2.0"
}
}
}

repositories {
Expand Down
19 changes: 16 additions & 3 deletions app-backend/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
application
kotlin("jvm").version("1.9.0")
kotlin("plugin.serialization").version("1.9.0")
kotlin("jvm")
kotlin("plugin.serialization")
}

application {
Expand All @@ -14,15 +14,28 @@ repositories {
}

kotlin {
jvmToolchain(17)
sourceSets.all {
languageSettings {
languageVersion = "2.0"
}
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "17"
freeCompilerArgs = freeCompilerArgs + listOf(
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
"-opt-in=io.ktor.server.locations.KtorExperimentalLocationsAPI",
)
}
}

tasks.test {
useJUnitPlatform()
}

dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
Expand Down
7 changes: 6 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
application
kotlin("jvm").version("1.9.0")
kotlin("jvm").version("1.9.20")
}

application {
Expand All @@ -17,6 +17,11 @@ tasks.test {

kotlin {
jvmToolchain(17)
sourceSets.all {
languageSettings {
languageVersion = "2.0"
}
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
Expand Down

0 comments on commit 3c6a63f

Please # to comment.