You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Gene Margolin <gm...@futuresource.com> on 2000/08/31 16:04:44 UTC

build depending on dependencies

Is it possible in ant to compile only those java-files on which
some specific file or package depends (e.g. as JBuilder does )?
Recursive compiling of all packages significantly increases
the size of products.

Gene.


Re: build depending on dependencies

Posted by Peter Donald <do...@mad.scientist.com>.
At 09:04  31/8/00 -0500, you wrote:
>Is it possible in ant to compile only those java-files on which
>some specific file or package depends (e.g. as JBuilder does )?
>Recursive compiling of all packages significantly increases
>the size of products.

umm - well that sorta does happen. The problem is that some compilers are
broken (javac). Even the un-broken compiler jikes on full dependancy checks
doesn't check all dependancies. Code that is optimized out completely 

ie.
if( !Blah.VAR )
{
  ///do something
}

where Blah.VAR is a static final variable defined as false

will not be taken into account for dependancy checks - other than a few
other rare circumstances that should do it.

Make sure you put the following things in build file

  <property name="build.compiler" value="jikes"/>
  <property name="build.compiler.emacs" value="on"/>
  <property name="build.compiler.warnings" value="true"/>
  <property name="build.compiler.pedantic" value="true"/>
  <property name="build.compiler.depend" value="true"/>


Make sure you get jikes =) and also make sure your package structure
matches directory structure.

ie so if your source directory is "src/" and you have a class in package
"com.biz" then it should be in directory "src/com/biz". If you do all of
that and are still having issues - email back and I will see what else
needs doing :P



Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*