Skip to content

Commit 574a254

Browse files
committed
Add language_version option
1 parent 110b523 commit 574a254

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

composeApp/build.gradle.kts

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
22
import org.jetbrains.compose.ExperimentalComposeLibrary
33
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
4+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion.Companion.fromVersion
45
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
56
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
67
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
@@ -12,6 +13,8 @@ plugins {
1213
kotlin("plugin.compose")
1314
}
1415

16+
val language_version: String? = project.properties["language_version"] as String?
17+
1518
kotlin {
1619
androidTarget {
1720
compilations.all {
@@ -51,6 +54,13 @@ kotlin {
5154
}
5255
}
5356
binaries.executable()
57+
compilations.configureEach {
58+
compileTaskProvider.configure {
59+
language_version?.let {
60+
compilerOptions.languageVersion.set(fromVersion(it))
61+
}
62+
}
63+
}
5464
}
5565

5666
sourceSets {

0 commit comments

Comments
 (0)