Skip to content

Commit

Permalink
Upgrade to Kotlin 2.1.20-RC
Browse files Browse the repository at this point in the history
Use the new application plugin replacement.
  • Loading branch information
JakeWharton committed Feb 24, 2025
1 parent 7b5b477 commit 9caf891
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 31 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
jetbrains-compose = "1.7.3"
kotlin = "2.1.10"
kotlin = "2.1.20-RC"
kotlinx-coroutines = "1.10.1"

[libraries]
Expand Down
19 changes: 8 additions & 11 deletions samples/counter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
apply plugin: 'org.jetbrains.kotlin.multiplatform'
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
apply from: "$rootDir/addAllTargets.gradle"
apply plugin: 'application'

application {
mainClass = 'example.Main'
}

kotlin {
sourceSets {
Expand All @@ -28,6 +23,14 @@ kotlin {
}
}

jvm {
binaries {
executable {
mainClass = 'example.Main'
}
}
}

targets.withType(KotlinNativeTarget).configureEach { target ->
target.binaries.executable {
entryPoint = 'example.main'
Expand All @@ -38,10 +41,4 @@ kotlin {
}
}
}

//noinspection ConfigurationAvoidance Cannot mutate this after buildscript evaluation.
targets.withType(KotlinJvmTarget) {
// Needed for 'application' plugin.
withJava()
}
}
19 changes: 8 additions & 11 deletions samples/robot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
apply plugin: 'org.jetbrains.kotlin.multiplatform'
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
apply from: "$rootDir/addAllTargets.gradle"
apply plugin: 'application'

application {
mainClass = 'example.RobotKt'
}

kotlin {
sourceSets {
Expand All @@ -20,6 +15,14 @@ kotlin {
}
}

jvm {
binaries {
executable {
mainClass = 'example.RobotKt'
}
}
}

targets.withType(KotlinNativeTarget).configureEach { target ->
target.binaries.executable {
entryPoint = 'example.main'
Expand All @@ -30,10 +33,4 @@ kotlin {
}
}
}

//noinspection ConfigurationAvoidance Cannot mutate this after buildscript evaluation.
targets.withType(KotlinJvmTarget) {
// Needed for 'application' plugin.
withJava()
}
}
16 changes: 8 additions & 8 deletions tools/raw-mode-echo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType

apply plugin: 'org.jetbrains.kotlin.multiplatform'
apply from: "$rootDir/addAllTargets.gradle"
apply plugin: 'application'

application {
mainClass = 'example.Main'
}

kotlin {
// Needed for 'application' plugin.
jvm().withJava()

sourceSets {
commonMain {
dependencies {
Expand All @@ -23,6 +15,14 @@ kotlin {
}
}

jvm {
binaries {
executable {
mainClass = 'example.Main'
}
}
}

targets.withType(KotlinNativeTarget).configureEach { target ->
target.binaries.executable {
entryPoint = 'example.main'
Expand Down

0 comments on commit 9caf891

Please sign in to comment.