ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <anto...@antbuild.com>
Subject Re: how to create a custom mapper programmatically
Date Fri, 29 Aug 2003 18:56:05 GMT
I have never done it, but looking at the API of Copy, I would do it this way
:

"Matt Koss" <m.koss@tiscali.co.uk> schrieb im Newsbeitrag
news:200308291336.52131.m.koss@tiscali.co.uk...
>
> Let's say I use sth. like this :
>
>     java.io.File srcDir = new java.io.File( archiveDirName );
>     java.io.File destDir = new java.io.File( myPath );
>
>     FileSet fs = new FileSet();
>     fs.setDir( srcDir );
>     FilenameSelector fns = new FilenameSelector();
>     fns.setName("**/*");
>     fs.addFilename( fns );
>     fs.setExcludes( FILE_ARCHIVE_NAME );
>
>
>     Copy copyTask = (Copy) project.createTask( "copy" );
>     copyTask.addFileset( fs );
>     copyTask.setTodir( destDir );
>     copyTask.setIncludeEmptyDirs( true );

     CustomMapper myMapper = new CustomMapper();
       myMapper.setProject(project);
       myMapper.setXYZ(some_custom_attribute);
       ...
       myMapper = copyTask.createMapper();

     copyTask.execute();
>
>
> I would like to ad a definition of the mapper after FileNameSelector /
FileSet
> setup.
>
>
> Cheers
>
> Matt
>
> --
> Matt Koss
>
> e-mail : m.koss@tiscali.co.uk




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


Mime
View raw message