Thank you for your help, Rob.
-----Original Message-----
From: Anderson, Rob (Global Trade) [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 26, 2005 7:34 PM
To: Ant Users List
Subject: RE: multiple compilations
Setting a property if any compilation fails would work. Try using the
ant-conrti <trycatch> task. Something like this...
<target name="main" depends="create_thing1, create_thing2,didonefail"/>
<target name="create_thing1" depends="compile_a, compile_b,didonefail"/>
<target name="create_thing2" depends="compile_c,didonefail"/>
<target name="didonefail">
<fail if="onefailed">
One of the compiles failed.</fail>
</target>
<target name="compile_a">
<trycatch>
<try>
<javac...>
</try>
<catch>
<property name="onefailed" value="true"/>
</catch>
<trycacth>
</target>
<target name="compile_b">
<trycatch>
<try>
<javac...>
</try>
<catch>
<property name="onefailed" value="true"/>
</catch>
<trycacth>
</target>
<target name="compile_c">
<trycatch>
<try>
<javac...>
</try>
<catch>
<property name="onefailed" value="true"/>
</catch>
<trycacth>
</target>
-Rob A
> -----Original Message-----
> From: Steve McIntosh [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 26, 2005 12:12 PM
> To: [email protected]
> Subject: multiple compilations
>
>
> Hi.
>
> I've been searching around the documentation and this list to
> try to find
> the answer to this question, but I've so far been unsuccessful.
>
> I have a build file that does several separate compilations. What I'd
> like to do is use the MailLogger to send notification of the
> results of
> the build: successful if all the separate compilations are
> successful and
> failed if any of them fails. I would not like the build to stop (ie.
> failonerror=true) if one of the compilations fails; I want to
> continue on
> compiling the other sections, but still report the whole
> build as failed.
>
> So far, I've just been using depends in the target
> definition, but that
> doesn't seem to quite do the job. I think I need to use
> antcall and/or
> set a property based on the results of each compilation, but I haven't
> been able to quite work it out.
>
> Any assistance would be greatly appreciated.
>
> Below is some psuedo-ant of what I'm doing. I would like to get a
> successful result if compile_a, compile_b, and compile_c
> succeed, but if,
> say, compile_a fails, I would like compile_b and compile_c to
> execute, but
> still report that the build has failed (whether compile_b and
> compile_c
> succeed or not).
>
> <target name="main" depends="create_thing1, create_thing2"/>
>
> <target name="create_thing1" depends="compile_a, compile_b"/>
>
> <target name="create_thing2" depends="compile_c"/>
>
> <target name="compile_a">
> <javac...>
> </target>
>
> <target name="compile_b">
> <javac...>
> </target>
>
> <target name="compile_c">
> <javac...>
> </target>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]