ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Roodt <>
Subject Two pass compile for instrumented code
Date Tue, 13 Apr 2010 16:37:37 GMT

I have an Ant build that consists of the basic compile, test, package,
report phases.
The report phase is a bit slow (Clover particularly) for developers looking
for quick feedback on tests. Developers dont need Clover reports, Checkstyle
etc etc every time and we mainly prefer these to be generated on our CI
server. This would be easy except for the requirement that for some reports
(Clover again) the compiled code needs to be instrumented.

Basically, Im looking for a 2 pass compile. The first compile is a regular
Java compile. The second is a compile with Clover instrumentation enabled.
These would need to compile to different destination directories, lets call
them bin and bin-clover.

During the compile phase, if we are generating a report, we need to compile
to both bin and bin-clover. When not generating reports, only to bin.
During the test phase, if we are generating a report, we need to run the
tests against bin-clover. When not generating reports, we need to run the
tests against bin.
The package phase will always package bin.

Still with me? Can anybody think of an elegant way to do this without
writing duplicate targets for the compile and test phases?
I've got it working, but I've got a lot of duplication and Im sure theres a
tidier way to do it.

Basically what Im after is 2 targets:
run-tests: compile, test
release: compile, test, package, report

Without duplicating too much in compile and test.


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