Hi everybody,

I�m having a problem with different javac s in the same build.xml:

My setup is as follows:

- I�m building two applets with JNI / J/Direct support for Netscape / IE.
- When using J/Direct, one has to use M$�s jvc (don�t tell me about
standards, please - I know :-)).
- For the other part of the applet (the Netscape classes), I need to use a
std. JDK javac (with JNI support).

So in my build.xml I try to do this by setting ${build.compiler} just before
compiling:

        <target name="netscapeCompile" depends="init">
                <property name="build.compiler"  value="classic"/>
                <javac srcdir="${src}" destdir="${netscape.client.build}" 
                        includes="myclasses/NS.java"
                        fork="yes">
                        <classpath>                             
                                <pathelement path="${java.class.path}/"/>
                                <pathelement location="${nssec.jar}"/>
                        </classpath>
                </javac>
        </target>

        <target name="msieCompile" depends="init">
                <property name="build.compiler"  value="microsoft"/>
                <javac 
                        srcdir="${src}"
                        destdir="${build}" 
                        includes="myclasses/IE.java"
                        fork="yes"/>
        </target>

Nevertheless it always uses the same compiler when I use both targets in the
same antrun (depending on the order of my targets - when msieCompile is
triggered first, only jvc is used, when netscapeCompile is triggered first, only
javac is used).

- Is there maybe a problem with some sort of "caching" of the
"build.compiler" property ?
- Are different compilers in the same build.xml during one antrun supported
?
- Does it help to put the targets in separate files and call them through
<ant> ?
- Or am I just using the commands a wrong way ?

All comments are welcome.

Lars Henssen

Reply via email to