[I’m using gradle 1.4] and running into behavior that does not meet my expectations and not sure if its a bug or if my expectations are wrong.
I’m stripped this down to a dummy test case:
I have a project with a directory like such:
build.gradle conf/file1.txt conf/inner/file2.txt
And my gradle looks like this:
configurations {
conf
}
dependencies {
conf fileTree(dir: 'conf')
}
task copyDirect(type: Copy) {
from fileTree('conf')
into "${project.buildDir}/conf"
}
task copyFromConfiguration(type: Copy) {
from configurations.conf.getAsFileTree()
into "${project.buildDir}/conf"
}
If I run ‘gradle copyDirect’, my build directory looks like this:
% find build -type f
build/conf/file1.txt
build/conf/inner/file2.txt
But, if I I run the copyFromConfiguration task, it looks like this:
build/conf/file1.txt
build/conf/file2.txt
Essentially it was my understanding that I could call getAsFileTree() on the ‘conf’ configuration file collection and it would preserve the directory structure, but as you can see my ‘inner’ directory has disappeared.
Is there something I’m missing or misunderstanding here, or is this a bug?
Thanks.
Doug