ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David McTavish <dmctav...@SANDVINE.com>
Subject RE: Emailing Build results
Date Tue, 04 Mar 2003 21:41:02 GMT
you could just wait for the <antcall/> to finish completing, instead of
having to do the waitfor, and ignore the parallel/sequential logic
altogether.

what you probably want, is try/catch from antelope. 

<try>
    <ant .../>
    <finally>
        <mail .../>
    </finally>
</try>


d.


-----Original Message-----
From: Alexei Betin [mailto:ABetin@futuretrade.com]
Sent: Tuesday, March 04, 2003 4:39 PM
To: Ant Users List
Subject: RE: Emailing Build results


well, in fact I'd need rather something like:

<parallel>
	<ant ...call buildfile... />
	<sequential>
		<waitfor ...some var that indicates build is done... />
         	<mail ...email results... />
	</sequential>
</parallel>

> -----Original Message-----
> From: Alexei Betin 
> Sent: Tuesday, March 04, 2003 1:35 PM
> To: Ant Users List
> Subject: RE: Emailing Build results
> 
> 
> Aha, I am getting closer...
> 
> failing <ant> task does terminate the build, but
> by using the structure like below I seem to be getting 
> what I want:
> 
>     <parallel>
>         <ant ...call buildfile... />
>         <mail ...email results... />
>     </parallel>
> 
> Thanks for all help!
> 
> ~Alexei
> 
> > -----Original Message-----
> > From: Chris Reeves [mailto:CReeves@medfusion.net]
> > Sent: Tuesday, March 04, 2003 1:26 PM
> > To: Ant Users List
> > Subject: RE: Emailing Build results
> > 
> > 
> > Probably so. Like I said, it's been working for months, so 
> > I'm gonna let
> > it be.
> > 
> > However, I'd like to hear if you experiment with it.
> > 
> > Thanks,
> > Chris
> > 
> > > -----Original Message-----
> > > From: Alexei Betin [mailto:ABetin@futuretrade.com] 
> > > Sent: Tuesday, March 04, 2003 4:16 PM
> > > To: Ant Users List
> > > Subject: RE: Emailing Build results
> > > 
> > > 
> > > I like this approach except for using <exec>,
> > > I wonder if there is a way to do it using <ant> instead?
> > > 
> > > Thanks,
> > > ~Alexei
> > > 
> > > 
> > > > -----Original Message-----
> > > > From: Chris Reeves [mailto:CReeves@medfusion.net]
> > > > Sent: Tuesday, March 04, 2003 1:10 PM
> > > > To: Ant Users List
> > > > Subject: RE: Emailing Build results
> > > > 
> > > > 
> > > > I use a slightly different approach to have the buld 
> results sent.
> > > > 
> > > > First, I created a second, separate ant build script that 
> > wraps my 
> > > > build.xml file.
> > > > 
> > > > This second script checks the project out of cvs, then 
> > executes the 
> > > > build.xml present at the root of the project. When the ant call 
> > > > completes, the log file is attached to a mail message. 
> > This occurs 
> > > > even if the wrapped build fails.
> > > > 
> > > > I'm sure there's a cleaner way to do this, but it has run 
> > > for months 
> > > > with no problems.
> > > > 
> > > > Additionally, it's great to see the "Failed" or 
> > "Succeeded" on the 
> > > > subject line, so I don't have to open each message and 
> > > scour the logs 
> > > > just to discover the build succeeded.
> > > > 
> > > > Chris
> > > > 
> > > > 
> > > > ...
> > > > 
> > > > <snip>
> > > > 
> > > > 
> > > > 	  <!-- 
> > > ==============================================================
> > > > ==========
> > > > ======== -->
> > > >         <!-- Target: build_project -->
> > > >         <!--
> > > > ==============================================================
> > > > ==========
> > > > ======== -->
> > > > 
> > > >         <target name="build_project" depends="init, clean, 
> > > > cvs_checkout">
> > > > 
> > > >                 <echo message="Executing ant file 
> > > > ${project.root.dir}/${project.antfile}"/>
> > > > 
> > > >                 <exec   dir             = "${project.root.dir}"
> > > >                         executable      = 
> "/usr/java/ant/bin/ant"
> > > >                         output          =
> > > > "${log.dir}/nightly_build_results_${filename.suffix}.txt"
> > > >                         resultproperty  = "project.build.result"
> > > >                         outputproperty  = 
> "project.build.output">
> > > >                         <arg line       = 
> "${project.anttarget}"/>
> > > >                 </exec>
> > > > 
> > > >                 <echo message="Done."/>
> > > > 
> > > >         </target>
> > > > 
> > > > 
> > > >         <!-- 
> > > > ==============================================================
> > > > ==========
> > > > ======== -->
> > > >         <!-- Target: send_notification -->
> > > >         <!-- 
> > > > ==============================================================
> > > > ==========
> > > > ======== -->
> > > > 
> > > >         <target name="send_notification" depends="init,
> > > > build_project">
> > > > 
> > > >                 <condition property="build.result" 
> > > value="Failed!!!">
> > > >                         <equals arg1="1" 
> > > > arg2="${project.build.result}"/>
> > > >                 </condition>
> > > > 
> > > >                 <condition property="build.result"
> > > > value="Succeeded!!!">
> > > >                         <equals arg1="0"
> > > > arg2="${project.build.result}"/>
> > > >                 </condition>
> > > > 
> > > >                 <mail   tolist                  = 
> "${to.address}"
> > > >                         from                    = 
> > "${from.address}"
> > > >                         subject                 = 
> "${build.result}
> > > > ${project.longname} Nightly Build - ${build.time}"
> > > >                         mailhost                = 
> "${smtp.server}"
> > > >                         messagefile             =
> > > > "${log.dir}/nightly_build_results_${filename.suffix}.txt">
> > > >                 </mail>
> > > > 
> > > >         </target>
> > > > 
> > > > </snip>
> > > > 
> > > > ...
> > > > 
> > > > > -----Original Message-----
> > > > > From: Alexei Betin [mailto:ABetin@futuretrade.com]
> > > > > Sent: Tuesday, March 04, 2003 4:01 PM
> > > > > To: Ant Users List
> > > > > Subject: Emailing Build results
> > > > > 
> > > > > 
> > > > > what are reasonable options for emailing nightly 
> Build results?
> > > > > 
> > > > > MailLogger seems to have no way to attach the build log
> > > > > or use properties in Subject,
> > > > > 
> > > > > also I am already using NoBannerLogger - which leaves no
> > > > > place for MailLogger...
> > > > > 
> > > > > <mail> task cannot help me, because if I put it at the 
> > end of my 
> > > > > build script, and the build fails, it'll never get to 
> > execute it.
> > > > > 
> > > > > Is there a way to ensure a task is always called at the end?
> > > > > maybe using different build files with <ant> or <antcall>?

> > > > > <parallel> would not help me here because it can only wrap

> > > > > tasks and not targets...
> > > > > 
> > > > > Finally, I understand I can write my own Logger,
> > > > > but for a couple of reasons I don't want to - I would 
> > > rather prefer 
> > > > > to get the job done by some batch file, but I wonder if I 
> > > am missing 
> > > > > a nice pure-Ant solution
> > > > > 
> > > > > Thanks,
> > > > > ~Alexei
> > > > > 
> > > > > 
> > > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > > > > For additional commands, e-mail: user-help@ant.apache.org
> > > > > 
> > > > > 
> > > > 
> > > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > > > For additional commands, e-mail: user-help@ant.apache.org
> > > > 
> > > > 
> > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail: user-help@ant.apache.org
> > > 
> > > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 

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

Mime
View raw message