At 05:11 AM 9/8/2005, Richard Gaywood wrote:

Hi list!

I'm modifiying a slightly complex existing[1] build script for our J2EE web
services app. I currently have two compile targets which compile class files
with or without Emma modification. [aside for those who haven't seen it:
Emma is a code coverage calculation tool that works by modifying the .class
directly before it runs]

You could modify the build so that instead of compiling to ./classes (or whatever you actually compile to) both times, the first time compiles to ./classes-emma and the second time compiles to ./classes.

Troy

So, during our nightly build-and-unit-test cycle, Anthill pulls down the
source from (groan) Visual SourceSafe, Ant kicks off, compiles them,
instruments the classfiles, runs unit tests. It should then recompile the
code, skip the Emma instrumentation, compile a WAR, and deploy to a staging
server. But, because the timestamps of the java files don't change, the
second <javac> invocation (without the Emma instrumentation) doesn't compile
anything -- which means Emma instrumented class files end up in the WAR,
which doesn't work at all.

So, I tried inserting depends= to my clean task before each compile, but of
course, Ant sees the multiple calls to the target and optimises them into
one call!

I tried looking for a "force overwrite" mode in javac, but it doesn't have
one I've seen. I also tried using <touch> to change the timestamp of the
source files to force the recompile, but the files are read only so that
doesn't work either.

Next plan is to rewrite my compile task as a macrodef so I can more directly
control the flow of logic, so that I can call a clean macrodef multiple
times. But that's going to entail a lot of knock-on changes elsewhere in the
build system. Does anyone have any other ideas I've overlooked before I dive
in and start pulling it to pieces?


[1] I wrote it, but too long ago, so it might as well have been written by
someone else now!

----------------------------------------
Troy Daniels
[EMAIL PROTECTED]
781-273-3388 x218


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to