ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Tirsén <jon.tir...@emm.com>
Subject RE: Request for Failed-Task
Date Mon, 06 Nov 2000 01:13:51 GMT
Yes, that could be a useful feature. For my current build-system I would use
it for posting a Change Request into StarTeam if the nightly build fails.
Currently I implement this by having a script calling ant that checks the
exit-code and calls another target if ant fails. It would be nice to be able
to specify all semantics of a build in ant instead.

I imagine their could be two different ways of implementing this
A) Set a failure target on target-level:
<project name="foo">
	<target name="nightlybuild" failure="failure">
		<!-- do your deed -->
	</target>
	<target name="failure">
		<!-- create change request -->
	</target>
</project>

There are some issues to consider on this one though: If a target fails
should just the targets failure-target be run or should the targets that
depended on this one also be run?

A little bit easier, but not as powerful:
B) Set a failure-target on project-level, with basically the same semantics
of the default target:
<project name="foo" failure="failure">
	<target name="nightlybuild">
		<!-- do your deed -->
	</target>
	<target name="failure">
		<!-- create change request -->
	</target>
</project>

Of course, there are some issues here as well: If a project is called from
another project whould all the failure-targets be run in the chain? If a
task is called from within the same project should the failure-target be run
several times? Probably not, but what are the semantics? I imagine it would
be healthy to reuse the same semantics as with ordinary targets, if it's run
it does not need to be run again...

Also (for both A and B) could failure-targets have "dependants" and what if
they fail?

And, of course, applying the "keep-things-simple" general rule (occhams
razor), is there a way to design this simple enough? ASAP (= As Simple As
Possible ;).


-----Original Message-----
From: Thomas Christen [mailto:chr@active.ch]
Sent: Sunday, November 05, 2000 6:18 AM
To: Ant-Dev
Subject: Request for Failed-Task


As far as I know, there is currently only a solution to handle a "Fail"
through a Listener. This means one has to write a Listener first. It would
be nice to have default behaviour in case a build fails like a target failed
witch will be called in this case.

Thomas Christen


Mime
View raw message