ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: How does the Javac task know where jdk/jikes is?
Date Fri, 01 Dec 2000 09:47:56 GMT
If you just use <exec>, you won't have the timestamp-checking that <javac>
does, so you'd end up recompiling everything, everytime through.

You don't tell <javac> which jikes to use, you just need the dir that the
jikes.exe you want to run lives in to be in your PATH.

If you want to run jikes in conjunction with the same jdk you're running
ant with, then you don't (or shouldn't) need to do anything special for
the classpath, other than possibly adding additionl elements to it.

If you want to run jikes in conjunction with a different jdk than you're
running ant with, you're going to need to modify Javac.java so that it
doesn't add the run-time stuff. There's a boolean that gets passed to
getCompileClasspath(), in doJikesCompile(), that's hard-coded to "true" --
just hard-code it to "false" (kludgy workaround for now, until <javac>
allows an attribute for this). Then, you just need to make sure you
provide a classpath that has everything in it that jikes needs. In other
words, if you're looking to compile things jikes+jdk118, you need to be
sure your classpath includes the jdk118 classes.zip file. If you were
looking to compile things jikes+jdk122, then you'd need to be sure your
classpath included all the jdk122 jars. I have properties files I use for
my compile-time classpath (and <javac> attributes, like depend, debug,
etc.) that I read in, based on what ${build.compiler} and ${jdk} is set
to. My <javac> tasks look basically like this (but some have additional
<classpath> elements as well, some have additional <include>'s, some
<exclude>'s, etc.):
  <javac
    debug="${debug}"
    depend="${depend}"
    optimize="${optimize}"
    deprecation="${deprecation}"
    srcdir="${javasrc.dir}"
    destdir="${out.dir}"
    <classpath>
      <pathelement path="${compile.classpath}"/>
    </classpath>
    <include name="${com.dir}/pkgname/**"/>
  </javac>

Diane
--- "Jeffery, Myles" <mjeffery@lehman.COM> wrote:
> Hi,
> 
> How do I tell the javac task where the javac.exe of jikes.exe compilers
> are
> located?  And how do I tell jikes where the appropriate rt.jar file is
> located and how do I pass other parameters to it?  I am aware of the
> build.compiler property but this does not explicitly tell the javac task
> where the executables are located.
> 
> The javac task looks a little hit & miss.  I really want to be very
> explicit
> about which jdk/jikes it uses and where the executable and core
> libraries
> are located.  Should I use the exec task to get this much control?
> 
> Thanks,
> 
> Myles Jeffery


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

Mime
View raw message