I'm trying to create a comma-delimited list of files or directories under the current directory. For instance, suppose I have the following folder structure:
Root -- Directory1 -- Directory2 ...
I want to generate a variable or property that contain "Directory1,Directory2." I've tried iterating (using ant-contrib "for" task) over a <dirset dir="." includes="*">
, but this generates absolute paths; I've then extracted the file names using the "basename" task, however that in turn generates an output property. Since properties are immutable, what I get in practice is "Directory1,Directory1,..."
Is there a saner way of doing this, or will I have to write a Java extension to do this for me?