Upgrade toolchain to api/lv 1.4
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
+4
-4
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ repositories {
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
languageVersion = "1.3"
|
||||
apiVersion = "1.3"
|
||||
languageVersion = "1.5"
|
||||
apiVersion = "1.5"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-7
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user