From 997748ee2935ede8c39d321975134ff9abb4998e Mon Sep 17 00:00:00 2001 From: Sebastien Deleuze Date: Sun, 24 Sep 2017 23:09:13 +0200 Subject: [PATCH] Upgrade to Kotlin 1.1.50 Potential regression detected for null-safety on user project side https://youtrack.jetbrains.com/issue/KT-20411 --- build.gradle | 8 ++++---- src/docs/asciidoc/kotlin.adoc | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 6c944446ed..64168a5543 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { plugins { id "com.gradle.build-scan" version "1.8" id "io.spring.dependency-management" version "1.0.3.RELEASE" apply false - id "org.jetbrains.kotlin.jvm" version "1.1.4-3" apply false + id "org.jetbrains.kotlin.jvm" version "1.1.50" apply false id "org.jetbrains.dokka" version "0.9.15" id "org.asciidoctor.convert" version "1.5.3" } @@ -50,7 +50,7 @@ configure(allprojects) { project -> ext.junitJupiterVersion = '5.0.0' ext.junitPlatformVersion = '1.0.0' ext.junitVintageVersion = "4.12.0" - ext.kotlinVersion = '1.1.4-3' + ext.kotlinVersion = '1.1.50' ext.log4jVersion = '2.9.1' ext.nettyVersion = "4.1.15.Final" ext.reactorVersion = "Bismuth-RC1" @@ -72,12 +72,12 @@ configure(allprojects) { project -> apply plugin: "kotlin" compileKotlin { kotlinOptions.jvmTarget = "1.8" - kotlinOptions.freeCompilerArgs = ["-Xskip-runtime-version-check", "-Xjsr305-annotations=enable"] + kotlinOptions.freeCompilerArgs = ["-Xskip-runtime-version-check", "-Xjsr305=strict"] } compileTestKotlin { kotlinOptions.jvmTarget = "1.8" - kotlinOptions.freeCompilerArgs = ["-Xskip-runtime-version-check", "-Xjsr305-annotations=enable"] + kotlinOptions.freeCompilerArgs = ["-Xskip-runtime-version-check", "-Xjsr305=strict"] } configurations.all { diff --git a/src/docs/asciidoc/kotlin.adoc b/src/docs/asciidoc/kotlin.adoc index 4abbef5ee3..3396dd2af5 100644 --- a/src/docs/asciidoc/kotlin.adoc +++ b/src/docs/asciidoc/kotlin.adoc @@ -105,9 +105,12 @@ Other libraries like Reactor and Spring Data leverage these annotations as well null-safe APIs for Kotlin developers. ==== -For now, one needs to use a `-Xjsr305-annotations=enable` flag (specified via the -`freeCompilerArgs` property with Maven or Gradle Kotlin plugins), but that should become -the default behavior in an upcoming release of Kotlin. +The JSR 305 checks can be configured by adding the `-Xjsr305` compiler flag with the following +options: `-Xjsr305={strict|warn|ignore}`. + +For kotlin versions 1.1.50+/1.2, the default behavior is the same to `-Xjsr305=warn`. The +`strict` value should be considered experimental (Spring API nullability could evolve and +more checks may be added in the future). [NOTE] ====