IC: add destination dir to start of classpath instead of end
Otherwise IC fails when a project declares a class with the same name as in one of its dependencies. The issue is relevant only for non-JPS IC (Gradle, Maven, etc.), but I added the test for JPS too. #KT-20516 fixed
This commit is contained in:
+3
-1
@@ -314,7 +314,9 @@ class IncrementalJvmCompilerRunner(
|
||||
override fun preBuildHook(args: K2JVMCompilerArguments, compilationMode: CompilationMode) {
|
||||
when (compilationMode) {
|
||||
is CompilationMode.Incremental -> {
|
||||
args.classpathAsList += args.destinationAsFile.apply { mkdirs() }
|
||||
val destinationDir = args.destinationAsFile
|
||||
destinationDir.mkdirs()
|
||||
args.classpathAsList = listOf(destinationDir) + args.classpathAsList
|
||||
}
|
||||
is CompilationMode.Rebuild -> {
|
||||
// there is no point in updating annotation file since all files will be compiled anyway
|
||||
|
||||
Reference in New Issue
Block a user