> <switch name="os.name">
> <case value="Mac OS">
> <javac ..... />
> </case>
> <case value="Win*">
> <javac ..... />
> </case>
> <deafult>
> <Deltree ..... />
> </default>
> </switch>
The problem that I have with this is that it introduces logic into the
antfile. It was an explicit design goal of mine when I first wrote ant for
the files to be totally declaritive and *all* logic occurs in the task. If
you want to write specialized logic, you can -- it's easy enough to add
tasks via the <taskdef...> -- now, if the group wants to change course on
that, that's something I can't control, but I won't welcome it.
This means that I would prefer not to see anything like an if/then/else,
for, or switch implemented in this fashion. If you want to build logic, do
it in Java. If you want to describe the project, do it in XML.
.duncan
|