Report different runtime versions earlier than incompatibility with API version
Previously if you had kotlin-reflect 1.0 and kotlin-runtime 1.1 in the classpath, checkCompatibleWithApiVersion was invoked first, and an error was reported that suggested to pass "-api-version" to the compiler. However, no correct "-api-version" can be passed in this case, because checkMatchingVersions would then report that the two libraries have different versions anyway. So, now we first ensure that all libraries have the same version, and only then do check if the version is correct
This commit is contained in:
+4
-4
@@ -176,14 +176,14 @@ object JvmRuntimeVersionsConsistencyChecker {
|
||||
checkNotNewerThanCompiler(messageCollector, it)
|
||||
}.any { it }) return ClasspathConsistency.InconsistentWithCompilerVersion
|
||||
|
||||
if (runtimeJarsInfo.jars.map {
|
||||
checkCompatibleWithApiVersion(messageCollector, it, apiVersion)
|
||||
}.any { it }) return ClasspathConsistency.InconsistentWithApiVersion
|
||||
|
||||
if (checkMatchingVersions(messageCollector, runtimeJarsInfo)) {
|
||||
return ClasspathConsistency.InconsistentBecauseOfRuntimesWithDifferentVersions
|
||||
}
|
||||
|
||||
if (runtimeJarsInfo.jars.map {
|
||||
checkCompatibleWithApiVersion(messageCollector, it, apiVersion)
|
||||
}.any { it }) return ClasspathConsistency.InconsistentWithApiVersion
|
||||
|
||||
return ClasspathConsistency.Consistent
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user