Yes, there is an issue for Android Build Plugin, read here:
We use custom sourceset so this is unlikely to be fixed until we can
stop using them.
http://code.google.com/p/android/issues/detail?id=82411 and mentioned here
https://discuss.gradle.org/t/faster-incremental-builds/552/10
When it is fixed, use this for Android
, add this in allProjects
:
allProjects {
tasks.withType(JavaCompile) {
configure(options) {
incremental = true
}
}
}
If you see this, you must build your project first:
compileDebugJava - is not incremental (e.g. outputs have changed, no
previous execution, etc.).
If you see this, the wrong sourceSets
are being used according to the isse(see link):
compileDebugJava - is not incremental. Unable to infer the source directories.
From their example for Java
projects:
apply plugin: 'java'
compileJava {
//enable compilation in a separate daemon process
options.fork = true
//enable incremental compilation
options.incremental = true
}
Source: http://gradle.org/docs/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html