From 56f59fc858472107b57cba6db6f34c00ef8676a2 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Sat, 26 Dec 2015 00:17:41 +0400 Subject: [PATCH] Only run the interceptors if there are any. Otherwise, we always clear the interceptors. --- src/main/kotlin/com/beust/kobalt/Main.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/Main.kt b/src/main/kotlin/com/beust/kobalt/Main.kt index ac32669d..246c09d1 100644 --- a/src/main/kotlin/com/beust/kobalt/Main.kt +++ b/src/main/kotlin/com/beust/kobalt/Main.kt @@ -243,9 +243,13 @@ private class Main @Inject constructor( private fun runClasspathInterceptors(project: Project, dependencies: ArrayList) = with(dependencies) { - val deps = interceptDependencies(project, pluginInfo, this) - clear() - addAll(deps) + if (pluginInfo.classpathInterceptors.size > 0) { + val deps = interceptDependencies(project, pluginInfo, this) + clear() + addAll(deps) + } else { + this + } } private fun interceptDependencies(project: Project, pluginInfo: PluginInfo,