Hi,
is there a simpler way to create a required folder if it does not
exist already? Using a standard Ant installation (to my understanding,
core tags do not include an <if> tag).
<target name="checkavailabledirs">
<available file="${classes}" type="dir" property="classes.present"/>
</target>
<target name="createsourcedir" unless="${classes.present}">
<mkdir dir="${classes}"/>
</target>
<target name="init" depends="checkavailabledirs, createsourcedir"/>
<target name="compile" depends="init">
....
That works fine, but boy, is it overcomplicated.
Lothar Kimmeringer - 30 Oct 2004 10:38 GMT
> is there a simpler way to create a required folder if it does not
> exist already? Using a standard Ant installation (to my understanding,
> core tags do not include an <if> tag).
I think
<mkdir dir="${classes}" failonerror="false">
should do the trick. Otherwise, have you tested if mkdir
fails with an error, if the directory already exists?
If yes, just delete the directory, before you create it
newly.
Regards, Lothar

Signature
Lothar Kimmeringer E-Mail: spamfang@kimmeringer.de
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)
Always remember: The answer is forty-two, there can only be wrong
questions!