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

Fix the “empty source” bug in KobaltServer.

The plug-in needs to send the root of the project, but for now, calculating it from the path of the build file.
This commit is contained in:
Cedric Beust 2017-03-24 13:31:33 -07:00
parent 43346a256d
commit eaaa6fbcef

View file

@ -125,6 +125,8 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v
.map { toDependencyData2("testCompile", it)}
}
val projectRoot = File(buildFilePath).parentFile.parentFile.parentFile
val allTasks = hashSetOf<TaskData>()
projectResult.projects.withIndex().forEach { wi ->
val project = wi.value
@ -136,7 +138,7 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v
// Separate resource from source directories
fun partition(project: Project, dirs: Collection<String>)
= dirs.filter { File(project.directory, it).exists() }
= dirs.filter { File(KFiles.joinDir(projectRoot.absolutePath, project.directory, it)).exists() }
.partition { KFiles.isResource(it) }
val sources = partition(project, project.sourceDirectories)
val tests = partition(project, project.sourceDirectoriesTest)