ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale Anson <dan...@germane-software.com>
Subject Re: Conditional Statement
Date Wed, 30 Jul 2003 22:32:49 GMT
Matt, I agree, there are a lot of people who don't want to install 
anything that is not "out of the box" Ant.

Let me clear up what seems to be a bit of confusion about Antelope on 
this list. Antelope is actually a gui application for running Ant. You 
feed it a build file, and it produces a set of buttons, one per target. 
Just click a button to run the target. It integrates nicely with jEdit. 
On this list, it seems to me that references to Antelope often means the 
extra tasks that are distributed with the application. There are a dozen 
or so tasks, including if/else, try/catch/finally, and some others. The 
tasks are available as a separate download from Antelope, so you can 
install the tasks without installing the full Antelope application. 
Using these tasks is not really any different than using the junit tasks 
or the tomcat tasks.

Dale


Matt wrote:

>Yeah Dale, your are right but I am not in the position of telling folks
>in my department that after upgrading Ant in the IDE , installing
>cvs.exe now start installing antelope.
>
>But yeah antelope makes it far simpler,no doubt.
>
>Matt
>
>-----Original Message-----
>From: Dale Anson [mailto:danson@germane-software.com] 
>Sent: Wednesday, July 30, 2003 3:10 PM
>To: Ant Users List
>Subject: Re: Conditional Statement
>
>Whew! Way too much work for such a simple problem.
>
>Antelope is at http://antelope.sourceforge.net. Using <if>:
>
><project name="test" default="whatever" basedir=".">
>   <taskdef name="if" classname="ise.antelope.tasks.IfTask"/>  
>   <property name="var1" value="Vik"/>
>   <property name="var2" value="Vik"/>
>   <target name="whatever">
>       <if name="var1" value="${var2}">
>         <echo>They are equal.</echo>
>         <else>
>            <echo>They are different.</echo>
>         </else>
>       </if>
>   </target>
></project>
>
>Docs for <if> are on-line at 
>http://antelope.sourceforge.net/manual/bk03ch05.html.
>
>Hope this helps!
>
>Dale
>
>
>
>Matt Benson wrote:
>
>  
>
>>><target name="init">
>>>			
>>>	<property name="var1" value="Vik"/>
>>>	<property name="var2" value="Vik"/>
>>>	<property name="var3" value="Viky"/>
>>></target>
>>><target name="suzCvsTest" description="Test"
>>>depends="init">
>>>	
>>>	<condition property="test">
>>>	<equals arg1="${var1}" arg2="${var3}"/>
>>>	</condition>
>>></target>
>>>
>>><target name="suzCvsTest1" if="test"
>>>description="Test"
>>>depends="suzCvsTest">
>>>	
>>>	<echo message="Values are equal=${test}"/>
>>>     
>>></target>
>>>
>>>
>>>Now since var1 is not equal to var3 the
>>>target=suzCvsTest1 wasn't
>>>executed. In the books and manual the "if" attribute
>>>in the <target> is
>>>defined as "if the given property has been defined
>>>the target will be
>>>executed".
>>>   
>>>
>>>      
>>>
>>Yep, if the property has been defined... but to do an
>>either/or:
>>
>><target name="init">
>>	<property name="var1" value="Vik"/>
>>	<property name="var2" value="Vik"/>
>>	<property name="var3" value="Viky"/>
>></target>
>><target name="suzCvsTest" description="Test"
>>depends="init">
>>	<condition property="test">
>>		<equals arg1="${var1}" arg2="${var3}"/>
>>	</condition>
>></target>
>>
>><target name="resultno" unless="test">
>>	<echo message="Values are not equal=${test}"/>
>></target>
>>
>><target name="resultyes" if="test">
>>	<echo message="Values are equal=${test}"/>
>></target>
>>
>><target name="suzCvsTest1" description="Test"
>>depends="suzCvsTest,resultno,resultyes" />
>>
>>Kind of big for the amount of work actually being done
>>in this contrived example, but you get the general
>>idea.
>>
>>-Matt
>>
>>__________________________________
>>Do you Yahoo!?
>>Yahoo! SiteBuilder - Free, easy-to-use web site design software
>>http://sitebuilder.yahoo.com
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>For additional commands, e-mail: user-help@ant.apache.org
>>
>> 
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>  
>


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


Mime
View raw message