我的build.xml中有以下目标,准备由Phing处理:
<target name="syntax-test">
<exec command="git diff --cached --name-only --diff-filter=ACMRTUXB" dir="./" escape="false" output="${TMP_DIR}/changed_files" />
<fileset id="CHANGED_FILES" dir="./" includesfile="${TMP_DIR}/changed_files" />
</exec>
<phplint haltonfailure="true" level="warning" deprecatedAsError="true">
<fileset refid="CHANGED_FILES" />
</phplint>
</target>由于我有许多工具,我只想在所有文件的小子集之上运行这些工具--只对那些被添加/修改/等的文件运行,所以我需要过滤这些工具。
这个很好用。
每个工具都非常具体,只能用于检查特定的文件(比如phplint用于检查.php或xmllint用于检查.xml)。
我怎么过滤掉这些?
当我试图应用模式集或时,似乎只能使用新规则(忽略参数)。
发布于 2012-08-06 05:38:31
当FileSet接受文件名作为嵌套标记时,您可以使用它:
<fileset id="CHANGED_FILES" dir="./" includesfile="${TMP_DIR}/changed_files">
<filename name="**/*.php" />
</fileset>发布于 2013-09-05 09:16:27
对我来说,工作是*.php而不是*/*..php
<fileset id="CHANGED_FILES" dir="./" includesfile="${TMP_DIR}/changed_files">
<filename name="**.php" />
</fileset>https://stackoverflow.com/questions/11819359
复制相似问题