You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Zacke <za...@MailAndNews.com> on 2000/11/10 16:18:18 UTC

Path problems

Hi,

I would like to add a path to my source path if I don't find a specific jar 
file.
I would like to do something like this:


<-- Add the sourcepath to moduleA if moduleA.jar is missing.
<path id="source.path">
  <pathelement location="${root.dir}/moduleA/src" unless="moduleA" />
</path>

<!-- Check to see what dependencies jar files are available -->
<target name="check_for_dependencies">
  <available property="moduleA" file="${root.dir}/moduleA/distr/moduleA.jar" 
/>     
</target>

<!-- Compiles the source code -->
<target name="compile" depends="prepare,check_for_dependencies">
  <javac srcdir="${src}" destdir="${build}">
    <classpath refid="class.path" />
    <src refid="source.path" />
  </javac>
</target>


But this will not work because "unless" will not work in "pathelement".
Any suggestions ?

Regards
Zacke