Meet "is not incremental" , when use java compile incremental feature in Android Project


(lolobug) #1

I got logs like :
"is not incremental (e.g. outputs have changed, no previous execution, etc.).“
or
"is not incremental. Unable to infer the source directories.”

I just do this:
tasks.withType(JavaCompile) { task ->
task.options.useDepend = true
task.options.incremental = true
}

plus. DataBinding is also being used in my Android project.


(Dimitar Dimitrov) #2

Looks like your task does not declare the inputs and outputs - in that case, Gradle has no way of checking the timestamps and hashes, so it assumes it needs to rebuild.

https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:task_inputs_outputs


(lolobug) #3

But the type of the task is actually JavaCompile. You mean that I need do sth further to declare the inputs and outputs?


(Dimitar Dimitrov) #4

In that case you don’t provide enough information to answer your question. JavaCompile is surely incremental.


(lolobug) #5

Incremental is a incubating feature. What information do you need to figure it out?


(Dimitar Dimitrov) #6

Incremental is a incubating feature.

Incubating or not, incremental compiling works for me and pretty much everybody except you. There is a good chance you are using it wrong.

What information do you need to figure it out?

Dunno, let me think… how about a runnable example that displays the behaviour you see?