From 11107fd3fef8372d804c0b95b388f310357f58c0 Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Wed, 17 Aug 2016 20:40:55 +0300 Subject: [PATCH] Use target of current module when find libraries with incompatible binary format #KT-12977 Fixed (cherry picked from commit d975f21) --- ...supportedAbiVersionNotificationPanelProvider.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.kt b/idea/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.kt index c55599c9983..31589404c6f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.kt +++ b/idea/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.kt @@ -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"); * 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.getRuntimeJar import org.jetbrains.kotlin.idea.framework.getTestJar +import org.jetbrains.kotlin.idea.project.ProjectStructureUtil.isJsKotlinModule import org.jetbrains.kotlin.serialization.deserialization.BinaryVersion import java.awt.event.ComponentAdapter import java.awt.event.ComponentEvent @@ -334,12 +335,15 @@ class UnsupportedAbiVersionNotificationPanelProvider(private val project: Projec } fun collectBadRoots(module: Module): Collection> { - val badJVMRoots = getLibraryRootsWithAbiIncompatibleKotlinClasses(module) - val badJSRoots = getLibraryRootsWithAbiIncompatibleForKotlinJs(module) + val badRoots = + 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() } } }