1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-25 16:07:12 -07:00

+ server should send buildFileClasspath to plugin. close #410

This commit is contained in:
Dmitry Zhuravlev 2017-04-14 17:18:16 +03:00
parent 5ddc370521
commit 5d11395b7c
2 changed files with 6 additions and 1 deletions

View file

@ -68,6 +68,7 @@ class Kobalt {
fun addBuildFileClasspath(dep: String) {
val dependencyManager = Kobalt.INJECTOR.getInstance(DependencyManager::class.java)
//FIXME buildFileClasspath collection never becomes clear! each synchronization will add the same dependencies to it
buildFileClasspath.add(dependencyManager.create(dep))
}

View file

@ -2,6 +2,7 @@ package com.beust.kobalt.app.remote
import com.beust.kobalt.Args
import com.beust.kobalt.api.IClasspathDependency
import com.beust.kobalt.api.Kobalt
import com.beust.kobalt.api.Project
import com.beust.kobalt.app.BuildFileCompiler
import com.beust.kobalt.internal.DynamicGraph
@ -46,6 +47,8 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v
val buildFileCompiler = buildFileCompilerFactory.create(buildSources, pluginInfo)
val projectResult = buildFileCompiler.compileBuildFiles(args)
val buildFileDependencies = Kobalt.buildFileClasspath.map {toDependencyData(it, "compile")}
val pluginDependencies = projectResult.pluginUrls.map { File(it.toURI()) }.map {
DependencyData(it.name, "compile", it.absolutePath)
}
@ -176,7 +179,7 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v
})
}
return GetDependenciesData(projectDatas, allTasks, pluginDependencies, findProjectResult.buildContentRoots,
return GetDependenciesData(projectDatas, allTasks, pluginDependencies, buildFileDependencies, findProjectResult.buildContentRoots,
projectResult.taskResult.errorMessage)
}
@ -202,6 +205,7 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v
class GetDependenciesData(val projects: List<ProjectData> = emptyList(),
val allTasks: Collection<TaskData> = emptySet(),
val pluginDependencies: List<DependencyData> = emptyList(),
val buildFileDependencies: List<DependencyData> = emptyList(),
val buildContentRoots: List<String> = emptyList(),
val errorMessage: String?) {
companion object {