Skip to content

Commit b1cb068

Browse files
authored
Update kotlinx-metadata-jvm to 0.6.0 and Kotlin to 1.8.10 (#119)
Remove -Xskip-runtime-version-check flag as it is deprecated and has no effect Add -Xsuppress-version-warnings flag to suppress "LV 1.4 is deprecated" warning and enable allWarningsAsErrors back Remove unused declarations that contained deprecated code (.lowercase())
1 parent 79c3667 commit b1cb068

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

build.gradle.kts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ configurations.implementation {
7474

7575
dependencies {
7676
implementation(gradleApi())
77-
implementation("org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.5.0")
77+
implementation("org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.6.0")
7878
implementation("org.ow2.asm:asm:9.2")
7979
implementation("org.ow2.asm:asm-tree:9.2")
8080
implementation("com.googlecode.java-diff-utils:diffutils:1.3.0")
81-
compileOnly("org.jetbrains.kotlin.multiplatform:org.jetbrains.kotlin.multiplatform.gradle.plugin:1.6.0")
81+
compileOnly("org.jetbrains.kotlin.multiplatform:org.jetbrains.kotlin.multiplatform.gradle.plugin:1.8.10")
8282
// compileOnly("com.android.tools.build:gradle:${androidGradlePluginVersion}")
8383

8484
// The test needs the full kotlin multiplatform plugin loaded as it has no visibility of previously loaded plugins,
@@ -96,15 +96,15 @@ dependencies {
9696

9797
tasks.compileKotlin {
9898
kotlinOptions.apply {
99+
allWarningsAsErrors = true
100+
99101
languageVersion = "1.4"
100102
apiVersion = "1.4"
101103
jvmTarget = "1.8"
102-
// TODO revert that when updating Kotlin. This flag also affects kts files and prevents
103-
// the project from build due to "w: Language version 1.4 is deprecated and its support will be removed"
104-
// allWarningsAsErrors = true
105-
// Suppress the warning about kotlin-reflect 1.3 and kotlin-stdlib 1.4 in the classpath.
106-
// It's incorrect in this case because we're limiting API version to 1.3 anyway.
107-
freeCompilerArgs += "-Xskip-runtime-version-check"
104+
105+
// Suppressing "w: Language version 1.4 is deprecated and its support will be removed" message
106+
// because LV=1.4 in practice is mandatory as it is a default language version in Gradle 7.0+ for users' kts scripts.
107+
freeCompilerArgs += "-Xsuppress-version-warnings"
108108
}
109109
}
110110

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version=0.12.1-SNAPSHOT
22
group=org.jetbrains.kotlinx
33

4-
kotlinVersion=1.6.0
4+
kotlinVersion=1.8.10
55
pluginPublishVersion=0.10.1
66

77
kotlin.stdlib.default.dependency=false

src/main/kotlin/api/KotlinMetadataVisibilities.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
2-
* Copyright 2016-2020 JetBrains s.r.o.
2+
* Copyright 2016-2023 JetBrains s.r.o.
33
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
44
*/
55

66
package kotlinx.validation.api
77

88
import kotlinx.metadata.*
99
import kotlinx.metadata.jvm.*
10-
import kotlinx.metadata.jvm.KotlinClassHeader.Companion.COMPATIBLE_METADATA_VERSION
10+
import kotlinx.metadata.jvm.KotlinClassMetadata.Companion.COMPATIBLE_METADATA_VERSION
1111
import org.objectweb.asm.tree.*
1212

1313
class ClassVisibility(
@@ -58,7 +58,7 @@ val ClassNode.kotlinMetadata: KotlinClassMetadata?
5858
val metadata = findAnnotation("kotlin/Metadata", false) ?: return null
5959
@Suppress("UNCHECKED_CAST")
6060
val header = with(metadata) {
61-
KotlinClassHeader(
61+
Metadata(
6262
kind = get("k") as Int?,
6363
metadataVersion = (get("mv") as List<Int>?)?.toIntArray(),
6464
data1 = (get("d1") as List<String>?)?.toTypedArray(),

src/test/kotlin/tests/utils.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2020 JetBrains s.r.o.
2+
* Copyright 2016-2023 JetBrains s.r.o.
33
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
44
*/
55

@@ -39,7 +39,3 @@ private fun CharSequence.trimTrailingWhitespacesAndAddNewlineAtEOF(): String =
3939
this.lineSequence().map { it.trimEnd() }.joinToString(separator = "\n").let {
4040
if (it.endsWith("\n")) it else it + "\n"
4141
}
42-
43-
44-
private val UPPER_CASE_CHARS = Regex("[A-Z]+")
45-
fun String.replaceCamelCaseWithDashedLowerCase() = replace(UPPER_CASE_CHARS) { "-" + it.value.toLowerCase() }

0 commit comments

Comments
 (0)