Skip to content

Commit

Permalink
Kotlin 1.6.10 (#4277)
Browse files Browse the repository at this point in the history
* Kotlin 1.6.0

* Disable warnings

We need API version 1.4 for Gradle 7.x compatibility. This
creates a warning in Kotlin 1.6.

* Use language version 1.6

* Workaround for gradle/gradle#16774

* Update --jvm-target CLI description to include JVM 17 target

* Kotlin 1.6.10

* Use a simpler workaround for gradle/gradle#16774
  • Loading branch information
3flex committed Dec 18, 2021
1 parent f85c0da commit 4e2e8ba
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
9 changes: 1 addition & 8 deletions build-logic/src/main/kotlin/module.gradle.kts
Expand Up @@ -83,19 +83,12 @@ configurations.create("coverageDataElements") {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = Versions.JVM_TARGET
languageVersion = "1.5"
languageVersion = "1.6"
apiVersion = "1.4"
freeCompilerArgs = listOf(
"-progressive",
"-Xopt-in=kotlin.RequiresOptIn"
)
// Usage: <code>./gradlew build -PwarningsAsErrors=true</code>.
// Note: currently there are warnings for detekt-gradle-plugin that seemingly can't be fixed
// until Gradle releases an update (https://github.com/gradle/gradle/issues/16345)
allWarningsAsErrors = when (project.name) {
"detekt-gradle-plugin" -> false
else -> (project.findProperty("warningsAsErrors") == "true" || System.getenv("CI") == "true")
}
}
}

Expand Down
Expand Up @@ -189,7 +189,7 @@ class CliArgs {
@Parameter(
names = ["--jvm-target"],
description = "EXPERIMENTAL: Target version of the generated JVM bytecode that was generated during " +
"compilation and is now being used for type resolution (1.6, 1.8, 9, 10, 11, 12, 13, 14, 15 or 16)"
"compilation and is now being used for type resolution (1.6, 1.8, 9, 10, 11, 12, 13, 14, 15, 16 or 17)"
)
var jvmTarget: String = JvmTarget.DEFAULT.description

Expand Down
16 changes: 16 additions & 0 deletions detekt-gradle-plugin/build.gradle.kts
@@ -1,3 +1,6 @@
import org.gradle.api.internal.classpath.ModuleRegistry
import org.gradle.kotlin.dsl.support.serviceOf

plugins {
id("module")
`java-gradle-plugin`
Expand All @@ -20,6 +23,19 @@ testing {
implementation(libs.kotlin.gradle)
implementation(gradleKotlinDsl())
runtimeOnly(libs.spek.runner)

// Workaround for gradle/gradle#16774, see
// https://github.com/gradle/gradle/issues/16774#issuecomment-853407822
// This should be reviewed and dropped if fixed as planned in Gradle 7.5
runtimeOnly(
files(
serviceOf<ModuleRegistry>()
.getModule("gradle-tooling-api-builders")
.classpath
.asFiles
.first()
)
)
}
}
register("functionalTest", JvmTestSuite::class) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
@@ -1,7 +1,7 @@
[versions]
dokka = "1.6.0"
jacoco = "0.8.7"
kotlin = "1.5.31"
kotlin = "1.6.10"
ktlint = "0.42.1"
spek = "2.0.17"

Expand Down

0 comments on commit 4e2e8ba

Please sign in to comment.