You can provide <dirset> for the <foreach> task to work:
<foreach target="bundle" param="worksheet" inheritall="true"> <path> <dirset dir="${subDir}"> <include name="*"/> </dirset> </path> </foreach>
Note that the list parameter is not used when I do it this way.
You cannot use <dirset> directly under <foreach> as you can with <fileset> . However, you can put <dirset> under the <path> as shown above. <include name="*"/> prevents directory tree recursion.
source share