diff --git a/src/main/kotlin/com/beust/kobalt/app/BuildFileCompiler.kt b/src/main/kotlin/com/beust/kobalt/app/BuildFileCompiler.kt index 78395085..47918c44 100644 --- a/src/main/kotlin/com/beust/kobalt/app/BuildFileCompiler.kt +++ b/src/main/kotlin/com/beust/kobalt/app/BuildFileCompiler.kt @@ -61,7 +61,8 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b val parsedBuildFiles = arrayListOf() - class FindProjectResult(val projects: List, val taskResult: TaskResult) + class FindProjectResult(val projects: List, val pluginUrls: List, + val taskResult: TaskResult) private fun findProjects(context: KobaltContext): FindProjectResult { var errorTaskResult: TaskResult? = null @@ -96,7 +97,8 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b } } } - return FindProjectResult(projects, if (errorTaskResult != null) errorTaskResult!! else TaskResult()) + val pluginUrls = parsedBuildFiles.flatMap { it.pluginUrls } + return FindProjectResult(projects, pluginUrls, if (errorTaskResult != null) errorTaskResult!! else TaskResult()) } private fun maybeCompileBuildFile(context: KobaltContext, buildFile: BuildFile, buildScriptJarFile: File, diff --git a/src/main/kotlin/com/beust/kobalt/app/remote/DependencyData.kt b/src/main/kotlin/com/beust/kobalt/app/remote/DependencyData.kt index b5d0d8fb..a7ff91fa 100644 --- a/src/main/kotlin/com/beust/kobalt/app/remote/DependencyData.kt +++ b/src/main/kotlin/com/beust/kobalt/app/remote/DependencyData.kt @@ -32,9 +32,10 @@ class DependencyData @Inject constructor(val executors: KobaltExecutors, val dep val buildFile = BuildFile(Paths.get(buildFilePath), "GetDependenciesCommand") val buildFileCompiler = buildFileCompilerFactory.create(listOf(buildFile), pluginInfo) val projectResult = buildFileCompiler.compileBuildFiles(args) - val pluginUrls = buildFileCompiler.parsedBuildFiles.flatMap { it.pluginUrls } - val pluginDependencies = pluginUrls.map { File(it.toURI()) }.map { FileDependency(it.absolutePath) } + val pluginDependencies = projectResult.pluginUrls.map { File(it.toURI()) }.map { + FileDependency(it.absolutePath) + } projectResult.projects.forEach { project -> val compileDependencies = pluginDependencies.map { toDependencyData(it, "compile") } + allDeps(project.compileDependencies).map { toDependencyData(it, "compile") } +