55import org.gradle.kotlin.dsl.*
66import org.jetbrains.kotlin.gradle.*
77import org.jetbrains.kotlin.gradle.dsl.*
8- import org.jetbrains.kotlin.gradle.tasks.*
98
109plugins {
1110 kotlin(" multiplatform" )
@@ -20,11 +19,24 @@ internal fun Project.versionCatalog(): VersionCatalog = versionCatalogs.named("l
2019kotlin {
2120 explicitApi()
2221
22+ compilerOptions {
23+ progressiveMode = true
24+ optIn.addAll(
25+ listOf (
26+ " kotlin.ExperimentalMultiplatform" ,
27+ " kotlin.ExperimentalSubclassOptIn" ,
28+ " kotlinx.serialization.InternalSerializationApi" ,
29+ " kotlinx.serialization.SealedSerializationApi" ,
30+ )
31+ )
32+ defaultOptions()
33+ languageVersion(overriddenLanguageVersion)
34+ freeCompilerArgs.add(" -Xexpect-actual-classes" )
35+ }
36+
2337 jvm {
24- @OptIn(ExperimentalKotlinGradlePluginApi ::class )
2538 compilerOptions {
26- jvmTarget = JvmTarget .JVM_1_8
27- freeCompilerArgs.addAll(" -Xjdk-release=1.8" )
39+ setJava8Compatible()
2840 }
2941 }
3042 jvmToolchain(jdkToolchainVersion)
@@ -38,7 +50,6 @@ kotlin {
3850 }
3951 }
4052
41- @OptIn(ExperimentalKotlinGradlePluginApi ::class )
4253 compilerOptions {
4354 sourceMap = true
4455 moduleKind = JsModuleKind .MODULE_UMD
@@ -60,26 +71,6 @@ kotlin {
6071 resources.srcDirs(" $name /resources" )
6172 }
6273
63- compilerOptions {
64- // These configuration replaces 'languageSettings' config on line 67
65- progressiveMode.set(true )
66- optIn.addAll(
67- listOf (
68- " kotlin.ExperimentalMultiplatform" ,
69- " kotlin.ExperimentalSubclassOptIn" ,
70- " kotlinx.serialization.InternalSerializationApi" ,
71- " kotlinx.serialization.SealedSerializationApi" ,
72- )
73- )
74- if (overriddenLanguageVersion != null ) {
75- languageVersion = KotlinVersion .fromVersion(overriddenLanguageVersion!! )
76- freeCompilerArgs.add(" -Xsuppress-version-warnings" )
77- }
78- freeCompilerArgs.add(" -Xexpect-actual-classes" )
79- // for some reason, IDE does not enable feature in test source sets without this line:
80- freeCompilerArgs.add(" -Xreturn-value-checker=full" )
81- }
82-
8374 sourceSets {
8475 commonMain {
8576 dependencies {
0 commit comments