Pregunta

I am trying to retrieve the list of all zip files present in a directory.

I have a directory ${src} which contains some zip files and I am using the following code

<target name="test">  
<dirset id="dist.contents" dir="${src}" includes="*.zip"/>  
<property name="prop.dist.contents" refid="dist.contents"/>  
<echo message="${prop.dist.contents}" />  
</target>  

but it only echoes null.

I also tried includes="*" but it didn't make any difference.

I am using Ant version 1.7.0.

¿Fue útil?

Solución

As written in the documentation:

A DirSet is a group of directories.

So since you want zip files, you should use a FileSet.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top