On Thu, May 12, 2011 at 7:07 AM, Sean Van Buggenum <[email protected]> wrote:
> Hi all, > > I notice in my googling that there used to be a remapTarget directive of > the Copy (and probably zip) tasks. > That has since been removed, and while some have said some version of it > will reappear > > http://gradle.1045684.n5.nabble.com/CopySpec-remapTarget-is-gone-td1436423.html > I haven't really seen something that I recognize as something that will do > the flattening of directory structure that I need. > > I do something like this: copy { ... eachFile { FileCopyDetails copyDetails -> def source = copyDetails.relativePath def replacedPath = source.toString().replace("somename", "replacement") copyDetails.relativePath = RelativePath.parse(source.isFile(), replacedPath) } } It works, but it is only invoked for files and so empty folders are created at the originally intended destination. Not sure how else to do it, but I would love to know! Cheers, Jesper
