Closed GavinRay97 closed 1 month ago
Thanks for your PR! Does this fix the issue you were having in #385, i.e. did you confirm that the options are actually passed to kapt correctly? It would be good to have at least one test to exercise this, but --enable-preview
probably can't be used because it is not available in earlier JDK versions. Perhaps it is sufficient to search the logs for javac options passed to kapt.
No problem =)
Does this fix the issue you were having in https://github.com/tschuchortdev/kotlin-compile-testing/issues/385, i.e. did you confirm that the options are actually passed to kapt correctly?
It does, the code runs without issue after this patch 👍
It would be good to have at least one test to exercise this, but --enable-preview probably can't be used because it is not available in earlier JDK versions.
I thought about adding a test but like you said, it would mean forcing the JDK to something like a minimum of JDK 17 or so for --enable-preview
Perhaps it is sufficient to search the logs for javac options passed to kapt.
Good idea -- this sounds reasonable to me 👍
Passes
javacArguments
option through to Kapt. This is required for code which uses things like--enable-preview
or--add-opens
(Closes: https://github.com/tschuchortdev/kotlin-compile-testing/issues/385)
Kapt requires a
Map<String, String>
for it'sjavac
arguments, so convert it from aList<String>
See the function working here: