ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject RE: using filesets in a custom task
Date Mon, 04 Aug 2008 21:04:20 GMT

--- EJ Ciramella <ejciramella@upromise.com> wrote:

> The larger problem was, addFileset versus
> addConfiguredFileset.
> 
> Then once that worked (as it would just keep saying
> I have to set the
> "dir" attribute - which was set), then I noticed
> that you could do
> fileset.getDirectoryScanner(getProject()) and from
> that I could do
> ds.getIncludedFiles() and get a string array of the
> files included.  But
> the files included are simply the files, with no
> absolute path.
> 
> I didn't know about the iterator at all (thank you,
> that will clean up
> my code a bit) as I was using the examples found
> here:
> 
>
http://ant.apache.org/manual/tutorial-tasks-filesets-properties.html
> 
> Maybe it's time to update the examples?
> 

That's possible, yes.  :)

-Matt

> -----Original Message-----
> From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
> Sent: Monday, August 04, 2008 4:44 PM
> To: Ant Users List
> Subject: RE: using filesets in a custom task
> 
> 
> --- EJ Ciramella <ejciramella@upromise.com> wrote:
> 
> > Yeah, kinda strange, why would you want a fileset
> > vector of just the
> > File.getName() instead of File.getAbsolutePath()?
> > 
> 
> What exactly are you trying to accomplish?  Beyond
> Ant
> 1.7, it's quite easy to take the iterator() of a
> fileset, knowing it will return FileResource
> elements
> from which you can get the File if you need the
> actual
> File object.  If you are simply reading from or
> writing to the files, you can use the Resources'
> InputStreams/OutputStreams directly.
> 
> -Matt
> 
> > -----Original Message-----
> > From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
> > Sent: Monday, August 04, 2008 3:09 PM
> > To: Ant Users List
> > Subject: RE: using filesets in a custom task
> > 
> > 
> > --- EJ Ciramella <ejciramella@upromise.com> wrote:
> > 
> > > The next bit is how to get the fully qualified
> > path
> > > to the fileset if it
> > > is for a list of files outside of your current
> > > working directory.
> > > 
> > > Any takers?
> > > 
> > 
> > You are using Ant 1.7 or 1.7.1?  By "path to the
> > fileset" you mean basedir?  A fileset's basedir,
> or
> > "dir", is a File object, so by that time you're
> > looking at a plain API call on java.io.File.
> > 
> > -Matt
> > 
> > > -----Original Message-----
> > > From: EJ Ciramella
> > [mailto:ejciramella@upromise.com]
> > > 
> > > Sent: Monday, August 04, 2008 2:56 PM
> > > To: Ant Users List
> > > Subject: RE: using filesets in a custom task
> > > 
> > > Wow - as simple as the difference between
> > > addFileset(FileSet f) and
> > > addConfiguredFileset(FileSet f).
> > > 
> > > 
> > > 
> > > -----Original Message-----
> > > From: EJ Ciramella
> > [mailto:ejciramella@upromise.com]
> > > 
> > > Sent: Monday, August 04, 2008 11:57 AM
> > > To: Ant Users List
> > > Subject: RE: using filesets in a custom task
> > > 
> > > Any other suggestions from anyone?  Why does ant
> > > thing I'm not supplying
> > > the "dir" attribute to the flieset?
> > > 
> > > 
> > > -----Original Message-----
> > > From: EJ Ciramella
> > [mailto:ejciramella@upromise.com]
> > > 
> > > Sent: Friday, August 01, 2008 3:16 PM
> > > To: Ant Users List
> > > Subject: RE: using filesets in a custom task
> > > 
> > > No exceptions, just this:
> > > 
> > > Class m2utils.converters.SnapshotConverter
> loaded
> > > from parent loader
> > > (parentFirst)
> > >  +Datatype snapshotconverter
> > > m2utils.converters.SnapshotConverter
> > > [snapshotconverter] how many filesets? 1
> > > [snapshotconverter] about to process null
> > > 
> > > -----Original Message-----
> > > From: Peters, John
> [mailto:John.Peters@bcbsfl.com]
> > 
> > > Sent: Friday, August 01, 2008 3:13 PM
> > > To: Ant Users List
> > > Subject: RE: using filesets in a custom task
> > > 
> > > Do you have an error message? 
> > > 
> > > -----Original Message-----
> > > From: EJ Ciramella
> > [mailto:ejciramella@upromise.com]
> > > 
> > > Sent: Friday, August 01, 2008 3:10 PM
> > > To: Ant Users List
> > > Subject: RE: using filesets in a custom task
> > > 
> > > It's as simple as this so far:
> > > 
> > > public void addFileset(FileSet fileset) {
> > >     filesets.add(fileset);
> > >     System.out.println("how many filesets?
> > > "+filesets.size());
> > >     for(int x = 0; x < filesets.size(); x++)
> > >     {
> > >     	System.out.println("about to process
> > > "+filesets.get(x).getDir());
> > >     }
> > > }
> > > 
> > > With a matching task of this:
> > > 
> > > <target name="adjust">
> > > 	<taskdef name="snapshotconverter"
> > >
> classname="m2utils.converters.SnapshotConverter"/>
> > > 	<snapshotconverter version="11111111">
> > > 	  	<fileset dir="E:/testing">
> > > 	  	    <include name="**/somefile.xml"/>
> > > 	  	</fileset>
> > > 	</snapshotconverter>
> > > </target>
> > > 
> > > 
> > > 
> > > -----Original Message-----
> > > From: Peters, John
> [mailto:John.Peters@bcbsfl.com]
> > > Sent: Friday, August 01, 2008 3:02 PM
> > > To: Ant Users List
> > > Subject: RE: using filesets in a custom task
> > > 
> > > Post your code please 
> > > 
> > > -----Original Message-----
> > > From: EJ Ciramella
> > [mailto:ejciramella@upromise.com]
> > > Sent: Friday, August 01, 2008 3:00 PM
> > > To: user@ant.apache.org
> > > Subject: using filesets in a custom task
> > > 
> > > I'm struggling to write a custom task that
> > utilizes
> > > filesets.  No matter
> > > what I do, it doesn't seem to set/understand the
> > > "dir" attribute to the
> > > fileset.
> > > 
> > >  
> > > 
> > > Any suggestions?
> > > 
> > > 
> > > 
> > > 
> > > Blue Cross Blue Shield of Florida, Inc., and its
> > > subsidiary and
> > > affiliate companies are not responsible for
> errors
> > > or omissions in this
> > > e-mail message. Any personal comments made in
> this
> > > e-mail do not reflect
> > > the views of Blue Cross Blue Shield of Florida,
> > Inc.
> > >  The information
> > > contained in this document may be confidential
> and
> > > intended solely for
> > > the use of the individual or entity to whom it
> is
> > > addressed.  This
> > > document may contain material that is privileged
> > or
> > > protected from
> > > disclosure under applicable law.  If you are not
> > the
> > > intended recipient
> > > or the individual responsible for delivering to
> > the
> > > intended recipient,
> > > please (1) be advised that any use,
> dissemination,
> > > forwarding, or
> > > copying of this document IS STRICTLY PROHIBITED;
> > and
> > > (2) notify sender
> > > immediately by telephone and destroy the
> document.
> > > THANK YOU.
> > > 
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@ant.apache.org For additional
> > > commands, e-mail: user-help@ant.apache.org
> > > 
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@ant.apache.org For additional
> > > commands, e-mail: user-help@ant.apache.org
> > > 
> > > 
> > > 
> > > 
> > > 
> > > Blue Cross Blue Shield of Florida, Inc., and its
> > > subsidiary and
> > > affiliate companies are not responsible for
> errors
> > > or omissions in this
> > > e-mail message. Any personal comments made in
> this
> > > e-mail do not reflect
> > > the views of Blue Cross Blue Shield of Florida,
> > Inc.
> > >  The information
> > > contained in this document may be confidential
> and
> > > intended solely for
> > > the use of the individual or entity to whom it
> is
> > > addressed.  This
> > > document may contain material that is privileged
> > or
> > > protected from
> > > disclosure under applicable law.  If you are not
> > the
> > > intended recipient
> > > or the individual responsible for delivering to
> > the
> > > intended recipient,
> > > please (1) be advised that any use,
> dissemination,
> > > forwarding, or
> > > copying of this document IS STRICTLY PROHIBITED;
> > and
> > > (2) notify sender
> > > immediately by telephone and destroy the
> document.
> > > THANK YOU.
> > > 
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail:
> > > user-help@ant.apache.org
> > > 
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail:
> > > user-help@ant.apache.org
> > > 
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail:
> > > user-help@ant.apache.org
> > > 
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail:
> > > user-help@ant.apache.org
> > > 
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail:
> > > user-help@ant.apache.org
> > > 
> > > 
> > 
> > 
> > 
> >       
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> > 
> > 
> 
> 
> 
>       
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



      

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


Mime
View raw message