Skip to content

Commit

Permalink
Upgraded Kotlin to 2.0.0 (#428)
Browse files Browse the repository at this point in the history
* Upgraded Kotlin to 2.0.0
* Using JVM target for all "compile Kotlin" tasks
* Added note in build.gradle.kts concerning compiler argument
  • Loading branch information
severn-everett authored Jun 4, 2024
1 parent 1073960 commit 69c09ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
### Gradle template
.gradle
build/

.kotlin
# Ignore Gradle GUI config
gradle-app.setting

Expand Down
19 changes: 8 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("multiplatform") version "1.9.23"
kotlin("multiplatform") version "2.0.0"
// This version is dependent on the maximum tested version
// of this plugin within the Kotlin multiplatform library
id("com.android.library") version "8.3.2"
Expand All @@ -27,13 +27,14 @@ group = "io.github.oshai"
version = "6.0.10"

repositories {
gradlePluginPortal()
google()
mavenCentral()
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = JvmTarget.JVM_1_8.target
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}

kotlin {
Expand All @@ -42,19 +43,15 @@ kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
// kotlin compiler compatibility options
apiVersion.set(KotlinVersion.KOTLIN_1_9)
languageVersion.set(KotlinVersion.KOTLIN_1_9)
apiVersion.set(KotlinVersion.KOTLIN_2_0)
languageVersion.set(KotlinVersion.KOTLIN_2_0)

// Required to silence compiler warnings about the beta status of
// expected and actual classes. See https://kotlinlang.org/docs/multiplatform-expect-actual.html#expected-and-actual-classes
freeCompilerArgs.add("-Xexpect-actual-classes")
}

jvm {
compilations.all {
// kotlin compiler compatibility options
kotlinOptions {
jvmTarget = "1.8"
}
}
}
js {
browser {
Expand Down

0 comments on commit 69c09ac

Please sign in to comment.