On 20/09/2012, at 1:01 PM, rnavarette wrote:

> 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.

I didn't think of getSource(), thank you for the pointer.

-- 
Luke Daley
Principal Engineer, Gradleware 
http://gradleware.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to