4

我想为一些插件创建 phing 任务,所以目录结构类似于

root
  - plugin1
    - index.php
  - plugin2
    - index.php

ETC..

我想在每个子目录上运行相同的任务 - 例如

  1. 为 plugin1 生成文档
  2. 为 plugin1 运行单元测试
  3. 在某处部署plugin1
  4. 为plugnin2生成文档...

这可能吗?我需要类似的东西

<foreach param="filename" absparam="absfilename" target="subtask">
  <fileset dir=".">
    <include name="*.php"/>
  </fileset>
</foreach>

但对于目录。

或者我必须为每个插件独立编写 build.xml 吗?

非常感谢。

4

1 回答 1

13

最后我发现了可以解决我的请求的选择器:

<foreach param="dirname" absparam="absname" target="subtask">
  <fileset dir="${ws}/source/">
        <type type="dir" />
        <depth max="0" min="0" />
  </fileset>
</foreach>

并调用一些任务来做事

<target name="subtask">
    <echo msg="${dirname} ${absname}" />
</target>
于 2010-12-16T10:08:36.173 回答