Fudge
05/14/2020, 6:51 PMcompileJava
. Any idea why that could be happening?kapt
on them, but the problem I had still persists :/gildor
05/15/2020, 6:53 AMkapt
, actually I even not sure that compileJava runs Apt, I think Gradle now requires using configuration annotationProcessor
for themFudge
05/16/2020, 9:55 PMcompileJava
you can pass different compiler arguments for each xCompileJava
task for different source sets, how can I do the same with the xKapt
tasks?protected 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));
}
KaptWithKotlincTask
gildor
05/17/2020, 6:37 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