CompileDebugJava is not incremental. Unable to list source directories
Since Gradle 2.1, incremental compilation of Java source is now supported check this
I used below code snippet to include it
afterEvaluate {
android.applicationVariants.each { variant ->
variant.javaCompile.options.incremental = true
}
}
But I am getting below warning message,
: Application: compileDebugJava - not incremental. Cannot infer about the source of the directories.
Please suggest me what to do to get rid of it.
source to share
Yes, there is a problem for the Android Build plugin, read here:
We are using custom sources, so this is unlikely to be fixed until we can stop using them.
http://code.google.com/p/android/issues/detail?id=82411 and is mentioned here
https://discuss.gradle.org/t/faster-incremental-builds/552/10
When it's fixed, use this for Android
, add this to allProjects
:
allProjects {
tasks.withType(JavaCompile) {
configure(options) {
incremental = true
}
}
}
If you see this, you must first create your project:
compileDebugJava - not incremental (e.g. outputs changed, no previous execution, etc.).
If you see this, the wrong one is being sourceSets
used according to isse (see link):
compileDebugJava is not incremental. Unable to output the source directories.
From my example for projects Java
:
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
source to share