Upgrade toolchain to api/lv 1.4

This commit is contained in:
Mikhael Bogdanov
2021-06-30 19:37:56 +02:00
parent a919aab3ab
commit 228100ef09
12 changed files with 23 additions and 29 deletions
@@ -37,8 +37,8 @@ configurations {
}
tasks.withType<KotlinCompile> {
kotlinOptions.languageVersion = "1.3"
kotlinOptions.apiVersion = "1.3"
kotlinOptions.languageVersion = "1.4"
kotlinOptions.apiVersion = "1.4"
kotlinOptions.freeCompilerArgs += listOf(
"-Xskip-prerelease-check",
"-Xskip-runtime-version-check",
+2 -2
View File
@@ -57,8 +57,8 @@ sourceSets {
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions {
languageVersion = "1.3"
apiVersion = "1.3"
languageVersion = "1.4"
apiVersion = "1.4"
freeCompilerArgs = freeCompilerArgs - "-progressive" + listOf(
"-Xskip-prerelease-check", "-Xsuppress-version-warnings", "-Xuse-mixed-named-arguments", "-Xnew-inference"
)
@@ -233,8 +233,8 @@ object JvmRuntimeVersionsConsistencyChecker {
jars: List<KotlinLibraryFile>
): MavenComparableVersion? {
assert(jars.isNotEmpty()) { "'jars' must not be empty" }
val oldestVersion = jars.minBy { it.version }!!.version
val newestVersion = jars.maxBy { it.version }!!.version
val oldestVersion = jars.minOf { it.version }
val newestVersion = jars.maxOf { it.version }
// If the oldest version is the same as the newest version, then all jars have the same version
if (oldestVersion == newestVersion) return oldestVersion
@@ -250,9 +250,9 @@ object JvmRuntimeVersionsConsistencyChecker {
// we suggest to provide an explicit dependency on version X.
// TODO: report this depending on the content of the jars instead
val minReflectJar =
jars.filter { it.file.name.startsWith("kotlin-reflect") }.minBy { it.version }
jars.filter { it.file.name.startsWith("kotlin-reflect") }.minByOrNull { it.version }
val maxStdlibJar =
jars.filter { it.file.name.startsWith("kotlin-runtime") || it.file.name.startsWith("kotlin-stdlib") }.maxBy { it.version }
jars.filter { it.file.name.startsWith("kotlin-runtime") || it.file.name.startsWith("kotlin-stdlib") }.maxByOrNull { it.version }
if (minReflectJar != null && maxStdlibJar != null && minReflectJar.version < maxStdlibJar.version) {
messageCollector.issue(
null,
@@ -49,7 +49,7 @@ dependencies {
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions {
apiVersion = "1.3"
apiVersion = "1.4"
freeCompilerArgs += "-Xsuppress-version-warnings"
}
}
@@ -40,8 +40,8 @@ dependencies {
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions {
// This module is being run from within Gradle, older versions of which only have kotlin-stdlib 1.3 in the runtime classpath.
apiVersion = "1.3"
// This module is being run from within Gradle, older versions of which only have older kotlin-stdlib in the runtime classpath.
apiVersion = "1.4"
freeCompilerArgs += "-Xsuppress-version-warnings"
}
}
+2 -2
View File
@@ -17,8 +17,8 @@ sourceSets {
tasks {
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
languageVersion = "1.3"
apiVersion = "1.3"
languageVersion = "1.4"
apiVersion = "1.4"
freeCompilerArgs += "-Xsuppress-version-warnings"
}
}
@@ -67,7 +67,7 @@ class SimpleKotlinGradleIT : KGPBaseTest() {
fun testLanguageVersion(gradleVersion: GradleVersion) {
project("languageVersion", gradleVersion) {
buildAndFail("build") {
assertOutputContains("'break' and 'continue' are not allowed in 'when' statements")
assertOutputContains("The feature \"definitely not null type parameters\" is only available since language version 1.6")
}
}
}
@@ -9,7 +9,7 @@ repositories {
compileKotlin {
kotlinOptions {
languageVersion = "1.3"
apiVersion = "1.3"
languageVersion = "1.5"
apiVersion = "1.5"
}
}
@@ -1,7 +1 @@
fun breakInWhen() {
while (true) {
when {
true -> break
}
}
}
fun <T> f(t: T): T!! = t!!
@@ -27,8 +27,8 @@ runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
tasks {
withType<KotlinCompile> {
// kotlinOptions.jdkHome = rootProject.extra["JDK_18"] as String
kotlinOptions.languageVersion = "1.3"
kotlinOptions.apiVersion = "1.3"
kotlinOptions.languageVersion = "1.4"
kotlinOptions.apiVersion = "1.4"
kotlinOptions.freeCompilerArgs += listOf(
"-Xskip-prerelease-check", "-Xsuppress-version-warnings"
)
@@ -18,8 +18,8 @@ pill {
}
kotlin.target.compilations.all {
kotlinOptions.languageVersion = "1.3"
kotlinOptions.apiVersion = "1.3"
kotlinOptions.languageVersion = "1.4"
kotlinOptions.apiVersion = "1.4"
kotlinOptions.freeCompilerArgs += listOf("-Xskip-prerelease-check")
}
+2 -2
View File
@@ -22,8 +22,8 @@ sourceSets {
tasks {
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
languageVersion = "1.3"
apiVersion = "1.3"
languageVersion = "1.4"
apiVersion = "1.4"
freeCompilerArgs += "-Xsuppress-version-warnings"
}
}