Build compiler with -Xjvm-default=all + @JvmDefaultCompatibility when needed

This commit is contained in:
Mikhael Bogdanov
2021-12-08 10:05:41 +01:00
committed by Alexander Udalov
parent 61d339e8f2
commit c168a19a58
9 changed files with 22 additions and 33 deletions
@@ -190,6 +190,25 @@ fun Project.configureKotlinCompilationOptions() {
if (project.path in projectsWithEnabledContextReceivers) {
freeCompilerArgs += "-Xcontext-receivers"
}
//TODO: migrate modules to defaults
//TODO: different gradle versions bundle different Kotlin compilers, not all of them support defaults
if (!project.path.contains("-gradle") &&
!project.path.contains("kotlin-project-model") &&
!project.path.contains(":binary-compatibility-validator") &&
!project.path.contains("runtime") &&
//TODO: tune performance in tree and tree.impl modules
!project.path.contains(":compiler:ir.tree") &&
//HACK: filter modules with JVM target 1.6
//TODO: remove after removing 1.6 target
!project.path.startsWith(":core") &&
!project.path.startsWith(":kotlin-stdlib") &&
!project.path.startsWith(":kotlinx-metadata") &&
!project.path.startsWith(":kotlin-scripting") &&
!project.path.startsWith(":compiler:tests-common-jvm6")
) {
freeCompilerArgs += "-Xjvm-default=all"
}
}
}
}