I've decided to move the <javac> code to a marco called <compile>.
Thus, one <javac> task. I was then able to use AntContrib's <if> to
say that if ${javac.executable} is defined, use one <javac> task, but
if it isn't use an identical task where the executable parameter isn't
set.

This allows the developers to do what they want without worrying how
this affects Jenkins/Hudson's basic setup. I didn't want someone
setting that a particular Jenkins/Hudson job with a particular Java
version, but that Java version gets overridden by what the build.xml
did.

I don't even know how important this is anyway. I want to force all
projects to use JDK 1.6 and later JDK 1.7 once it is "stable" and
before the support for JDK 1.6 expires. The idea that we're still
building some projects with JDK 1.3 is ludicrous. At my last position,
I stamped and howled because we were using JDK 1.4, and that was three
years ago. We don't have to be bleeding edge, but we certainly don't
want to use technology that isn't even being supported any more.

The "source" and "target" parameters of the <javac> task help, but I
know there's some issues with their use. For example, we had in our
Java 1.4 code self defined variable types of "enum". This was legal in
JDK 1.4, but not in JDK 1.5. The JDK 1.5 javac task would fail this
code even though it was legal JDK 1.4 code. JDK 1.6 was fine with this
issue and only gave you a warning.

As you read from the above, I have decided to use AntContrib anyway.
AntXtras required different versions for different versions of Ant
which just complicates everything. Flak looks interesting, and is at
least being worked upon. But, in the end, I really only needed a
single <if> which I hope to eliminate once we get all the projects
using JDK 1.6. It was easy enough to include the ant-contrib.jar in
the project, and to have the build.xml reference this particular jar.

Truthfully, the developers use Eclipse for development, and you can
assign what version of Java and Ant you're using with each Eclipse
project, so the whole idea that developers had to have a way to do
this was sort of bogus to begin with. They can run Ant scripts
directly from Eclipse with the versions of Ant and Java they want.

Thanks for your help.

-- 
David Weintraub
qazw...@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to