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

GH-413: Duplicate compilation.

Fixes https://github.com/cbeust/kobalt/pull/413
This commit is contained in:
Cedric Beust 2017-04-17 08:38:53 -07:00
parent dcdbbdc6c3
commit 0938bcc3bf

View file

@ -30,7 +30,7 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v
val taskManager: TaskManager) { val taskManager: TaskManager) {
fun dependenciesDataFor(buildSources: BuildSources, args: Args, fun dependenciesDataFor(buildSources: BuildSources, args: Args,
findProjectResult: BuildFileCompiler.FindProjectResult, projectResult: BuildFileCompiler.FindProjectResult,
progressListener: IProgressListener? = null, progressListener: IProgressListener? = null,
useGraph : Boolean = false): GetDependenciesData { useGraph : Boolean = false): GetDependenciesData {
val projectDatas = arrayListOf<ProjectData>() val projectDatas = arrayListOf<ProjectData>()
@ -43,10 +43,6 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v
fun allDeps(l: List<IClasspathDependency>, name: String) = dependencyManager.transitiveClosure(l, fun allDeps(l: List<IClasspathDependency>, name: String) = dependencyManager.transitiveClosure(l,
requiredBy = name) requiredBy = name)
// val buildFile = BuildFile(Paths.get(buildFilePath), "GetDependenciesCommand")
val buildFileCompiler = buildFileCompilerFactory.create(buildSources, pluginInfo)
val projectResult = buildFileCompiler.compileBuildFiles(args)
val buildFileDependencies = Kobalt.buildFileClasspath.map {toDependencyData(it, "compile")} 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 {
@ -179,8 +175,8 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v
}) })
} }
return GetDependenciesData(projectDatas, allTasks, pluginDependencies, buildFileDependencies, findProjectResult.buildContentRoots, return GetDependenciesData(projectDatas, allTasks, pluginDependencies, buildFileDependencies,
projectResult.taskResult.errorMessage) projectResult.buildContentRoots, projectResult.taskResult.errorMessage)
} }
///// /////