diff --git a/build.gradle b/build.gradle index 01a93070f4..bc60432732 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { dependencies { classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7") classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.3") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.6") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.0-beta-17") classpath("io.spring.gradle:docbook-reference-plugin:0.3.1") classpath("io.spring.gradle:dependency-management-plugin:1.0.0.BUILD-SNAPSHOT") } @@ -71,7 +71,7 @@ configure(allprojects) { project -> ext.junitVersion = "4.12" ext.junitJupiterVersion = '5.0.0-M3' ext.junitPlatformVersion = '1.0.0-M3' - ext.kotlinVersion = "1.0.6" // Also change kotlin-gradle-plugin version when upgrading + ext.kotlinVersion = "1.1.0-beta-17" // Also change kotlin-gradle-plugin version when upgrading ext.log4jVersion = '2.7' ext.nettyVersion = "4.1.7.Final" ext.okhttpVersion = "2.7.5" @@ -112,10 +112,6 @@ configure(allprojects) { project -> // Kotlin compiler does not support JDK 9 yet, see https://youtrack.jetbrains.com/issue/KT-14988 if (!JavaVersion.current().java9Compatible) { apply plugin: "kotlin" - //compileKotlin { - // kotlinOptions.apiVersion = 1.0 - // kotlinOptions.languageVersion = 1.0 - //} } configurations { @@ -871,6 +867,15 @@ project("spring-web-reactive") { testRuntime("org.webjars:underscorejs:1.8.3") testRuntime("org.jruby:jruby:9.1.7.0") testRuntime("org.python:jython-standalone:2.5.3") + // Ideally, kotlin-script-runtime should be enough for JSR-223, but that's not + // the case yet, so we depend on kotlin-script-util and exclude these + // dependencies only used for artifact retrieval. Point raised to Kotlin team. + testRuntime("org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}") + testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}") { + exclude group: "com.jcabi", module: "jcabi-aether" + exclude group: "org.apache.maven", module: "maven-core" + exclude group: "org.sonatype.aether", module: "aether-api" + } } if (JavaVersion.current().java9Compatible) { @@ -978,12 +983,12 @@ project("spring-webmvc") { // Ideally, kotlin-script-runtime should be enough for JSR-223, but that's not // the case yet, so we depend on kotlin-script-util and exclude these // dependencies only used for artifact retrieval. Point raised to Kotlin team. - //testRuntime("org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}") - //testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}") { - // exclude group: "com.jcabi", module: "jcabi-aether" - // exclude group: "org.apache.maven", module: "maven-core" - // exclude group: "org.sonatype.aether", module: "aether-api" - //} + testRuntime("org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}") + testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}") { + exclude group: "com.jcabi", module: "jcabi-aether" + exclude group: "org.apache.maven", module: "maven-core" + exclude group: "org.sonatype.aether", module: "aether-api" + } testRuntime("org.webjars:underscorejs:1.8.3") testRuntime("org.glassfish:javax.el:3.0.1-b08") testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}") diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/result/view/script/KotlinScriptTemplateTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/result/view/script/KotlinScriptTemplateTests.java index 999de640dc..936e8cb826 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/result/view/script/KotlinScriptTemplateTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/result/view/script/KotlinScriptTemplateTests.java @@ -21,7 +21,6 @@ import java.util.Map; import static org.junit.Assert.assertEquals; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.springframework.context.annotation.AnnotationConfigApplicationContext; @@ -41,7 +40,6 @@ import org.springframework.web.server.session.WebSessionManager; * * @author Sebastien Deleuze */ -@Ignore // Temporary disabled since Kotlin 1.1-M04 generates bytecode not Kotlin 1.0 compliant, will be enable as soon as Kotlin 1.1-M05 is available public class KotlinScriptTemplateTests { private StaticApplicationContext context; diff --git a/spring-web-reactive/src/test/resources/META-INF/services/javax.script.ScriptEngineFactory b/spring-web-reactive/src/test/resources/META-INF/services/javax.script.ScriptEngineFactory new file mode 100644 index 0000000000..fa84d5e499 --- /dev/null +++ b/spring-web-reactive/src/test/resources/META-INF/services/javax.script.ScriptEngineFactory @@ -0,0 +1 @@ +org.jetbrains.kotlin.script.jsr223.KotlinJsr223JvmLocalScriptEngineFactory diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/KotlinScriptTemplateTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/KotlinScriptTemplateTests.java index 595290a5f3..362b78b31d 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/KotlinScriptTemplateTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/KotlinScriptTemplateTests.java @@ -22,7 +22,6 @@ import javax.servlet.ServletContext; import static org.junit.Assert.assertEquals; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import static org.mockito.Mockito.mock; @@ -39,7 +38,6 @@ import org.springframework.web.context.WebApplicationContext; * * @author Sebastien Deleuze */ -@Ignore // Temporary disabled since Kotlin 1.1-M04 generates bytecode not Kotlin 1.0 compliant, will be enable as soon as Kotlin 1.1-M05 is available public class KotlinScriptTemplateTests { private WebApplicationContext webAppContext;