First put a the following init.d gradle script in ${HOME}/.gradle/init.d/ (currently in build.gradle but not working in init):
allprojects {
tasks.withType(Compile) { // Use JavaCompile for gradle > 2.0
options.compilerArgs << "-Xlint:deprecation"
}
task printDependencies << {task -> println "Subproject -> $task.project.name" }
}
subprojects {
ext.versionfile = new File('CLASSPATH_AUX')
versionfile.text = ''
printDependencies {
afterEvaluate { Project project ->
if (configurations.find { it.name == 'compile' }) {
doLast {
println "$project.configurations.compile.asPath\n"
versionfile.text += "$project.configurations.compile.asPath" + ':'
}
}
if (configurations.find { it.name == 'androidTestCompile' }) {
doLast {
println "$project.configurations.androidTestCompile.asPath\n"
versionfile.text += "$project.configurations.androidTestCompile.asPath" + ':'
}
}
}
}
}
Then run:
source fill_classpath.sh
Although not strictly vim you may run in a parallel shell:
while true; do inotifywait -e close_write **/*.java **/*.gradle **/*.xml; ./gradlew iDebug; done