You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/diagnostics/LibrarySpecialCompatibilityChecker.kt
+22-9Lines changed: 22 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -60,24 +60,37 @@ abstract class LibrarySpecialCompatibilityChecker {
60
60
val compilerVersion =Version.parseVersion(getRawCompilerVersion()) ?:return
61
61
62
62
for (library in libraries) {
63
-
if (shouldCheckLibrary(library)) {
64
-
val jarManifest = library.getComponent(JarManifestComponent.Kind)?.jarManifest ?:continue
65
-
val libraryVersion =Version.parseVersion(jarManifest.mainAttributes.getValue(KLIB_JAR_LIBRARY_VERSION)) ?:continue
63
+
val checkedLibrary = library.toCheckedLibrary() ?:continue
66
64
67
-
val messageToReport = getMessageToReport(compilerVersion, libraryVersion, library)
val jarManifest = library.getComponent(JarManifestComponent.Kind)?.jarManifest ?:continue
66
+
val libraryVersion =Version.parseVersion(jarManifest.mainAttributes.getValue(KLIB_JAR_LIBRARY_VERSION)) ?:continue
67
+
68
+
val rootCause =when {
69
+
libraryVersion < compilerVersion ->
70
+
"The ${checkedLibrary.platformDisplayName}${checkedLibrary.libraryDisplayName} library has an older version ($libraryVersion) than the compiler ($compilerVersion). Such a configuration is not supported."
"The ${checkedLibrary.platformDisplayName}${checkedLibrary.libraryDisplayName} library has a more recent version ($libraryVersion) than the compiler supports. The compiler version is $compilerVersion."
74
+
75
+
else->continue
71
76
}
77
+
78
+
messageCollector.report(
79
+
CompilerMessageSeverity.ERROR,
80
+
"$rootCause\nPlease, make sure that the ${checkedLibrary.libraryDisplayName} library has the version in the range "+
Copy file name to clipboardExpand all lines: compiler/ir/serialization.js/src/org/jetbrains/kotlin/ir/backend/js/checkers/JsLibrarySpecialCompatibilityChecker.kt
"The Kotlin/JS $libraryDisplayName library has an older version ($libraryVersion) than the compiler ($compilerVersion). Such a configuration is not supported."
"The Kotlin/JS $libraryDisplayName library has a more recent version ($libraryVersion) than the compiler supports. The compiler version is $compilerVersion."
28
-
29
-
else->returnnull
30
-
}
31
-
32
-
return"$rootCause\nPlease, make sure that the $libraryDisplayName library has the version in the range "+
Copy file name to clipboardExpand all lines: compiler/ir/serialization.js/src/org/jetbrains/kotlin/ir/backend/js/checkers/WasmLibrarySpecialCompatibilityChecker.kt
"The Kotlin/Wasm $libraryDisplayName library has an older version ($libraryVersion) than the compiler ($compilerVersion). Such a configuration is not supported."
"The Kotlin/Wasm $libraryDisplayName library has a more recent version ($libraryVersion) than the compiler supports. The compiler version is $compilerVersion."
29
-
30
-
else->returnnull
31
-
}
32
-
33
-
return"$rootCause\nPlease, make sure that the $libraryDisplayName library has the version in the range "+
0 commit comments