ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Priest <Robert.Pri...@bentley.com>
Subject RE: If statement
Date Mon, 03 Jun 2002 20:08:00 GMT
Thanks. That works.

-----Original Message-----
From: Anthony Rodriguez [mailto:Anthony@WeddingChannel.com]
Sent: Monday, June 03, 2002 3:27 PM
To: 'Ant Users List'
Subject: RE: If statement


I don't know if it's changed in 1.5 but I use <target> with if to do what
you are asking:

<condition property="run.exec" value="true">
      <equals name="someproperty" value="75" />
</condition>

So this sets the run.exec property to true.  You have to remember that in
Ant, if only checks to see if a property exists (is set) or does not exist
(is not set).  Then you would do this:

<target name="onlyRunifRunExecIsSet" if="run.exec">
	<exec ....
	</exec ...
</target>

Hope this helps.


Anthony Rodriguez
WeddingChannel.com
213 599-4419
arodriguez@weddingchannel.com

Need to buy a wedding gift?
Visit http://www.weddingchannel.com


> -----Original Message-----
> From: Robert Priest [mailto:Robert.Priest@bentley.com]
> Sent: Monday, June 03, 2002 12:20 PM
> To: 'Ant Users List'
> Subject: If statement
> 
> 
> Can anyone tell me how to write an if statement in Ant?
> What task should I read up on?
> 
> Basically I need an "if" that does the following:
> 
> if Property1 is true and Property2 is true
>   begin
> 	run somefile.exe (using <exec/> task)
>   end
> 
> I was looking at the condition task, but from what I see it 
> only sets a
> property.
> Which would be okay if  i could do:
> 
> <condition property="run.exec">
>    <and>
>      <istrue value="${someproperty}" />
>      <istrue value="${someproperty}" />
>    </ant>
>   </condition>
> 
>   <exec if="run.exec" ... </exec>
> 
> But that does not seem to be the case.
> 
> Anyone have any suggestions?
> 
> --
> To unsubscribe, e-mail:   
> <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:ant-user-help@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

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