Skip to content

Commit

Permalink
fix(deps): update kotlin monorepo to v1.9.20 (#6572)
Browse files Browse the repository at this point in the history
* fix(deps): update kotlin monorepo to v1.9.20

* Update Kotlin compiler checksum

* Fix 'Extension is shadowed by a member' warning

* Exclude kotlin-main-kts from detekt-formatting testRuntimeClasspath

This is due to detekt-main-kts embedding an old version of SLF4J which
conflicts with the version used in detekt-formatting. This dependency
isn't required for formatting tests as ktlint only requires the AST for
its analysis and doesn't need to be compiled.

See https://youtrack.jetbrains.com/issue/KT-60813

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matthew Haughton <3flex@users.noreply.github.com>
  • Loading branch information
2 people authored and cortinico committed Nov 25, 2023
1 parent dd7d490 commit 4cf207c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion detekt-compiler-plugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kotlinCompilerChecksum=7d74863deecf8e0f28ea54c3735feab003d0eac67e8d3a791254b16889c20342
kotlinCompilerChecksum=15a8a2825b74ccf6c44e04e97672db802d2df75ce2fbb63ef0539bf3ae5006f0

kotlin.code.style=official
systemProp.sonar.host.url=http://localhost:9000
Expand Down
14 changes: 13 additions & 1 deletion detekt-formatting/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ dependencies {
exclude(group = "org.jetbrains.kotlin")
}

testImplementation(projects.detektTest)
testImplementation(projects.detektTest) {
/* Workaround for https://youtrack.jetbrains.com/issue/KT-60813. Required due to detekt-main-kts embedding an
old version of SLF4J which conflicts with the version used in detekt-formatting. This dependency isn't required
for formatting tests as ktlint only requires the AST for its analysis and doesn't need to be compiled.
Prevents test execution with "compile-test-snippets" enabled.
*/
exclude("org.jetbrains.kotlin", "kotlin-main-kts")
}
testImplementation(libs.assertj)

testRuntimeOnly(libs.slf4j.nop)
Expand Down Expand Up @@ -50,3 +57,8 @@ tasks.test {
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
}
}

tasks.withType<Test>().configureEach {
// Required due to exclusion of kotlin-main-kts dependency above
systemProperty("compile-test-snippets", false)
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,6 @@ class InvalidPackageDeclaration(config: Config = Config.empty) : Rule(config) {

private fun <T> Iterable<T>.toNormalizedForm() = joinToString("|")

private fun FqName.startsWith(other: FqName): Boolean {
val segments = pathSegments()
val otherSegments = other.pathSegments()
return if (otherSegments.size <= segments.size) {
otherSegments.indices.all { index -> segments[index] == otherSegments[index] }
} else {
false
}
}

private fun FqName.withoutPrefix(prefix: FqName): List<String> {
val dropCount = if (startsWith(prefix)) prefix.pathSegments().size else 0
return pathSegments()
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
dokka = "1.8.10"
jacoco = "0.8.10"
kotlin = "1.9.10"
kotlin = "1.9.20"
ktlint = "0.50.0"
junit = "5.9.3"
contester = "0.2.0"
Expand Down

0 comments on commit 4cf207c

Please sign in to comment.