I’ve got a problem dragging me for days, the problem is:
in one module dependencies setup
dependencies {
provided fileTree(dir: 'libs', include: ['*.jar'])
}
If all the required jars are in the folder when gradle starts, compileReleaseJava runs fine.
But if the libs folder is initially empty, and I create a copy task which runs before compileReleaseJava to pump all the jars into the libs folder. The compileReleaseJava fails due to no dependencies found
I’ve tried with the following, not working neighter
provided files('libs') {
builtBy 'copyLibs'
}.getAsFileTree().matching{
include '**/*.jar'
}
Look at AbstactCompile.java, some magic happnens with
@InputFiles
public FileCollection getClasspath() {
return classpath;
}
classpath was a file collections of jars if initially the libs are non empty. but I have no idea where is this coming from.
any ideas? any documents systematically tells the big picture of the gradle on execution flow, task creation, task input, listeners, caching mechanism etc
update with info:
gradle 2.4, android plugin 1.2.3
so, it seems the file collection value evaluates at the configuration phase, and after that, it could not change.