ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joel Riedesel" <jriede...@jnana.com>
Subject java generics compiler and ant?
Date Mon, 18 Jun 2001 21:34:33 GMT
Is it possible to use the prototype generics compiler
with ant?

It's tricky since one must use the javac from the sample
generics implementation AND one must cross compile using
the collect.jar (collections modified for generics).

The collect.jar is stubs of actual collections.  So, if
collect.jar is included on ant's classpath, ant doesn't work.

My build task looks like this:
  <target name="main" depends="init">
    <javac srcdir="."
           destdir="."

bootclasspath="e:\jnana\java\jks4\generics\collect.jar;e:/jnana/java/jdk1.4b
1/jre/lib/rt.jar"
           classpath="${j2eepath}" />
  </target>

And, ant with verbose looks like this at the appropriate time:
---
    [javac] Compilation args: -d E:\Jnana\jks4 -classpath
E:\Jnana\jks4;E:\Jnana
\Java\jdk1.4b1\lib\tools.jar;E:\Jnana\Java\jakarta-ant-1.3\lib\parser.jar;E:
\Jna
na\Java\jakarta-ant-1.3\lib\jaxp.jar;E:\Jnana\Java\jakarta-ant-1.3\lib\ant.j
ar;E
:\Jnana\jks4\dev -sourcepath E:\Jnana\jks4 -bootclasspath
E:\Jnana\Java\jks4\gen
erics\collect.jar;E:\Jnana\Java\jdk1.4b1\jre\lib\rt.jar
---

Yet, my test file doesn't compile.  The difficult seems to be that
javac is loaded using ant's class loader (which is fine - if we get
the JDK1.3 or JDK1.4 javac, then I get a variety of interesting parse
errors, I
don't get these, so I know it's loading the javac from the generics
sample implementation compiler).

Now, during the compile, javac looks up a LinkedList (for example) and
gets the one in the default class loader (since javac was loaded from
the default class loader...) instead of what I specified in bootclasspath.

Any ideas about this?  Is this even possible?

Thanks,

Joel




Mime
View raw message