From c8d6ab9af02b1cfd718210adfd122bb8d7063ce9 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Wed, 9 Dec 2015 09:52:05 -0800 Subject: [PATCH] Build into test-classes dir. --- .../kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt b/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt index 70880215..cd4d5ae4 100644 --- a/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt +++ b/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt @@ -179,7 +179,8 @@ abstract class JvmCompilerPlugin @Inject constructor( dependencyManager.dependencies(project, context, projects) val projectDirectory = File(project.directory) - val buildDirectory = File(project.classesDir(context)) + val buildDirectory = if (isTest) KFiles.makeOutputTestDir(project) + else File(project.classesDir(context)) buildDirectory.mkdirs() val initialSourceDirectories = arrayListOf() @@ -199,7 +200,7 @@ abstract class JvmCompilerPlugin @Inject constructor( context.pluginInfo.sourceDirectoriesInterceptors.fold(initialSourceDirectories.toList(), { sd, interceptor -> interceptor.intercept(project, context, sd) }) }.filter { - it.exists() + File(project.directory, it.path).exists() } // Now that we have the final list of source dirs, find source files in them