ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Roodt <gro...@gmail.com>
Subject Re: Two pass compile for instrumented code
Date Wed, 14 Apr 2010 10:34:21 GMT
On Tue, Apr 13, 2010 at 7:51 PM, Antoine Levy-Lambert <antoine@gmx.de>wrote:

>
> -------- Original-Nachricht --------
> > Datum: Tue, 13 Apr 2010 17:37:37 +0100
> > Von: Greg Roodt <groodt@gmail.com>
> > An: Ant Users List <user@ant.apache.org>
> > Betreff: Two pass compile for instrumented code
>
> > Hi
> >
> > 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.
> Do you actually need to compile to both ? Or do you compile to bin, then
> instrument the classes from bin into bin-clover ?
>

I've taken another look at the Clover Ant tasks and there are basically 2
options.
1. Compile code with Clover compiler enabled, this instruments on the fly
and then hands off to regular compiler. Currently what Im doing.
2. Instrument source code and then compile manually.
So I could instrument src to src-clover and compile src-clover to bin-clover
I guess.



>
>
> 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.
>
> I would do something like this
>
> <condition property="classes.dir.for.tests" value="bin-clover" else="bin">
>  <isset property="clover"/>
> </condition>
>
> <junit>
> ....
> <classpath>
> <pathelement location="${classes.dir.for.tests}"/>
> </classpath>
> </junit>
>


Thanks for the suggestion. Im going to see if I can wire something like this
into my script. I'll report back what I uncover.



>
>
> Regards,
>
> Antoine
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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