3

I am new to phing and trying to verify if my build.xml works as expected. I am looking for a convenient way to enumerate the files in a phing fileset.

The only thing that I've been able to get working is foreach (like in how to iterate (loop) through directories in phing?). However, it feels way too complex: I have to create a subtask, and phing gets called once for every file, making the outupt list hard to parse visually.

Any better alternatives? Thanks!

Community
  • 1
  • 1
xverges
  • 4,608
  • 1
  • 39
  • 60

2 Answers2

4

With Phing 2.4.8, the <echo> task supports filesets: http://www.phing.info/trac/ticket/792

cweiske
  • 30,033
  • 14
  • 133
  • 194
  • 1
    Awesome! A ticket by itself would have been great and beyond all expectations. A ticket and an accepted patch cannot get better. Impressed. Happy. Thanks a lot. Happy. Really. Very happy. Very grateful. – xverges Nov 14 '11 at 09:29
3

There is currently no better way. You could grep the output, though :)

<task name="dummy">
  <foreach param="filename" absparam="absfilename" target="echoFilesetFile">
    <fileset refid="co"/>
  </foreach>
</task>

<target name="echoFilesetFile">
  <echo>file: rel:${filename}|abs:${absfilename}</echo>
</target>

then $ phing dummy | grep 'file:'

cweiske
  • 30,033
  • 14
  • 133
  • 194