Browse Source

Revert "Upgrade to Kotlin 1.4 M2"

This reverts commit 2a74eff10f.

Some regressions require to wait at least Kotlin 1.4 M3.
pull/25283/head
Sébastien Deleuze 4 years ago
parent
commit
6b355df903
  1. 15
      build.gradle
  2. 1
      settings.gradle
  3. 6
      spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/JdbcOperationsExtensionsTests.kt
  4. 6
      spring-messaging/spring-messaging.gradle
  5. 4
      spring-messaging/src/test/kotlin/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerKotlinTests.kt
  6. 6
      spring-test/spring-test.gradle
  7. 6
      spring-tx/spring-tx.gradle
  8. 6
      spring-web/src/test/kotlin/org/springframework/web/method/annotation/RequestParamMethodArgumentResolverKotlinTests.kt
  9. 6
      spring-webflux/spring-webflux.gradle

15
build.gradle

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
plugins {
id 'io.spring.dependency-management' version '1.0.9.RELEASE' apply false
id 'org.jetbrains.kotlin.jvm' version '1.4-M2' apply false
id 'org.jetbrains.kotlin.jvm' version '1.3.72' apply false
id 'org.jetbrains.dokka' version '0.10.1' apply false
id 'org.asciidoctor.jvm.convert' version '2.4.0'
id 'io.spring.nohttp' version '0.0.5.RELEASE'
@ -29,8 +29,8 @@ configure(allprojects) { project -> @@ -29,8 +29,8 @@ configure(allprojects) { project ->
mavenBom "io.r2dbc:r2dbc-bom:Arabba-SR5"
mavenBom "io.rsocket:rsocket-bom:1.0.1"
mavenBom "org.eclipse.jetty:jetty-bom:9.4.30.v20200611"
mavenBom "org.jetbrains.kotlin:kotlin-bom:1.4-M2"
mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.7-1.4-M2"
mavenBom "org.jetbrains.kotlin:kotlin-bom:1.3.72"
mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.7"
mavenBom "org.junit:junit-bom:5.6.2"
}
dependencies {
@ -286,8 +286,6 @@ configure(allprojects) { project -> @@ -286,8 +286,6 @@ configure(allprojects) { project ->
mavenCentral()
maven { url "https://repo.spring.io/libs-spring-framework-build" }
maven { url "https://repo.spring.io/snapshot" } // Reactor
maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // Kotlin
maven { url "https://kotlin.bintray.com/kotlinx" } // Coroutines
}
}
configurations.all {
@ -310,16 +308,9 @@ configure([rootProject] + javaProjects) { project -> @@ -310,16 +308,9 @@ configure([rootProject] + javaProjects) { project ->
pluginManager.withPlugin("kotlin") {
apply plugin: "org.jetbrains.dokka"
// Workaround for https://youtrack.jetbrains.com/issue/KT-39610
configurations["kotlinCompilerPluginClasspath"].attributes.attribute(
org.gradle.api.attributes.Usage.USAGE_ATTRIBUTE,
objects.named(Usage.class, "java-runtime")
)
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
languageVersion = "1.3"
apiVersion = "1.3"
freeCompilerArgs = ["-Xjsr305=strict"]
allWarningsAsErrors = true
}

1
settings.gradle

@ -2,7 +2,6 @@ pluginManagement { @@ -2,7 +2,6 @@ pluginManagement {
repositories {
gradlePluginPortal()
maven { url 'https://repo.spring.io/plugins-release' }
maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // Kotlin
}
}

6
spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/JdbcOperationsExtensionsTests.kt

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors
* Copyright 2002-2019 the original author or authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -53,7 +53,7 @@ class JdbcOperationsExtensionsTests { @@ -53,7 +53,7 @@ class JdbcOperationsExtensionsTests {
@Test // gh-22682
fun `queryForObject with nullable RowMapper-like function`() {
every { template.queryForObject(sql, any<RowMapper<Int>>(), 3) } returns null
assertThat(template.queryForObject<Int?>(sql, 3) { _, _ -> null }).isNull()
assertThat(template.queryForObject(sql, 3) { _, _ -> null as Int? }).isNull()
verify { template.queryForObject(eq(sql), any<RowMapper<Int?>>(), eq(3)) }
}
@ -130,7 +130,7 @@ class JdbcOperationsExtensionsTests { @@ -130,7 +130,7 @@ class JdbcOperationsExtensionsTests {
@Test
fun `query with RowMapper-like function`() {
val list = mutableListOf(1, 2, 3)
val list = listOf(1, 2, 3)
every { template.query(sql, ofType<RowMapper<*>>(), 3) } returns list
assertThat(template.query(sql, 3) { rs, _ ->
rs.getInt(1)

6
spring-messaging/spring-messaging.gradle

@ -2,12 +2,6 @@ description = "Spring Messaging" @@ -2,12 +2,6 @@ description = "Spring Messaging"
apply plugin: "kotlin"
// Workaround for https://youtrack.jetbrains.com/issue/KT-39610
configurations["optional"].attributes.attribute(
org.gradle.api.attributes.Usage.USAGE_ATTRIBUTE,
objects.named(Usage.class, "java-runtime")
)
dependencies {
compile(project(":spring-beans"))
compile(project(":spring-core"))

4
spring-messaging/src/test/kotlin/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerKotlinTests.kt

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -132,7 +132,7 @@ class SimpAnnotationMethodMessageHandlerKotlinTests { @@ -132,7 +132,7 @@ class SimpAnnotationMethodMessageHandlerKotlinTests {
messageHandler.registerHandler(testController)
messageHandler.handleMessage(message)
assertThat(testController.exception).isNotNull()
assertThat(testController.exception).isInstanceOf(NullPointerException::class.java)
assertThat(testController.exception).isInstanceOf(IllegalArgumentException::class.java)
}
private fun createMessage(destination: String, headers: Map<String, String?>): Message<ByteArray> {

6
spring-test/spring-test.gradle

@ -2,12 +2,6 @@ description = "Spring TestContext Framework" @@ -2,12 +2,6 @@ description = "Spring TestContext Framework"
apply plugin: "kotlin"
// Workaround for https://youtrack.jetbrains.com/issue/KT-39610
configurations["optional"].attributes.attribute(
org.gradle.api.attributes.Usage.USAGE_ATTRIBUTE,
objects.named(Usage.class, "java-runtime")
)
dependencies {
compile(project(":spring-core"))
optional(project(":spring-aop"))

6
spring-tx/spring-tx.gradle

@ -2,12 +2,6 @@ description = "Spring Transaction" @@ -2,12 +2,6 @@ description = "Spring Transaction"
apply plugin: "kotlin"
// Workaround for https://youtrack.jetbrains.com/issue/KT-39610
configurations["optional"].attributes.attribute(
org.gradle.api.attributes.Usage.USAGE_ATTRIBUTE,
objects.named(Usage.class, "java-runtime")
)
dependencies {
compile(project(":spring-beans"))
compile(project(":spring-core"))

6
spring-web/src/test/kotlin/org/springframework/web/method/annotation/RequestParamMethodArgumentResolverKotlinTests.kt

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -139,7 +139,7 @@ class RequestParamMethodArgumentResolverKotlinTests { @@ -139,7 +139,7 @@ class RequestParamMethodArgumentResolverKotlinTests {
@Test
fun resolveNonNullableNotRequiredWithoutParameter() {
assertThatExceptionOfType(NullPointerException::class.java).isThrownBy {
assertThatExceptionOfType(TypeCastException::class.java).isThrownBy {
resolver.resolveArgument(nonNullableParamNotRequired, null, webRequest, binderFactory) as String
}
}
@ -221,7 +221,7 @@ class RequestParamMethodArgumentResolverKotlinTests { @@ -221,7 +221,7 @@ class RequestParamMethodArgumentResolverKotlinTests {
request.method = HttpMethod.POST.name
request.contentType = MediaType.MULTIPART_FORM_DATA_VALUE
assertThatExceptionOfType(NullPointerException::class.java).isThrownBy {
assertThatExceptionOfType(TypeCastException::class.java).isThrownBy {
resolver.resolveArgument(nonNullableMultipartParamNotRequired, null, webRequest, binderFactory) as MultipartFile
}
}

6
spring-webflux/spring-webflux.gradle

@ -2,12 +2,6 @@ description = "Spring WebFlux" @@ -2,12 +2,6 @@ description = "Spring WebFlux"
apply plugin: "kotlin"
// Workaround for https://youtrack.jetbrains.com/issue/KT-39610
configurations["optional"].attributes.attribute(
org.gradle.api.attributes.Usage.USAGE_ATTRIBUTE,
objects.named(Usage.class, "java-runtime")
)
dependencies {
compile(project(":spring-beans"))
compile(project(":spring-core"))

Loading…
Cancel
Save