From 36b232b653564c8ca5e11d981ee43ca74d595c53 Mon Sep 17 00:00:00 2001 From: Philip Wedemann <22521688+hfhbd@users.noreply.github.com> Date: Tue, 5 Jul 2022 13:23:24 +0200 Subject: [PATCH] Gradle Plugin: Fix NPE and use 1.8 by default (#2164) --- .../src/main/kotlin/org/jetbrains/compose/ComposePlugin.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposePlugin.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposePlugin.kt index b4c5401385..1755055ed6 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposePlugin.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposePlugin.kt @@ -126,7 +126,9 @@ class ComposePlugin : Plugin { project.tasks.withType(KotlinCompile::class.java) { it.kotlinOptions.apply { if (overrideDefaultJvmTarget) { - jvmTarget = "11".takeIf { jvmTarget.toDouble() < 11 } ?: jvmTarget + if (jvmTarget.isNullOrBlank() || jvmTarget.toDouble() < 1.8) { + jvmTarget = "1.8" + } } } }