From eae780308ca170a8015516a31d24719057d369f9 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Mon, 11 Apr 2016 11:49:40 -0700 Subject: [PATCH] Fix Java source directory. --- .../kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt index dc34f0f2..554e1ea9 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt @@ -313,7 +313,7 @@ open class JvmCompilerPlugin @Inject constructor( // Now that we have all the source directories, find all the source files in them val projectDirectory = File(project.directory) val sourceFiles = if (compiler.canCompileDirectories) { - allSourceDirectories.map { it.path } + allSourceDirectories.map { File(projectDirectory, it.path).path } } else { files.findRecursively(projectDirectory, allSourceDirectories, { file -> sourceSuffixes.any { file.endsWith(it) } }) @@ -341,9 +341,8 @@ open class JvmCompilerPlugin @Inject constructor( } } - val allSources = (sourceFiles + extraSourceFiles).distinct().filter { File(it).exists() }.map { - File(projectDirectory, it).path - } + val allSources = (sourceFiles + extraSourceFiles).distinct().filter { File(it).exists() } + // Finally, alter the info with the compiler interceptors before returning it val initialActionInfo = CompilerActionInfo(projectDirectory.path, classpath, allSources, sourceSuffixes, buildDirectory, emptyList() /* the flags will be provided by flag contributors */)