You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Frances Laverty <fr...@yahoo.co.uk> on 2009/05/21 15:30:58 UTC

Using ant to change the compiler for javac tasks

Hi,  
I'm trying to set up CruiseControl to build my project, and the latest version of cc requires java 5.  Unfortunately our project must be build with java 1.4, so i've been trying to incorporate the compiler setting into my build.  I've got one build file that does everything, and i've been trying to use set a global property as follows:  <property name="build.compile" value="javac1.4"
This is supposed to set the javac compiler to 1.4 for every javac task in the rest of the build, but it just doesn't do anything.  I've tried the <javac compiler.../> task also, with no luck.  Any help or suggestions would be great, i'm a complete novice and have been stuck at this for two days now - colleagues have been no help either!
Frances


      

Re: Using ant to change the compiler for javac tasks

Posted by Dominique Devienne <dd...@gmail.com>.
On Thu, May 21, 2009 at 8:30 AM, Frances Laverty
<fr...@yahoo.co.uk> wrote:
> I'm trying to set up CruiseControl to build my project, and the latest version of cc requires java 5.  Unfortunately our project must be build with java 1.4, so i've been trying to incorporate the compiler setting into my build.  I've got one build file that does everything, and i've been trying to use set a global property as follows:  <property name="build.compile" value="javac1.4"
> This is supposed to set the javac compiler to 1.4 for every javac task in the rest of the build, but it just doesn't do anything.  I've tried the <javac compiler.../> task also, with no luck.  Any help or suggestions would be great, i'm a complete novice and have been stuck at this for two days now - colleagues have been no help either!

It's been a long time, but I believe what we did was to use separate
VMs for CC and the builds themselves, i.e. use the Batch Builder
instead of the Ant Builder, that way you can have both running on
separate JDKs completely. Maybe now the Ant builder has a fork mode,
it's been years since I used CC. With the batch builder, you write a
DOS or SHELL (or PERL, PYTHON, etc...) script that sets everything up
correctly for the build, and then start Ant. The return code of the
Ant VM must be propagated correctly, but CC looks into the XML log
files as well if I recall correctly. Not quite what you are asking
for, but it's an alternative from what you are trying to do. Good
luck, --DD

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


Re: Using ant to change the compiler for javac tasks

Posted by Eric Fetzer <el...@yahoo.com>.
Try:

<property name="compiler.folder" value="pathToJavac"/>

Then use the following in your javac task:

executable="${compiler.folder}"




________________________________
From: Frances Laverty <fr...@yahoo.co.uk>
To: user@ant.apache.org
Sent: Thursday, May 21, 2009 7:30:58 AM
Subject: Using ant to change the compiler for javac tasks

Hi,  
I'm trying to set up CruiseControl to build my project, and the latest version of cc requires java 5.  Unfortunately our project must be build with java 1.4, so i've been trying to incorporate the compiler setting into my build.  I've got one build file that does everything, and i've been trying to use set a global property as follows:  <property name="build.compile" value="javac1.4"
This is supposed to set the javac compiler to 1.4 for every javac task in the rest of the build, but it just doesn't do anything.  I've tried the <javac compiler.../> task also, with no luck.  Any help or suggestions would be great, i'm a complete novice and have been stuck at this for two days now - colleagues have been no help either!
Frances