0

For some reason, Kapt complains that incremental compile is not enabled on one of my modules. However, I see no reason why is shouldn't be.

The warning message when running core:kaptKotlin

[WARN] Incremental annotation processing requested, but support is disabled because the following processors are not incremental: io.github.mdsimmo.cmdmsg.TextPreprocessor (NON_INCREMENTAL).

The error shows that io.github.mdsimmo.cmdmsg.TextPreprocessor is the module at fault, but I don't understand why it is not incremental?

I've added kapt.incremental.apt=true in every modules' gradle.properties (although I shouldn't have to since newer kapt version do that by default).

This is CmdMsgProcessor/build.gradle (the module that contains TextPreProcessor):

plugins {
    id 'java'
    id "org.jetbrains.kotlin.jvm" version "1.3.72"
    id "org.jetbrains.kotlin.kapt" version "1.3.72"
    id 'idea'
}

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.+"

    implementation project(":cmdMsg")
    implementation('com.google.auto.service:auto-service:1.0-rc6')
    kapt('com.google.auto.service:auto-service:1.0-rc6')
}

And the cmdMsg/build.gradle (the dependency listed in CmdMsgProcessor/build.gradle)

plugins {
    id 'java'
    id "org.jetbrains.kotlin.jvm" version "1.3.72"
    id 'idea'
}

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.+"
}

What am I missing?

mdsimmo
  • 559
  • 5
  • 16

1 Answers1

0

According to the official guide for kapt,

Currently, annotation processing can be incremental only if all annotation processors being used are incremental.

kapt warns you that io.github.mdsimmo.cmdmsg.TextPreprocessor does not support incremental annotation processing, therefore incremental processing is disabled for the entire build.

Egor
  • 39,695
  • 10
  • 113
  • 130
  • I know. The question is "why is TextPreprocessor not incremental"? (I've edited the question to make that more clear) – mdsimmo Apr 24 '20 at 00:10
  • There's work that needs to be done to make an annotation processor compatible with incremental processing, here's a good reference: https://docs.gradle.org/current/userguide/java_plugin.html#sec:incremental_annotation_processing – Egor Apr 24 '20 at 00:55