rules_kotlin
rules_kotlin copied to clipboard
Pass javac options to Kapt javacArguments so the javac_options warn='off' option works for annotation processors that print warnings
In our codebase we're using the MapStruct annotation processor which can print out a lot of warnings for unmapped target properties when the annotation processors are run.
Using javac_options with warn = "off"
kt_javac_options(
name = "javac_options",
warn = "off"
)
does not silience these warnings and using javac_options with warn = "error" does not cause errors for these warnings.
The reason is because the javac options were not passed to the Kapt processor invocation. This PR passes the javac_options to the Kapt processor and adds the parameter "-Xlint:none" so the annotation processor warnings are silenced when using warn = "off"