ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Bucciarelli <mbucciare...@peregrine.com>
Subject Ant 2 Request
Date Wed, 21 Mar 2001 23:07:01 GMT
I'm guessing I'm too late, given the VOTE emails, but I'll throw this out
anyway.

I'd like to see <javac> implement dependency checking on it's own, instead
of relying on the compiler.  Here's a simple example of how Java 1.2/Ant
dependency checking doesn't work:

class A
{
  void foo() { }
}

class B extends A 
{
  void bar() { foo(); }
}

<project name="tmp" default="all" basedir=".">
  <property name="build" value="./build/" />
  <target name="all" >
    <mkdir dir="${build}" />
    <javac srcdir="${basedir}"
      depend="on"
      includes="A.java, B.java"
      destdir="${build}"
      classpath=".;${build}"
      debug="on"
      />
  </target>
</project>

If you change class A to

class A
{
  void foo(int i) { }
}

and rebuild, only class A recompiles.  If class B is used, then java throws
a java.lang.NoSuchMethodError.

NOTE: This example was taken directly from a post on the JDE mailing list,
where there's been quite an involved discussion on dependency checking.  I
was labelled a "naive" user for crowing about Ant's benefits and not
understanding this rather basic limitation! :)

--
Mark Bucciareli <mbucciarelli@peregrine.com>
voice: (413) 367-2864
fax  : (978) 285-0299
Research & Development, Boston
Peregrine Systems, Inc.
http://www.peregrine.com

 

Mime
View raw message