On Aug 12, 2010, at 8:32 AM, Tomek Kaczanowski wrote:

> Hello All,
> 
> here is the task:
> 
> task copyTestLibBundles () << {
>       copy {
>               from configurations.testJars
>               into someFolder
>       }
> }
> 
> It would be nice to have names of files printed during the copying,
> something like:
> copying a.txt to someFolder
> copying b.txt to someFolder
> 
> what is "the Gradle way" to do it?
> 

You can do
task copyTestLibBundles () << {
        copy {
                from configurations.testJars
                into someFolder
                eachFile { println "Copying ${it.file} to $someFolder" }
        }
}

The parameter passed to eachFile is a FileCopyDetails, so you could use 
${it.name} if you didn't want the whole path to the source.

--
Steve Appling
Automated Logic Research Team




Reply via email to