Luke Daley-2 wrote > On a build I'm working on, I effectively need to compare two copy specs in > terms of what files they will copy. This is to verify a business rule that > requires that one copy spec be a subset of the other. > > There's no great way to do this. Really, these things should have been > modelled as FileTrees instead of copy specs but assume for the sake of > argument that such a refactoring is out of the question. > > What I'm looking at at the moment is a custom visitor that walks the copy > spec collecting the input files. I am pretty sure I can get that to work, > but it will be using internal API. I can't see any other way. Doing a > “false” copy to some working space is not an option as the copy is > expensive. > > I've been asked to float the idea of adding something like a method to > CopySpec that gives you the files that will be copied as a FileTree. > Anyone have any opinions on this? I can't really think of another use case > than this kind of validation of rules. > > -- > Luke Daley > Principal Engineer, Gradleware > http://gradleware.com > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email
We needed something similar and used getSource() to get the tree when we used a CopySpec as part of a remote file transfer plugin convention. I think its a useful addition. -- View this message in context: http://gradle.1045684.n5.nabble.com/CopySpec-as-FileTree-tp5710227p5710228.html Sent from the gradle-dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
