プロジェクト ベースの直下の各ディレクトリで実行したい phing ビルド ターゲットがあります。ファイルセットで foreach タスクを使用して、各ディレクトリでターゲットを実行しています。私が抱えている問題は、ファイル名が「」のベースディレクトリが含まれていることです。
ディレクトリ構造の例を次に示します。
One
Two
build.xml
テストする簡単なビルド ファイルを次に示します。
<?xml version="1.0" encoding="UTF-8"?>
<project name="Test" default="test">
<target name="test">
<foreach param="filename" absparam="absfilename" target="echo-file">
<fileset dir="${project.basedir}">
<include name="*" />
<exclude name="*.*" />
</fileset>
</foreach>
</target>
<target name="echo-file">
<echo message="filename: ${filename}" />
<echo message="absfilename: ${absfilename}" />
</target>
</project>
ビルドの結果は次のとおりです (ファイル名が空の最初のエントリに注意してください)。
Buildfile: /Users/dmertl/test/build.xml
Test > test:
[foreach] Calling Buildfile '/Users/dmertl/test/build.xml' with target 'echo-file'
Test > echo-file:
[echo] filename:
[echo] absfilename: /Users/dmertl/test/
[foreach] Calling Buildfile '/Users/dmertl/test/build.xml' with target 'echo-file'
Test > echo-file:
[echo] filename: One
[echo] absfilename: /Users/dmertl/test/One
[foreach] Calling Buildfile '/Users/dmertl/test/build.xml' with target 'echo-file'
Test > echo-file:
[echo] filename: Two
[echo] absfilename: /Users/dmertl/test/Two