Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use flag -Xexpect-actual-classes Kotlin compiler flag before 1.9.20 #512

Merged
merged 2 commits into from
May 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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() }
}
}
Loading