Fudge
05/14/2020, 6:51 PMcompileJava
. Any idea why that could be happening?Fudge
05/14/2020, 7:42 PMkapt
on them, but the problem I had still persists :/gildor
05/15/2020, 6:53 AMgildor
05/15/2020, 6:54 AMkapt
, actually I even not sure that compileJava runs Apt, I think Gradle now requires using configuration annotationProcessor
for themFudge
05/16/2020, 10:38 PMprotected void passArgument(KaptTask compileTask, String key, String value) {
// Kapt doesn't provide an api to pass the AP args directly to the task so we need to do this hackery.
CompilerPluginOptions options;
if (compileTask instanceof KaptWithoutKotlincTask) {
KaptWithoutKotlincTask task = (KaptWithoutKotlincTask) compileTask;
// We are now entering the danger zone
//noinspection KotlinInternalInJava aka @ts-ignore
options = task.getProcessorOptions$kotlin_gradle_plugin();
} else {
KaptWithKotlincTask task = (KaptWithKotlincTask) compileTask;
//noinspection KotlinInternalInJava aka @ts-ignore
options = task.getPluginOptions$kotlin_gradle_plugin();
}
options.addPluginArgument(Kapt3KotlinGradleSubplugin.Companion.getKAPT_SUBPLUGIN_ID(), new SubpluginOption(key, value));
}
Fudge
05/16/2020, 11:49 PMKaptWithKotlincTask
Fudge
05/16/2020, 11:50 PMgildor
05/17/2020, 6:37 AMgildor
05/17/2020, 6:39 AMactually I even not sure that compileJava runs AptYes, it does, checked this. But it’s not recommended way and Gradle recommends to have annotation processors separately and use
annotationProcessor
annotation
This behaviour probably can be changed with kapt.include.compile.classpath=true, but it’s not recommendedFudge
05/17/2020, 3:22 PM