ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@mad.scientist.com>
Subject RE: Incremental Compilation and ant
Date Fri, 21 Jul 2000 04:17:28 GMT
At 02:09  21/7/00 +1000, you wrote:
>I would like to have some discussion on this list about which approach, if
>any, we should adopt for this issue. Class file analysis, to extract
>dependencies, is not trivial and increases the amount of code in Ant quite a
>bit. People may also want to consider source file analysis. Personally I
>think class file analysis is both simpler and sufficient.

I used to be of opinion that we should do this but I can't see any reason
to at all anymore. Classfile analysis is probably the best of a bunch of
bad choices. The reason is that the building of dependancies will end up
being *slower* than deleting the whole tree and recompiling using jikes !!!

The only dependancy that I have noticed jikes doesn't catch is cases like

public class A
{
 public static final <primitiveType> MY_CONSTANT = <blah>;
}

public class B
{
 void method()
 {
   doSomething( A.MY_CONSTANT );
 }
}

This can be fixed with a reference in B like

private static final Class A_DEPEND = A.class;
or
private static final A = null;

Another approach I used to use pre jikes is automatically generate files in
each package that references each class. ie in each package a generated
file like

public class DependsCompilePack
{
 public static final Class CLASS1_DEPEND = Class1.class;
 public static final Class CLASS2_DEPEND = Class2.class;
 public static final Class CLASS3_DEPEND = Class3.class;
...
}

Then you just recompile each of these DependsCompilePack in each package
and everything should be updated. (I believe - at least it used to work in
1.1.7 :P)




Cheers,

Pete

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

Mime
View raw message