From 7a282fa2073ec13d2cdb28531eeb7f0204537a45 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Tue, 5 May 2020 22:20:45 +0300 Subject: [PATCH] Fix JVM version --- src/main/kotlin/Scientifik.kt | 6 +++++- src/main/kotlin/scientifik/ScientifikJVMPlugin.kt | 4 ++-- src/main/kotlin/scientifik/ScientifikMPPlugin.kt | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/Scientifik.kt b/src/main/kotlin/Scientifik.kt index 73f0ce6..246d091 100644 --- a/src/main/kotlin/Scientifik.kt +++ b/src/main/kotlin/Scientifik.kt @@ -1,10 +1,14 @@ +import org.gradle.api.JavaVersion + /** * Build constants */ object Scientifik { const val coroutinesVersion = "1.3.4" const val serializationVersion = "0.20.0" - const val JVM_VERSION = "11" + + val JVM_TARGET = JavaVersion.VERSION_11 +// val JVM_VERSION = JVM_TARGET.toString() object Serialization{ const val xmlVersion = "0.20.0.0" diff --git a/src/main/kotlin/scientifik/ScientifikJVMPlugin.kt b/src/main/kotlin/scientifik/ScientifikJVMPlugin.kt index cbcd037..5e786e8 100644 --- a/src/main/kotlin/scientifik/ScientifikJVMPlugin.kt +++ b/src/main/kotlin/scientifik/ScientifikJVMPlugin.kt @@ -22,12 +22,12 @@ open class ScientifikJVMPlugin : Plugin { repositories.applyRepos() extensions.findByType()?.apply { - targetCompatibility = enumValueOf(Scientifik.JVM_VERSION) + targetCompatibility = Scientifik.JVM_TARGET } tasks.withType { kotlinOptions { - jvmTarget = Scientifik.JVM_VERSION + jvmTarget = Scientifik.JVM_TARGET.toString() } } diff --git a/src/main/kotlin/scientifik/ScientifikMPPlugin.kt b/src/main/kotlin/scientifik/ScientifikMPPlugin.kt index 720fe76..abe1284 100644 --- a/src/main/kotlin/scientifik/ScientifikMPPlugin.kt +++ b/src/main/kotlin/scientifik/ScientifikMPPlugin.kt @@ -26,7 +26,7 @@ open class ScientifikMPPlugin : Plugin { jvm { compilations.all { kotlinOptions { - jvmTarget = Scientifik.JVM_VERSION + jvmTarget = Scientifik.JVM_TARGET.toString() } } }