From e57a14c75d0c6c003e0da6d4394a11eada292937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Thu, 23 May 2024 11:29:14 +0200 Subject: [PATCH] Keep lambdas serializable --- build.gradle | 6 ++++++ .../starter/modules/plugins/KotlinLibraryPlugin.kt | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/build.gradle b/build.gradle index a3bb0090..49c2e69b 100644 --- a/build.gradle +++ b/build.gradle @@ -26,6 +26,12 @@ allprojects { kotlin { jvmToolchain(libs.versions.java.compilation.get().toInteger()) } + + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask).configureEach { + compilerOptions { + freeCompilerArgs.add("-Xlambdas=class") + } + } } pluginManager.withPlugin("java-gradle-plugin") { configurations { diff --git a/jvm/src/main/kotlin/com/project/starter/modules/plugins/KotlinLibraryPlugin.kt b/jvm/src/main/kotlin/com/project/starter/modules/plugins/KotlinLibraryPlugin.kt index 9c6d6b4c..27891c95 100644 --- a/jvm/src/main/kotlin/com/project/starter/modules/plugins/KotlinLibraryPlugin.kt +++ b/jvm/src/main/kotlin/com/project/starter/modules/plugins/KotlinLibraryPlugin.kt @@ -53,5 +53,13 @@ class KotlinLibraryPlugin : Plugin { } } } + + pluginManager.withPlugin("java-gradle-plugin") { + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask::class.java).configureEach { + compilerOptions { + freeCompilerArgs.add("-Xlambdas=class") + } + } + } } }