ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 5034] New: - If and unless enhancements.
Date Thu, 22 Nov 2001 13:26:49 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5034>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5034

If and unless enhancements.

           Summary: If and unless enhancements.
           Product: Ant
           Version: 1.4.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: simon.spruzen@rbos.com


Can the 'if'/'unless' mechanism (and properties) on a number of tasks be 
enhanced in the following ways:

1. Add simple expressions (even if it's just equals):
<target name="jar"
        depends="compile"
        if="jar.file = true">

or

<target name="jar"
        depends="compile"
        if="jar.file != true">

or perhaps nested elements (which feels more ant-like somehow):

<target name="jar"
        depends="compile">
   <ifequals property="name" value="value"/>
   <unlessequals property="name" value="value"/>
   ...
</target>
    

For target, document whether if/unless is evaluated before the depends 
attribute. So if (as above) jar depends on compile, there are two choices if 
the if statement is false:
Choice 1: do nothing
Choice 2: execute compile, but do not execute jar

2. Allow multiple properties (and expressions) in if and unless, separated by 
commas or semicolons: a comma means 'and', a semi-colon means 'or'. Or maybe 
expressions can understand && and ||, with comma falling back to mean 'and'.

3. Expand the list of tasks that understand if/unless (perhaps make it a 
general machanism), to include filesets, zipfilesets, filtersets, fail, 
property. This would allow more power within targets.

4. Add if/unless to the outer level of patternsets: the whole patternset 
becomes empty if the expression is true, else the patternset falls back to 
evaluating if/unless on each nested element.

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


Mime
View raw message