ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <anto...@gmx.de>
Subject Re: Get copied fileset
Date Fri, 23 Feb 2007 22:38:53 GMT
Hello James,

there is no direct way to extract from the copy task these files.

what do you want to do once you have found the set of files which are getting copied.

Some tasks work with filesets and mappers. 

Applying a mapper to the "new.files" fileset will give you what you want.

Also have a look at the possibilities offered by resource collections in ant 1.7. They contain
a lot of nice stuff such as intersection ...

Regards,

Antoine


-------- Original-Nachricht --------
Datum: Fri, 23 Feb 2007 14:06:29 -0700
Von: "James Oltmans" <joltmans@bolosystems.com>
An: user@ant.apache.org
CC: 
Betreff: Get copied fileset

> Is there any way to create a fileset from the copy task that lists the
> files that were copied into the todir?
> 
>  
> 
> Here's the code snippet:
> 
> ------------------------------------------------------------------------
> ----------------------
> 
>             <fileset id="new.files"
> 
>                      dir="${tempdir}">
> 
>                 <exclude name="**/.svn/**"/>
> 
>                 <present present="srconly"
> 
>                          targetdir="${repos-files}"/>
> 
>             </fileset>
> 
>  
> 
>             <!--Copy new files into the repository's directory-->
> 
>             <copy todir="${repos-files}"
> 
>                   verbose="true"
> 
>                   includeEmptyDirs="true"
> 
>                   preservelastmodified="true">
> 
>                 <fileset refid="new.files"/>
> 
>             </copy>
> 
> ------------------------------------------------------------------------
> ----------------------
> 
> Is there any way I can get a list that has the new.files that were
> copied to repos-files with their full new path?
> 
> For example if I had two directories as follows and my fileset from
> above captured all the files in dir1 and copied them to dir2. 
> 
> Before copy:
> 
> /home/user/project/dir1/
> 
>             file1
> 
>             file2
> 
>             file3
> 
> /home/user/project/dir2/
> 
>             file4
> 
>             file5
> 
> After copy:
> 
> /home/user/project/dir1/
> 
>             file1
> 
>             file2
> 
>             file3
> 
> /home/user/project/dir2/
> 
>             file1
> 
>             file2
> 
>             file3
> 
>             file4
> 
>             file5
> 
> new.files would contain the following:
> 
> /home/user/project/dir1/file1
> 
> /home/user/project/dir1/file2
> 
> /home/user/project/dir1/file3
> 
>  
> 
> But I'd LIKE to get a new fileset that contains the following:
> 
> /home/user/project/dir2/file1
> 
> /home/user/project/dir2/file2
> 
> /home/user/project/dir2/file3
> 
>  
> 
> This would help because I could then perform other actions on the copied
> files (specifically a svn add command) but I have no idea how to get
> this second fileset without using java. Is this something mappings could
> help with?
> 
>  
> 
> James Oltmans
> Software Engineer
> Bolo Systems, Inc. 
> joltmans@bolosystems.com
> 
>  
> 
>  
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message