I need something like the JSTL declarative-if-statement in
ant, but I couldn't find such a task.
I have many build scripts in the project, where I want to do some stuff (like delete files, create directories) only if a global condition is true (for instance the existence of a global property). These blocks are many and too small to be appropriate extracting them in separate targets. I need something like this:
<if test="some
test condition here">
<delete dir="${build.classes}" />
</if>
...
<if test="same test condition here">
<mkdir dir="${build.lib}" />
</if>
Nothing much, huh?
I found some third-party "if"-like tasks, but I'd prefer to use native ant tasks.
Why such a useful task is not presented in ant?
Could anybody give me some idea how to implement such a functionality in my build scripts?