C
castillo.bryan
Roedy Green wrote:
Do you think the clumsiness is because of XML or the way they
structured the XML?
Why not have an if tag that has tasks contained within the if tag?
This makes more sense to me visually.
<target name="copy.pad.xml">
<if-exists file="${pad.dir}/${ant.project.name}.xml">
<copy
file="${pad.dir}/${ant.project.name}.xml"
todir="${package.dir}"
failonerror="false"
overwrite="true"
/>
</if-exists>
</target>
Ant has support for container tags, I wonder why there aren't
conditional container tags?
Or do I just not know about them?
Then you have some idea of the verbosity of ant conditionals.
Obviously, ant conditionals are not written in Java, but they have
that same degree of awkwardness. This comes from trying to do
everything in pure XML syntax. In ant you have to create a named step
called a target that contains the commands you may or may not want to
execute. Then you apply the keyword if and property name to the
target. You have to elsewhere in the program set the property to true
or false depending on whether you want the step executed. Then you
have to do an <antcall to the step to attempt to execute it! All this,
because the ant people have a love affair with XML! It is major
production to conditionally copy a file that may or may not exist.
Do you think the clumsiness is because of XML or the way they
structured the XML?
Why not have an if tag that has tasks contained within the if tag?
This makes more sense to me visually.
<target name="copy.pad.xml">
<if-exists file="${pad.dir}/${ant.project.name}.xml">
<copy
file="${pad.dir}/${ant.project.name}.xml"
todir="${package.dir}"
failonerror="false"
overwrite="true"
/>
</if-exists>
</target>
Ant has support for container tags, I wonder why there aren't
conditional container tags?
Or do I just not know about them?