ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gordon Tyler" <gordon.ty...@sitraka.com>
Subject Re: multiple JVM compiling??
Date Mon, 13 May 2002 15:48:52 GMT
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" <geoffm@isocra.com>
To: "Ant Users List" <ant-user@jakarta.apache.org>
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:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>


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


Mime
View raw message