diff --git a/build-common/src/org/jetbrains/kotlin/incremental/buildUtil.kt b/build-common/src/org/jetbrains/kotlin/incremental/buildUtil.kt index 24cbc8b829f..8b50223288a 100644 --- a/build-common/src/org/jetbrains/kotlin/incremental/buildUtil.kt +++ b/build-common/src/org/jetbrains/kotlin/incremental/buildUtil.kt @@ -47,7 +47,10 @@ fun makeModuleFile( builder.addModule( name, outputDir.absolutePath, - sourcesToCompile, + // important to transform file to absolute paths, + // otherwise compiler will use module file's parent as base path (a temporary file; see below) + // (see org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.getAbsolutePaths) + sourcesToCompile.map { it.absoluteFile }, javaSourceRoots, classpath, null,