You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Morgan Fletcher <mo...@provato.com> on 2000/10/15 01:55:02 UTC

Property set inside target that should be passed over

I've got a target that looks like this:

  <target name="prepare_compiler" if="usebcj">
  	<property name="bcj"
value="${provato.home}/../tools/jbuilder3/bin/bcj.exe"/>
  	<available property="bcj_available" file="${bcj}"/>
  </target>

If the property usebcj is not set, the properties bcj and bcj_available get
set anyway:

 +Target: prepare_compiler
   +Task: property Setting project property: bcj ->
d:\depots\eng\main\components/../tools/jbuilder3/bin/bcj.exe    
   +Task: available Setting project property: bcj_available -> true 

Shouldn't the if="usebcj" condition cause those properties to not be set? If
that's not the case, how would I conditionally set the two properties, based
on the existence of usebcj?

We're using 1.1. 

Thanks,

morgan

Re: Property set inside target that should be passed over

Posted by Nico Seessle <Ni...@epost.de>.
Property set inside target that should be passed overThis does not work in Ant 1.1 - you need to use Ant 1.2RC or wait a faw days until release. In Ant 1.1 properties will always get set and they get set while parsing the build-file.

Nico

  ----- Original Message ----- 
  From: Morgan Fletcher 
  To: 'ant-user@jakarta.apache.org' 
  Sent: Sunday, October 15, 2000 1:55 AM
  Subject: Property set inside target that should be passed over


  I've got a target that looks like this: 

    <target name="prepare_compiler" if="usebcj"> 
          <property name="bcj" value="${provato.home}/../tools/jbuilder3/bin/bcj.exe"/> 
          <available property="bcj_available" file="${bcj}"/> 
    </target> 

  If the property usebcj is not set, the properties bcj and bcj_available get set anyway: 

   +Target: prepare_compiler 
     +Task: property Setting project property: bcj -> d:\depots\eng\main\components/../tools/jbuilder3/bin/bcj.exe    
     +Task: available Setting project property: bcj_available -> true 

  Shouldn't the if="usebcj" condition cause those properties to not be set? If that's not the case, how would I conditionally set the two properties, based on the existence of usebcj?

  We're using 1.1. 

  Thanks, 

  morgan