Do not show duplicated error gradle templates in settings
^KT-34530 Fixed
This commit is contained in:
+6
-5
@@ -77,7 +77,7 @@ class GradleScriptDefinitionsContributor(private val project: Project) : ScriptD
|
|||||||
|
|
||||||
failedToLoad.set(false)
|
failedToLoad.set(false)
|
||||||
|
|
||||||
val kotlinDslTemplates = LinkedHashSet<ScriptDefinition>()
|
val kotlinDslTemplates = ArrayList<ScriptDefinition>()
|
||||||
|
|
||||||
loadGradleTemplates(
|
loadGradleTemplates(
|
||||||
templateClass = "org.gradle.kotlin.dsl.KotlinInitScript",
|
templateClass = "org.gradle.kotlin.dsl.KotlinInitScript",
|
||||||
@@ -102,12 +102,12 @@ class GradleScriptDefinitionsContributor(private val project: Project) : ScriptD
|
|||||||
|
|
||||||
|
|
||||||
if (kotlinDslTemplates.isNotEmpty()) {
|
if (kotlinDslTemplates.isNotEmpty()) {
|
||||||
return kotlinDslTemplates.asSequence()
|
return kotlinDslTemplates.distinct().asSequence()
|
||||||
}
|
}
|
||||||
|
|
||||||
val default = tryToLoadOldBuildScriptDefinition()
|
val default = tryToLoadOldBuildScriptDefinition()
|
||||||
if (default.isNotEmpty()) {
|
if (default.isNotEmpty()) {
|
||||||
return default.asSequence()
|
return default.distinct().asSequence()
|
||||||
}
|
}
|
||||||
|
|
||||||
return sequenceOf(ErrorGradleScriptDefinition())
|
return sequenceOf(ErrorGradleScriptDefinition())
|
||||||
@@ -261,9 +261,10 @@ class GradleScriptDefinitionsContributor(private val project: Project) : ScriptD
|
|||||||
)
|
)
|
||||||
|
|
||||||
override fun toString(): String = "ErrorGradleScriptDefinition"
|
override fun toString(): String = "ErrorGradleScriptDefinition"
|
||||||
override fun equals(other: Any?): Boolean = other is ErrorGradleScriptDefinition
|
|
||||||
override fun hashCode(): Int = name.hashCode()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun equals(other: Any?): Boolean = other is ErrorGradleScriptDefinition
|
||||||
|
override fun hashCode(): Int = name.hashCode()
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ErrorScriptDependenciesResolver(private val message: String? = null) : DependenciesResolver {
|
private class ErrorScriptDependenciesResolver(private val message: String? = null) : DependenciesResolver {
|
||||||
|
|||||||
Reference in New Issue
Block a user