From 02f94490507e2acc778e7bea340551b6cac1f819 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Fri, 18 Dec 2015 15:45:40 -0800 Subject: [PATCH] Forward slashes fix. --- .../kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 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 c5f2a3f7..16836248 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 @@ -136,7 +136,7 @@ abstract class JvmCompilerPlugin @Inject constructor( fun isOutdated(project: Project, context: KobaltContext, actionInfo: CompilerActionInfo) : Boolean { fun stripSourceDir(sourceFile: String) : String { project.sourceDirectories.forEach { - val d = KFiles.joinDir(project.directory, it) + val d = listOf(project.directory, it).joinToString("/") if (sourceFile.startsWith(d)) return sourceFile.substring(d.length + 1) } throw KobaltException("Couldn't strip source dir from $sourceFile") @@ -150,7 +150,7 @@ abstract class JvmCompilerPlugin @Inject constructor( fun toClassFile(sourceFile: String) = stripSuffix(sourceFile) + ".class" - actionInfo.sourceFiles.forEach { sourceFile -> + actionInfo.sourceFiles.map { it.replace("\\", "/") }.forEach { sourceFile -> val stripped = stripSourceDir(sourceFile) val classFile = File(KFiles.joinDir(project.directory, project.classesDir(context), toClassFile(stripped))) if (! classFile.exists() || File(sourceFile).lastModified() > classFile.lastModified()) {