ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From siege <talies...@yahoo.com>
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="missing.foo">
	    <not>
	        <available classname="foo.Bar">
		    <classpath>
		        <fileset dir="${lib.dir}" />
		    </classpath>
		</available>
	    </not>
	</condition>

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

    </target>


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!

-siege
(Chris)



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


Mime
View raw message