Skip to content

Commit eec887d

Browse files
oliviernotteghemerikkerber
authored andcommitted
Fix output getting deleted during 2nd pass of incremental compilation
1 parent 40d6189 commit eec887d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/kotlin/io/bazel/kotlin/builder/tasks/KotlinBuilder.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,17 @@ class KotlinBuilder
292292
argMap.optional(KotlinBuilderFlags.COMPILER_PLUGIN_CLASS_PATH) ?: emptyList(),
293293
)
294294

295+
// Kotlin compiler always requires absolute path for source input in incremental mode
296+
val useAbsolutePath = argMap.optionalSingle(KotlinBuilderFlags.INCREMENTAL_COMPILATION) == "true"
295297
argMap
296298
.optional(KotlinBuilderFlags.SOURCES)
299+
?.map {
300+
if (useAbsolutePath) {
301+
FileSystems.getDefault().getPath(it).toAbsolutePath().toString()
302+
} else {
303+
it
304+
}
305+
}
297306
?.iterator()
298307
?.partitionJvmSources(
299308
{ addKotlinSources(it) },

0 commit comments

Comments
 (0)