ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From siege <>
Subject "if" attribute, and "fail"
Date Tue, 20 Nov 2001 00:27:43 GMT

Hello list,

	I'm relatively new to using ant (that is to say, new to using it for
anything more than the most basic of build tasks), and have come across
an anoying problem. I've searched through the FAQs referenced in the
archives, but didn't see what I was looking for.

What I'm attempting to do is to have a build process fail when a given
class is not found. My closest attempt is the following:

    <target name="check-foo">

        <condition property="">
	        <available classname="foo.Bar">
		        <fileset dir="${lib.dir}" />

	<fail if="">foo.Bar is missing</fail>


Which seemed all well and good until ant kindly pointed out that the
"if" attribute is not supported in "fail".

The other targets which call check-foo as a depends use that class, and
if it's not locatable the build goes crazy with import errors. I'm
trying to forestall that by detecting the problem before I even get to
the compile step.

Any better ideas on how to do this, oh ant gurus? Any suggestions would
be appreciated tremendously!


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

View raw message