2
我有這個簡單的Ant任務,列出了所有「巴紐」文件夾中:如何使用'FileSet'和'PathConvert'兩次回顯文件名?
<target name="listimages">
<!-- Assume files a A and B -->
<fileset id="dist.contents" dir="${basedir}">
<include name="**/*.png"/>
</fileset>
<pathconvert pathsep="${line.separator}"
property="prop.dist.contents"
refid="dist.contents">
<mapper type="flatten" />
<map from="${basedir}" to=""/>
</pathconvert>
<echo>${prop.dist.contents}</echo>
</target>
這將打印
[echo] A.png
[echo] B.png
但是,我想要的是文件名出現兩次在每一行上。
[echo] A.png,A.png
[echo] B.png,B.png
我該怎麼做?
(這個問題是一個跟進How can I print a fileset to a file, one file name per line?)