From eaaa6fbcef80aad9f95df9a685eff98483125a44 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Fri, 24 Mar 2017 13:31:33 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20the=20=E2=80=9Cempty=20source=E2=80=9D=20?= =?UTF-8?q?bug=20in=20KobaltServer.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The plug-in needs to send the root of the project, but for now, calculating it from the path of the build file. --- .../com/beust/kobalt/app/remote/RemoteDependencyData.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/beust/kobalt/app/remote/RemoteDependencyData.kt b/src/main/kotlin/com/beust/kobalt/app/remote/RemoteDependencyData.kt index 68bb5914..5d2011f0 100644 --- a/src/main/kotlin/com/beust/kobalt/app/remote/RemoteDependencyData.kt +++ b/src/main/kotlin/com/beust/kobalt/app/remote/RemoteDependencyData.kt @@ -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() 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) - = 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)