Browse Source

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
pull/1288/merge
Sebastien Deleuze 8 years ago
parent
commit
35d5dca571
  1. 29
      build.gradle
  2. 2
      spring-web-reactive/src/test/java/org/springframework/web/reactive/result/view/script/KotlinScriptTemplateTests.java
  3. 1
      spring-web-reactive/src/test/resources/META-INF/services/javax.script.ScriptEngineFactory
  4. 2
      spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/KotlinScriptTemplateTests.java

29
build.gradle

@ -6,7 +6,7 @@ buildscript { @@ -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 -> @@ -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 -> @@ -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") { @@ -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") { @@ -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}")

2
spring-web-reactive/src/test/java/org/springframework/web/reactive/result/view/script/KotlinScriptTemplateTests.java

@ -21,7 +21,6 @@ import java.util.Map; @@ -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; @@ -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;

1
spring-web-reactive/src/test/resources/META-INF/services/javax.script.ScriptEngineFactory

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

2
spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/KotlinScriptTemplateTests.java

@ -22,7 +22,6 @@ import javax.servlet.ServletContext; @@ -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; @@ -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;

Loading…
Cancel
Save