Upgrade to Kotlin 1.1-beta-17

Spring Framework 5.0 now requires Kotlin 1.1+. This commit
also re-enable Kotlin JSR 223 unit tests.

Issue: SPR-15100
This commit is contained in:
Sebastien Deleuze 2017-01-19 13:00:34 +01:00
parent b77e03b1e0
commit 35d5dca571
4 changed files with 18 additions and 16 deletions

View File

@ -6,7 +6,7 @@ buildscript {
dependencies { dependencies {
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7") classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.3") 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:docbook-reference-plugin:0.3.1")
classpath("io.spring.gradle:dependency-management-plugin:1.0.0.BUILD-SNAPSHOT") classpath("io.spring.gradle:dependency-management-plugin:1.0.0.BUILD-SNAPSHOT")
} }
@ -71,7 +71,7 @@ configure(allprojects) { project ->
ext.junitVersion = "4.12" ext.junitVersion = "4.12"
ext.junitJupiterVersion = '5.0.0-M3' ext.junitJupiterVersion = '5.0.0-M3'
ext.junitPlatformVersion = '1.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.log4jVersion = '2.7'
ext.nettyVersion = "4.1.7.Final" ext.nettyVersion = "4.1.7.Final"
ext.okhttpVersion = "2.7.5" 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 // Kotlin compiler does not support JDK 9 yet, see https://youtrack.jetbrains.com/issue/KT-14988
if (!JavaVersion.current().java9Compatible) { if (!JavaVersion.current().java9Compatible) {
apply plugin: "kotlin" apply plugin: "kotlin"
//compileKotlin {
// kotlinOptions.apiVersion = 1.0
// kotlinOptions.languageVersion = 1.0
//}
} }
configurations { configurations {
@ -871,6 +867,15 @@ project("spring-web-reactive") {
testRuntime("org.webjars:underscorejs:1.8.3") testRuntime("org.webjars:underscorejs:1.8.3")
testRuntime("org.jruby:jruby:9.1.7.0") testRuntime("org.jruby:jruby:9.1.7.0")
testRuntime("org.python:jython-standalone:2.5.3") 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) { 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 // 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 // the case yet, so we depend on kotlin-script-util and exclude these
// dependencies only used for artifact retrieval. Point raised to Kotlin team. // dependencies only used for artifact retrieval. Point raised to Kotlin team.
//testRuntime("org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}") testRuntime("org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}")
//testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}") { testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}") {
// exclude group: "com.jcabi", module: "jcabi-aether" exclude group: "com.jcabi", module: "jcabi-aether"
// exclude group: "org.apache.maven", module: "maven-core" exclude group: "org.apache.maven", module: "maven-core"
// exclude group: "org.sonatype.aether", module: "aether-api" exclude group: "org.sonatype.aether", module: "aether-api"
//} }
testRuntime("org.webjars:underscorejs:1.8.3") testRuntime("org.webjars:underscorejs:1.8.3")
testRuntime("org.glassfish:javax.el:3.0.1-b08") testRuntime("org.glassfish:javax.el:3.0.1-b08")
testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}") testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")

View File

@ -21,7 +21,6 @@ import java.util.Map;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@ -41,7 +40,6 @@ import org.springframework.web.server.session.WebSessionManager;
* *
* @author Sebastien Deleuze * @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 { public class KotlinScriptTemplateTests {
private StaticApplicationContext context; private StaticApplicationContext context;

View File

@ -0,0 +1 @@
org.jetbrains.kotlin.script.jsr223.KotlinJsr223JvmLocalScriptEngineFactory

View File

@ -22,7 +22,6 @@ import javax.servlet.ServletContext;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
@ -39,7 +38,6 @@ import org.springframework.web.context.WebApplicationContext;
* *
* @author Sebastien Deleuze * @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 { public class KotlinScriptTemplateTests {
private WebApplicationContext webAppContext; private WebApplicationContext webAppContext;