Skip to content

Commit

Permalink
Merge pull request #512 from SpineEventEngine/expect-actual-classes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-yevsyukov authored May 20, 2024
2 parents 3d12433 + 589a95c commit 6d9ed9c
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,24 @@ fun KotlinJvmProjectExtension.applyJvmToolchain(version: String) =
/**
* Opts-in to experimental features that we use in our codebase.
*/
@Suppress("unused")
@Suppress("unused", "MagicNumber" /* Kotlin Compiler version. */)
fun KotlinCompile.setFreeCompilerArgs() {
// Avoid the "unsupported flag warning" for Kotlin compilers pre 1.9.20.
// See: https://youtrack.jetbrains.com/issue/KT-61573
val expectActualClasses =
if (KotlinVersion.CURRENT.isAtLeast(1, 9, 20)) "-Xexpect-actual-classes" else ""
kotlinOptions {
freeCompilerArgs = listOf(
"-Xskip-prerelease-check",
"-Xjvm-default=all",
"-Xinline-classes",
"-Xexpect-actual-classes",
expectActualClasses,
"-opt-in=" +
"kotlin.contracts.ExperimentalContracts," +
"kotlin.io.path.ExperimentalPathApi," +
"kotlin.ExperimentalUnsignedTypes," +
"kotlin.ExperimentalStdlibApi," +
"kotlin.experimental.ExperimentalTypeInference",
)
).filter { it.isNotBlank() }
}
}

0 comments on commit 6d9ed9c

Please sign in to comment.