In ant copy task, in destination location there is a “random number” folder in the path. When i try to put a * in the path to handle it, Ant takes it literally, ie doesnt expand it, but creates a folder called “*” and copies there. How do I tell Ant to expand the * to actual folder name there (there is only 1 folder in there, so * wont expand to multiple folders)
<property name="dest" value="a/*/b/my.jar" />
<property name="src" value="my.jar" />
<copy file="${src}" tofile="${dest}" overwrite="true" verbose="true"/>
The
copytask doesn’t support wildcards in thetofileattribute. If the destination directory exists, but the destination file may not, then you can use adirsetto capture the directory. Something like:Instead of using the property helper (
${toString:....}) syntax you might use thepathconverttask: