import-bot (20212) [Avatar] Offline
#1
[Originally posted by jayds]

I'm just getting my feet wet with ant and have been trying to perform some
simple tasks to help my understanding of it.

One of the things I tried was to echo the contents of a fileset, and I've had
no luck with this. It looks like I could use the ant-contrib <foreach> task to
do this, but I was trying to do it using only tasks shipped with ant.

Is this doable, and if so how?

Thanks,

: jay
import-bot (20212) [Avatar] Offline
#2
Re: newbie: what are the contents of a fileset
[Originally posted by steve_l]

You know, I dont think you can do this.

If you run ant in -verbose, the various tasks tend to list what is going on,
and either that option or -debug will let you see what targets are getting.

You might have to write some new task just to list out a fileset.
import-bot (20212) [Avatar] Offline
#3
Re: newbie: what are the contents of a fileset
[Originally posted by ehatcher]

Look at the <pathconvert> task. It will do the trick here.
import-bot (20212) [Avatar] Offline
#4
Re: newbie: what are the contents of a fileset
[Originally posted by jayds]

Just for reference's sake, here's what I ended up with. I am using this to
create my MANIFEST.MF file on the fly. I needed to get the list of all the jar
files (excluding some) in order to write the Class-Path value in the manifest.

<!-- Get the names of the jar files in the dist directory -->
<target name="get-lib-jar-names" depends="jars-done">
description="Get the names of the jar files in the dist directory">
<!-- Get names of jar files -->
<fileset dir="${dist.dir}" id="lib.jar.files">
<include name="*.jar"/>
<exclude name="*help.jar"/>
<exclude name="*jh.jar"/>
<exclude name="*junit.jar"/>
</fileset>

<!-- Get name of dist directory -->
<path id="dist.dir.absolute" location="${dist.dir}"/>
<pathconvert targetos="windows" property="dist.dir.prop">
refid="dist.dir.absolute"/>

<!-- Get name of jar files without leading directory information -->
<pathconvert targetos="windows" pathsep=" " property="lib.jar.files.prop">
refid="lib.jar.files">
<map from="${dist.dir.prop}" to="" />
</pathconvert>
</target>