0
프로젝트베이스에서 직접 각 디렉토리에서 실행하려는 phing 빌드 대상이 있습니다. 각 디렉토리에서 대상을 실행하기 위해 파일 세트와 함께 foreach 작업을 사용하고 있습니다. 내가 가지고있는 문제는 기본 디렉토리가 포함되어 있으며 파일 이름이 ""입니다.phing/ant에서 기본 디렉토리를 제외하는 방법 FileSet
이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