ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Bailey" <ch...@codeintensity.com>
Subject RE: How to get just the file/dir name from a FileSet item?
Date Wed, 14 Aug 2002 06:39:09 GMT
I dunno, it seems to work :)  I do this:

  <foreach target="-antntservice" param="service.dir">
    <fileset dir="${src}/windows/service/services" includes="*"/>
  </foreach>

Since the only things in the .../service/services directory are other
directories, I assume it's matching those with the "*".  It is working that
way anyway.

In my -antntservice target I then do:

  <basename property="service.name" file="${service.dir}"/>
  <ant antfile="build_service.xml" target="${target}">
    <property name="service" value="${service.name}" />
  </ant>

-----Original Message-----
From: Diane Holt [mailto:holtdl@yahoo.com]
Sent: Tuesday, August 13, 2002 11:24 PM
To: Ant Users List
Subject: RE: How to get just the file/dir name from a FileSet item?


--- Chris Bailey <chris@codeintensity.com> wrote:
> Ah, perfect, <basename> was all I needed, not sure why I'd missed that
> scanning through the tasks, but thanks!  I knew this could be done
> easily.
>
> Note, I can't use a DirSet because ForEach doesn't support it, otherwise
> I would be.  Probably something that should be fixed...

Yeah, but <fileset> won't get you a set of directories -- it'll get you a
set of files. And <basename> will end up giving you the name of each file
in the fileset, not the last directory element (since you're not feeding
it a directory name, but rather, a filename). So I don't see how that's
going to do it for you. Seems to me you'd need to go through several
additional steps to get from a fileset to a list of base dir names to loop
through. (Then again, I'm sleep-deprived so maybe I'm just missing it, and
you're actually fine with using it.)

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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



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


Mime
View raw message