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:
Alexander Udalov
2017-02-03 15:00:52 +03:00
parent 3a7eec8635
commit 57f8ef372f
@@ -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
}