ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wannheden, Knut <knut.wannhe...@paranor.ch>
Subject RE: Clearcase and ant
Date Thu, 01 May 2003 10:22:26 GMT
Harry,

> 
> I'm working on a java project using clearcase for our source 
> control.  We 
> currently use clearmake with javac to build our project.  
> I've recently 
> started using ant and after spending quite a bit of time 
> searching for 
> information on how to integrate ant with clearcase I still 
> haven't been 
> able to successfully do it.
> 

The currently existing integration is limited to a set of optional tasks to
perform things like checkout, checkin, etc.  A few new tasks exist in the
CVS HEAD of Ant, but I don't think any of them solve your problems.

> Clearmake doesn't use file modification dates to manage build 
> dependencies 
> but ant does.
> 

Yes, clearmake uses the configuration record (CR) of the derived objects
instead.  Which of course is much more reliable.

> So if I checkout a file and make some changes and then built 
> it with ant, 
> it will detect the checkout as newer than the .class file and 
> rebuild it.  
> That's fine, however if I then decide I nolonger want those 
> changes and 
> uncheckout the file it reverts to the original version and that file 
> appears to have been modified before the .class file was 
> generated so no 
> rebuild is performed.
> 
> I've been looking at the source for the 'depend' task and it 
> should be 
> possible to modify that to include the clearcase file version 
> information 
> in the depcache.  Then I would be able to detect if a file 
> version has 
> changed since the last time it was built and remove the 
> appropriate .class 
> file or files.
> 
> However the act of finding each .java file used in the 
> current ant target 
> and reading the version selected by the config spec takes 
> quite a while to 
> run on our source tree.
> 
> So before I proceed with this mechanism I'm polling this list 
> in the hope 
> that one of you has already solved this particular issue.  
> I'm aware it 
> might also be possible to use clearcase triggers to remove 
> .class files 
> when a .java checkout is cancelled, but I'm sure this will be 
> problematic 
> for us as it would be difficult to determine all the 
> scenarious in which 
> 'older' versions of source files are failing to trigger rebuilds.
> 

What I do is to run a clean target every once in a while :-)  But I
understand that this might not be feasible in your situation.  I just
figured that I do things as you described so seldom, so I didn't want to
waste time implementing a suboptimal solution.

> Running ant within 'clearaudit' doesn't work as each file 
> generated appears 
> to depend on every source file accessed by the ant process.
> 

But I assume you have the same problems when running javac within
clearmake/clearaudit as well.  Because javac usually compiles more than one
file, even if you just specify one source file, the CR of a class file will
list many source files as dependencies.  Only after many changes and
recompilations things stabilize and the CRs will reflect the actual
dependencies.

As I see it there is no really good way of developing Java with ClearCase
and still use these powerful features.

The advantage with clearmake is that you get the CRs, the advantage with Ant
is that compiling many sources is much faster.  Even faster than using
clearmake with jikes.  (Of course this also depends on what your Makefiles
look like.)

But I'd be interested if you find a good solution to this!

Cheers,

--
knut

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message