ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gulcu <...@urbanet.ch>
Subject Two consequtive ifs
Date Thu, 28 Dec 2000 00:07:36 GMT


Hello,

Sorry if this question has been already asked before. I have a target that 
depends on the existence of JNDI and JMS libraries, as in:

<project name="log4j" default="compile" basedir="." >
	<target name="init">
		<tstamp />
		<property name="srcdir" value="." />
		<property name="classes" value="classes" />
		<property name="stem" value="org/apache/log4j" />
		<property name="build.compiler" value="jikes"/>	
		<property name="version" value="1.0"/>
	
                 <available classname="javax.jms.Message"
  	                   property="jms-present"/>

                 <available classname="javax.naming.Context"
  	                   property="jndi-present"/>
         </target>

    ... removed stuff

             <target name="compile.jms" depends="init" if="jms-present">
             <echo message="Really compiling JMS dependent code." />
	    <javac
		   srcdir="${srcdir}"
		   destdir="${classes}"
		   includes="${stem}/net/JMS*.java"
		   classpath="${classpath}"/>
	</target>
</project>

However, since ANT does not allow two consecutive if attributes, I can only 
check for the presence of JMS. How can I check for the presence of JNDI and 
execute the "compile.jms" target only if both JMS and JNDI are present? 
Thanks in advance for your help, Ceki


Mime
View raw message