开发者

Simple way to enumerate the files in a fileset in phing

开发者 https://www.devze.com 2023-03-31 11:46 出处:网络
I am new to phing and trying to verify if my build.xml work开发者_Python百科s as expected. I am looking for a convenient way to enumerate the files in a phing fileset.

I am new to phing and trying to verify if my build.xml work开发者_Python百科s 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!


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


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:'

0

精彩评论

暂无评论...
验证码 换一张
取 消