One method is to run Ant using JDK 1.4 and use the cross-compiling options
of javac to make the JDK 1.4 compiler produce 1.2 and 1.3 compatible
classes.
For example:
<javac includeantruntime="false"
includejavaruntime="false"
target="1.3"
source="1.3"
extdirs="${java13.home}/jre/lib/ext"
destdir="${build}"
srcdir="${src}">
<bootclasspath>
<pathelement location="${java13.home}/jre/lib/rt.jar"/>
</bootclasspath>
... your classpath and includes ...
</javac>
Where java13.home is a property defined to point to your JDK 1.3 home
directory.
And for your JDK 1.4 compile:
<javac includeantruntime="false"
destdir="${build}"
srcdir="${src}"
target="1.4"
source="1.4">
... your classpath and includes ...
</javac>
Ciao,
Gordon
----- Original Message -----
From: "Geoff Meakin" <[EMAIL PROTECTED]>
To: "Ant Users List" <[EMAIL PROTECTED]>
Sent: Monday, May 13, 2002 8:58 AM
Subject: multiple JVM compiling??
> Hi,
> Does anyone know of a good way to do multiple compiling in a single
> script? By this I mean, I have some source which I need to compile
> using JDK1.2.2, some source which I need to compile using JDK1.3
> and some source which I need to compile using JDK1.4- but in the
> same script, so I dont want to run ANT under different JVMs three
> times. I've been using <exec> to do this so far, and calling the
> remote java-compilers directly, but this is no longer a good
> solution, and I've heard it is possible using tweaking of the
> build.compiler property, but I havent got this to work at all.
> Any ideas? My current source snippet is listed below.. I'm running
> ant under JDK1.2.2
>
> Thanks
> Geoff Meakin
> isocra.com
>
>
>
> <!-- compile this with JDK1.2.2 for JDK1.1 -->
> <javac target="1.1"
> bootclasspath="${LHOME}/build-libs/jdk1_1_8-classes.zip"
> extdirs=""
> destdir="${LHOME}/l1-classes"
> srcdir="${LHOME}/l1-java">
> <classpath>
> <path refid="${platform}.class.path"/>
> <pathelement path="${LHOME}/l1-classes"/>
> </classpath>
> <include name="**/*.java"/>
> </javac>
>
> <!-- compile this with JDK1.4 for JDK1.3 -->
> <exec executable="${J4HOME}bin/javac.exe" dir="${LHOME}/l2-java">
> <arg value="-target"/>
> <arg value="1.3"/>
> <arg value="-d"/>
> <arg path="${LHOME}/l2-classes"/>
> <arg value="-classpath"/>
> <arg path="${COMMON_CLASSPATH}"/>
> <arg value="@${LHOME}\build\l2-classes.tocompile.include"/>
> </exec>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>