From 66b8e3c5520a5a8728f695a676341beb86cb6457 Mon Sep 17 00:00:00 2001 From: lburgazzoli Date: Sat, 18 Jul 2020 14:14:04 +0200 Subject: [PATCH] [kotlin] compile scripts wit the same target level used to compile the loader --- camel-k-loader-kotlin/camel-k-loader-kotlin/pom.xml | 6 +++--- .../k/loader/kotlin/KotlinCompilationConfiguration.kt | 9 ++++++++- pom.xml | 1 - 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/camel-k-loader-kotlin/camel-k-loader-kotlin/pom.xml b/camel-k-loader-kotlin/camel-k-loader-kotlin/pom.xml index ade15abb1..05ba721bf 100644 --- a/camel-k-loader-kotlin/camel-k-loader-kotlin/pom.xml +++ b/camel-k-loader-kotlin/camel-k-loader-kotlin/pom.xml @@ -130,7 +130,7 @@ kotlin-maven-plugin ${kotlin.version} - ${maven.compiler.target} + ${maven.compiler.release} @@ -139,7 +139,7 @@ compile - ${kotlin.compiler.target} + ${maven.compiler.release} src/main/kotlin @@ -151,7 +151,7 @@ test-compile - ${kotlin.compiler.target} + ${maven.compiler.release} src/test/kotlin diff --git a/camel-k-loader-kotlin/camel-k-loader-kotlin/src/main/kotlin/org/apache/camel/k/loader/kotlin/KotlinCompilationConfiguration.kt b/camel-k-loader-kotlin/camel-k-loader-kotlin/src/main/kotlin/org/apache/camel/k/loader/kotlin/KotlinCompilationConfiguration.kt index c1b53a83a..e1c12ea7d 100644 --- a/camel-k-loader-kotlin/camel-k-loader-kotlin/src/main/kotlin/org/apache/camel/k/loader/kotlin/KotlinCompilationConfiguration.kt +++ b/camel-k-loader-kotlin/camel-k-loader-kotlin/src/main/kotlin/org/apache/camel/k/loader/kotlin/KotlinCompilationConfiguration.kt @@ -30,9 +30,16 @@ class KotlinCompilationConfiguration : ScriptCompilationConfiguration( jvm { // // The Kotlin script compiler does not inherit - // the classpath by default + // the classpath by default. // dependenciesFromClassloader(wholeClasspath = true) + + // + // Scripts have to be compiled with the same + // jvm target level as the loader. + // + compilerOptions.append("-jvm-target") + compilerOptions.append("11") } ide { acceptedLocations(ScriptAcceptedLocation.Everywhere) diff --git a/pom.xml b/pom.xml index e8793a962..3408cb980 100644 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,6 @@ 11 11 11 - 1.8 3.4.0 1.0.0-CR3