ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Natalia Bello <>
Subject Set properties.
Date Wed, 27 Jun 2001 12:56:39 GMT
I  am quite new with Ant, and I have some problems.
I am trying to use the same target from two different ones; setting some
parameters, and execute or not this last target depending of one of the

This is the code:

    <target name="chek_junit">  
          <available file="${junit.jar}"  property="junit.jar.present"/>
          <echo message="Junit present; ${junit.jar.present}"/>
          <antcall target="get_jar">
            <param name="present" value="${junit.jar.present}"/>
            <param name="" value="${}"/>
            <param name="" value="${junit.jar}"/>

    <target name="check_log4j">  
          <available file="${log4j.jar}"  property=" log4j.jar.present "/>
          <echo message="Log4j present: ${log4j.jar.present}"/>
          <antcall target="get_jar">
            <param name="present" value="${log4j.jar.present}"/>
            <param name="" value="${}"/>
            <param name="" value="${log4j.jar}"/>

<target name="get_jar" unless="present">   

The problem is that when one of the files doesn't exists, the property is
not set , and the value that the parameter take is literally
"${log4j.jar.present}", and the target "get_jar" is never executed, because
present is alredy set.
Is there any way to do this, without having to write other target ? I am
doing something wrong?
Thanks in advance,

View raw message