ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Perik <>
Subject RE: conditional testing based on compiling
Date Fri, 03 Oct 2003 20:39:16 GMT

I think the "uptodate" target is what I need.  I think I'll have that
set a property whether anything needs compiled or not.  I can use that
same property to determine whether the tests need rerun, and whether the
jar file needs rebuilt.


FYI my build.xml file is something like this:
<target name="init" ...>
<target name="compile" depends="init" description="Compile the source">
<target name="test" depends="init,compile" description="Do JUnit unit
<target name="jar" depends="init,test" description="Make the jar file">
<target name="deploy" depends="jar" description="Deploy application to
servlet container">
<target name="war" depends="init,deploy" description="Make the war
binary deployment file">

- Dan

On Fri, 2003-10-03 at 14:56, Anderson, Kajsa wrote:
> What are the other dependencies of "deploy"? From your description, it
> sounds like your build file looks something like this:
> <target name="deploy" depends="compile">...</target>
> <target name="junit" depends="compile">...</target>
> <target name="compile">...</target>
> If that's the case, and "junit" runs when you execute "deploy", it sounds
> like something else that "deploy" depends on has a dependency on "junit".
> You might also look at using a property set by the <uptodate> to
> conditionally run "junit".
> -----Original Message-----
> From: Dan Perik []
> Sent: Friday, October 03, 2003 2:35 PM
> To:
> Subject: conditional testing based on compiling
> Hello,
> I have a build file which uses JUnit to run tests on my code after it
> compiles (it depends on "compile").  The build file also has a deploy
> target, etc., which also depends on "compile".  These unit test are time
> consuming.  There are times when it doesn't need to "compile" to
> "deploy".  But it still runs the unit tests anyways (even though it
> doesn't need to).  What I'd like to do is have it only run the unit
> tests IF it had to compile something.  Sort of like:
> do compile {
>   if anything compiled {
>     do tests
>   }
> }
> Is there any way to do this?
> Thanks!
> Dan
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
Dan Perik <>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message