From db15c8ef5b578da71691cd4fc530f432d0806e61 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Thu, 9 Jun 2016 05:37:24 -0800 Subject: [PATCH] Fix the build path. --- .../com/beust/kobalt/internal/CompilerUtils.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/CompilerUtils.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/CompilerUtils.kt index 7a5053b8..fb551133 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/CompilerUtils.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/CompilerUtils.kt @@ -75,12 +75,16 @@ class CompilerUtils @Inject constructor(val files: KFiles, else File(project.classesDir(context)) File(project.directory, buildDirectory.path).mkdirs() + // Remove all the excluded dependencies from the classpath + var classpath = fullClasspath.filter { + ! isDependencyExcluded(it, project.excludedDependencies) + } + // The classpath needs to contain $buildDirectory/classes as well so that projects that contain // multiple languages can use classes compiled by the compiler run before them. - // We also need to remove all the excluded dependencies from the classpath - val classpath = fullClasspath.filter { - ! isDependencyExcluded(it, project.excludedDependencies) - } + FileDependency(buildDirectory.path) + if (buildDirectory.exists()) { + classpath += FileDependency(buildDirectory.path) + } val initialSourceDirectories = ArrayList(sourceDirectories) // Source directories from the contributors