Skip to content

Commit

Permalink
Upgraded Kotlin to 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
severn-everett committed May 23, 2024
1 parent 1073960 commit 5a943c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 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
23 changes: 9 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
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 +26,11 @@ group = "io.github.oshai"
version = "6.0.10"

repositories {
// FIXME: This repository needs to be declared first, otherwise Gradle can't find the
// Kotlin-JS dependency. This might be an issue of support for Kotlin 2 in Gradle.
mavenCentral()
gradlePluginPortal()
google()
mavenCentral()
}

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

kotlin {
Expand All @@ -42,18 +39,16 @@ 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)

freeCompilerArgs.add("-Xexpect-actual-classes")
}

jvm {
compilations.all {
// kotlin compiler compatibility options
kotlinOptions {
jvmTarget = "1.8"
}
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}
js {
Expand Down

0 comments on commit 5a943c3

Please sign in to comment.