[kepler-dev] Kepler Compile Problem (getNewFiles in org.kepler.io.DirectoryListing)

Matt Jones jones at nceas.ucsb.edu
Fri Oct 6 16:22:24 PDT 2006


Norbert,

Ant doesn't normally check more than the timestamp on files so doesn't 
cover your case.  To do what you want, one needs the dependency checker 
to also inspect the class dependencies in the code.  There are several 
ways to accomplish this in ant:
   1) Use the "depend" optional ant task
   2) Use the jikes compiler with dependency analysis turned on
   3) Use the "depend" feature of the javac task if you are using
      the classic compiler.

My reading indicates that (3) is not that reliable, that (1) should be 
fine, and that (2) is the fastest but jikes doesn't work on all 
platforms.  To accomplish (1), we'd ned to skip the copy to the 
build.src dir and compile directly from the original source, which is 
problematic because we use the copy to merge our src/exp directory into 
the ptolemy tree. So...you'd have to find a way around this.

Theres a good article here:
http://www.javaworld.com/javaworld/jw-11-2005/jw-1107-build.html

If you were to fold a good dependency check into the build it could be 
both faster and more reliable.  Let us know how it goes.

Matt

Norbert Podhorszki wrote:
> A.java
>   package P
>     class A
>       method a()
> 
> B.java
>   package Q
>     import P.A
>     class B
>       myA = new A()
>       myA.a()
> 
> 
> And then a()'s signature has changed to a(boolean b).
> Ant recompiles A.java but does nothing with B.java
> Should it?
> 
> You are right, ant compiles all classes that have changed: here A.
> But B did not change and this is the problem.
> 
> An effective dependency tool should realize that B is depending on A. In 
> the era of C, in the above case, the header file of 'A' would change, so 
> the need to compile B would be recognized. While if the implementation 
> of A changes in its .c code, that would have no effect on B.
> 
> Note:
> The file dependencies in ant are handled by the <depend ...> task.
>    http://ant.apache.org/manual/OptionalTasks/depend.html
> I do not find this depend task in kepler's build.xml.
> Then what handles dependencies?
> 
> Norbert
> 
> 
> On Fri, 6 Oct 2006, Matt Jones wrote:
> 
>> Hi,
>>
>> That's what ant does now -- checks dependencies and compiles the 
>> needed classes that have changed.  The only thing it doesn't check are 
>> dependencies created via reflection or other run-time dependencies.  
>> I'm curious what kind of change you made that worked and tested using 
>> an incrmental build for you locally but then didn't work for other 
>> people.  What was the dependency that was missed?
>>
>> Matt
>>
>> Norbert Podhorszki wrote:
>>> Sorry for this, again.
>>> I forgot to make a clean and full compile before committing my 
>>> changes (but tested with workflows to ensure they are fine).
>>>
>>> Is there any dependency tracking with ant (like with automake tools 
>>> for old languages), so that 'ant compile' would check for 
>>> dependencies and compile everything that is affected by the change?
>>>
>>> Norbert
>>>
> 
> 
>      Norbert Podhorszki
>    ------------------------------------
>      University of California, Davis
>      Department of Computer Science
>      1 Shields Ave, 2236 Kemper Hall
>      Davis, CA 95616
>      (530) 754-8188
>      pnorbert at cs.ucdavis.edu
>      ----------------------------------

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Matthew B. Jones
jones at nceas.ucsb.edu                 Ph: 541-888-2581 ext 287
National Center for Ecological Analysis and Synthesis (NCEAS)
UC Santa Barbara     http://www.nceas.ucsb.edu/ecoinformatics
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


More information about the Kepler-dev mailing list