File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
src/main/kotlin/com/tschuchort/compiletesting Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ dependencies {
3636 // The Kotlin compiler should be near the end of the list because its .jar file includes
3737 // an obsolete version of Guava
3838 api " org.jetbrains.kotlin:kotlin-compiler-embeddable:$embedded_kotlin_version "
39- implementation " org.jetbrains.kotlin:kotlin-annotation-processing-embeddable:$embedded_kotlin_version "
39+ api " org.jetbrains.kotlin:kotlin-annotation-processing-embeddable:$embedded_kotlin_version "
4040}
4141
4242compileKotlin {
Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ class KotlinCompilation : AbstractKotlinCompilation<K2JVMCompilerArguments>() {
5252 /* * Arbitrary arguments to be passed to kapt */
5353 var kaptArgs: MutableMap <OptionName , OptionValue > = mutableMapOf ()
5454
55+ /* * Arbitrary flags to be passed to kapt */
56+ var kaptFlags: MutableSet <KaptFlag > = mutableSetOf ()
57+
5558 /* * Annotation processors to be passed to kapt */
5659 var annotationProcessors: List <Processor > = emptyList()
5760
@@ -370,8 +373,13 @@ class KotlinCompilation : AbstractKotlinCompilation<K2JVMCompilerArguments>() {
370373
371374 it.mode = AptMode .STUBS_AND_APT
372375
373- if (verbose)
374- it.flags.addAll(KaptFlag .MAP_DIAGNOSTIC_LOCATIONS , KaptFlag .VERBOSE )
376+ it.flags.apply {
377+ addAll(kaptFlags)
378+
379+ if (verbose) {
380+ addAll(KaptFlag .MAP_DIAGNOSTIC_LOCATIONS , KaptFlag .VERBOSE )
381+ }
382+ }
375383 }
376384
377385 val compilerMessageCollector = PrintingMessageCollector (
You can’t perform that action at this time.
0 commit comments