ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tshepo Rachidi" <Tshe...@discovery.co.za>
Subject RE: RE: Setting the value of a property conditonally
Date Fri, 04 Aug 2006 13:41:37 GMT
In that case create a target1

Target1 depends on target2 ,target3 , target4

Create condition 1, condition 2, condition 3 ,condition 4


Target2 only runs if condition 1 is true
Target3 only runs if condition 2 is true
Target4 only runs if condition 3 is true

Does it help?  

-----Original Message-----
From: cknell@onebox.com [mailto:cknell@onebox.com] 
Sent: Friday 04 August 2006 15:27
To: user@ant.apache.org
Subject: RE: RE: Setting the value of a property conditonally

Your example shows exactly the limitation I'm trying to get around.
There are only two possible values that "hasMoney" can take in your
example. Either "hasMoney" is "true" or "hasMoney" is false.

I'm faced with a situation that calls for me to select the previous
"business day". In the U.S. business days are generally Mon, Tue, Wed,
Thu, Fri, with Saturday and Sunday not usually counted.

On most days of the week, the previous business day is the current date
- 1 day. On Monday however, the previous business day is the current
date - 3 days.

Federal holidays complicate the matter further. In the U.S. most federal
holidays are observed on Mondays. Therefore, on a Tuesday following a
Monday that is a federal holiday, the previous business day is the
current date - 4 days.

Some federal holidays do occur on other days, so on days following one
of these, the previous business day is the current date - 2 days
(unless, of course, the federal holiday falls on a non-business day).

This is all fairly easily handled in XSLT using the <xsl:choose> element
and a list of the dates on which federal holidays are observed.

I have worked out an alternative plan that calls for using the <xslt>
task to process the file containing the list of federal holidays and
create a new XML file holding the data I want. I could then use the
<xmlproperty> element to set the values of the properties.

I don't really want to create an intermediate file to perform this task,
so I'm asking if there is any other way to achieve this result in Ant
that I'm not seeing because I have the wrong mental model.
--
Charles Knell
cknell@onebox.com - email



-----Original Message-----
From:     Tshepo Rachidi <TshepoR@discovery.co.za>
Sent:     Fri, 4 Aug 2006 15:07:33 +0200
To:       "Ant Users List" <user@ant.apache.org>
Subject:  RE: Setting the value of a property conditonally

I think that u have to type as follows

 <condition property="hasMoney" value="false" else="true">
	<not>
		<equals arg1="${wallet}" arg2="${empty}"/>
	</not>
 </condition>

If I am wrong please rectify.
I am still a newbie
Regards,
Tshepo

-----Original Message-----
From: cknell@onebox.com [mailto:cknell@onebox.com] 
Sent: Friday 04 August 2006 15:01
To: user@ant.apache.org
Subject: Setting the value of a property conditonally

I've been testing the <condition> task and either it is very limited in
its functioning or I am carrying the wrong mental model into the
exercise.

I work mostly in XSLT these days. There I can set the value of a
variable by testing any number of conditions and nested conditions using
the <xsl:choose> element.

<condition> appears to be based on the "if-then-else" model. What I'm
looking for is a means of setting a property on the "if-then-else-elsif"
model.

Is there some way of doing this with ant 1.65 as it stands or do I have
to write an extension to accomplish this?

Thanks.

--
Charles Knell
cknell@onebox.com - email

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

Discovery Holdings Limited

Registration number: 1999/007789/06

This message and any attachments are confidential and intended solely
for the addressee. If you have received this message in error, please
notify Discovery immediately, telephone number +27 11 529 2888. Any
unauthorised use; alteration or dissemination of the contents of this
email is strictly prohibited. In no event will Discovery or the sender
be liable in any manner whatsoever to any person for any loss or any
direct, indirect, special or consequential damages arising from use of
this email or any linked website, including, without limitation, from
any lost profits, business interruption, loss of programmes or other
data that may be stored on any information handling system or otherwise
from any assurance that this email is virus free even if Discovery is
expressly advised of the possibility of such damages. Discovery is an
Authorised Financial Services Provider. A full list of directors is
available on our website at 
https://www.discovery.co.za/index_login.jhtml?p_content=/investor_relati
ons/directorate.jhtml alternatively, to obtain a full list of Directors
via email, please email directors_list@discovery.co.za

 

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

Discovery Holdings Limited

Registration number: 1999/007789/06

This message and any attachments are confidential and intended solely for the addressee. If
you have received this message in error, please notify Discovery immediately, telephone number
+27 11 529 2888. Any unauthorised use; alteration or dissemination of the contents of this
email is strictly prohibited. In no event will Discovery or the sender be liable in any manner
whatsoever to any person for any loss or any direct, indirect, special or consequential damages
arising from use of this email or any linked website, including, without limitation, from
any lost profits, business interruption, loss of programmes or other data that may be stored
on any information handling system or otherwise from any assurance that this email is virus
free even if Discovery is expressly advised of the possibility of such damages. Discovery
is an Authorised Financial Services Provider. A full list of directors is available on our
website at 
https://www.discovery.co.za/index_login.jhtml?p_content=/investor_relations/directorate.jhtml
alternatively, to obtain a full list of Directors via email, please email directors_list@discovery.co.za

 

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


Mime
View raw message