Skip to content

Commit 2360d5f

Browse files
committed
Changed to prepending annotation processor path instead of appending it
to classpath and existing annotation processors.
1 parent 91f7f19 commit 2360d5f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/AnnotationProcessingManager.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class AnnotationProcessingManager(
157157
return kotlinGeneratedDir
158158
}
159159

160-
val kaptProcessorPath get() = javaTask.classpath + setOf(wrappersDirectory) + aptFiles
160+
val kaptProcessorPath get() = setOf(wrappersDirectory) + aptFiles + javaTask.classpath
161161

162162
fun setupKapt() {
163163
originalJavaCompilerArgs = javaTask.options.compilerArgs
@@ -281,7 +281,7 @@ class AnnotationProcessingManager(
281281
javaTask.addCompilerArgument("-processorpath") { prevValue ->
282282
if (prevValue != null)
283283
javaTask.logger.warn("Processor path was modified by kapt. Previous value = $prevValue")
284-
path.joinToString(prefix = prevValue?.let { it + File.pathSeparator }.orEmpty(),
284+
path.joinToString(postfix = prevValue?.let { File.pathSeparator + it }.orEmpty(),
285285
separator = File.pathSeparator)
286286
}
287287
}
@@ -297,7 +297,7 @@ class AnnotationProcessingManager(
297297
if (originalProcessorPath != null)
298298
javaTask.logger.warn("Processor path was modified by kapt. Previous value = $originalProcessorPath")
299299

300-
val newPath = javaTask.project.files(path + (originalProcessorPath ?: emptyList<File>()))
300+
val newPath = javaTask.project.files(path + (originalProcessorPath ?: emptyList()))
301301
setPath(javaTask.options, newPath)
302302
true
303303
} catch (_: NoSuchMethodException) {

0 commit comments

Comments
 (0)