ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Milind Nirgun" <Nirg...@C-IV.org>
Subject RE: Need help with javadoc task
Date Wed, 24 Jul 2002 19:13:41 GMT
> Now I still can't figure
> out how to conditionally include
> "${env.JAVA_HOME}/src" in the sourcepath for the
> javadoc statement only when such a directory exists. 

Try this:
    <target name="set_java_src" >
      <available file="${env.JAVA_HOME}/src" type="dir" property="java.src.present" />
    </target>
    
    <target name="check_java_src" depends="set_java_src" if="java.src.present" >
      <echo message="java.src exists" />
    </target>

Run check_java_src target, it will run only if the dir ${env.JAVA_HOME}/src exists. If you
need an alternate branch define another target with an unless="java.src.present" attribute.
You can use this structure around your javadoc tasks.
-Milind

--
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