From 3c511f3f404420083e699eb8d17732a6457a012a Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Wed, 14 Jun 2017 18:42:00 +0300 Subject: [PATCH] KSCM: temporary workaround gradle returning results in unstable order --- .../idea/core/script/KotlinScriptConfigurationManager.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/idea/idea-core/src/org/jetbrains/kotlin/idea/core/script/KotlinScriptConfigurationManager.kt b/idea/idea-core/src/org/jetbrains/kotlin/idea/core/script/KotlinScriptConfigurationManager.kt index 4ddb6c9bbf0..7953d7f4cb8 100644 --- a/idea/idea-core/src/org/jetbrains/kotlin/idea/core/script/KotlinScriptConfigurationManager.kt +++ b/idea/idea-core/src/org/jetbrains/kotlin/idea/core/script/KotlinScriptConfigurationManager.kt @@ -287,8 +287,10 @@ private class ClearableLazyValue(private val lock: ReentrantReadWri } } +// TODO: relying on this to compare dependencies seems wrong, doesn't take javaHome and other stuff into account private fun KotlinScriptExternalDependencies.match(other: KotlinScriptExternalDependencies) - = classpath.isSamePathListAs(other.classpath) && sources.isSamePathListAs(other.sources) + = classpath.isSamePathListAs(other.classpath) && + sources.toSet().isSamePathListAs(other.sources.toSet()) // TODO: gradle returns stdlib and reflect sources in unstable order for some reason private fun Iterable.isSamePathListAs(other: Iterable): Boolean =