1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-06-16 13:20:52 -07:00

Merge pull request #413 from dmitry-zhuravlev/master

+ server should send buildFileClasspath to plugin. close #410
This commit is contained in:
Cedric Beust 2017-04-17 08:26:04 -07:00 committed by GitHub
commit dcdbbdc6c3
3 changed files with 7 additions and 1 deletions

View file

@ -116,6 +116,7 @@ fun buildFileClasspath(vararg deps: String) {
} }
fun newBuildFileClasspath(vararg deps: String) { fun newBuildFileClasspath(vararg deps: String) {
//FIXME newBuildFileClasspath called twice
deps.forEach { Kobalt.addBuildFileClasspath(it) } deps.forEach { Kobalt.addBuildFileClasspath(it) }
} }

View file

@ -135,6 +135,7 @@ class Kobalt {
fun cleanUp() { fun cleanUp() {
buildSourceDirs.clear() buildSourceDirs.clear()
buildFileClasspath.clear()
} }
} }
} }

View file

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