Use target of current module when find libraries with incompatible binary format

#KT-12977 Fixed
(cherry picked from commit d975f21)
This commit is contained in:
Zalim Bashorov
2016-08-17 20:40:55 +03:00
committed by Zalim Bashorov
parent 1926825019
commit 11107fd3fe
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2015 JetBrains s.r.o. * Copyright 2010-2016 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -51,6 +51,7 @@ import org.jetbrains.kotlin.idea.framework.getJsStdLibJar
import org.jetbrains.kotlin.idea.framework.getReflectJar import org.jetbrains.kotlin.idea.framework.getReflectJar
import org.jetbrains.kotlin.idea.framework.getRuntimeJar import org.jetbrains.kotlin.idea.framework.getRuntimeJar
import org.jetbrains.kotlin.idea.framework.getTestJar import org.jetbrains.kotlin.idea.framework.getTestJar
import org.jetbrains.kotlin.idea.project.ProjectStructureUtil.isJsKotlinModule
import org.jetbrains.kotlin.serialization.deserialization.BinaryVersion import org.jetbrains.kotlin.serialization.deserialization.BinaryVersion
import java.awt.event.ComponentAdapter import java.awt.event.ComponentAdapter
import java.awt.event.ComponentEvent import java.awt.event.ComponentEvent
@@ -334,12 +335,15 @@ class UnsupportedAbiVersionNotificationPanelProvider(private val project: Projec
} }
fun collectBadRoots(module: Module): Collection<BinaryVersionedFile<BinaryVersion>> { fun collectBadRoots(module: Module): Collection<BinaryVersionedFile<BinaryVersion>> {
val badJVMRoots = getLibraryRootsWithAbiIncompatibleKotlinClasses(module) val badRoots =
val badJSRoots = getLibraryRootsWithAbiIncompatibleForKotlinJs(module) if (!isJsKotlinModule(module))
getLibraryRootsWithAbiIncompatibleKotlinClasses(module)
else
getLibraryRootsWithAbiIncompatibleForKotlinJs(module)
if (badJVMRoots.isEmpty() && badJSRoots.isEmpty()) return emptyList() if (badRoots.isEmpty()) return emptyList()
return (badJVMRoots + badJSRoots).toHashSet() return badRoots.toHashSet()
} }
} }
} }