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 28513] New: - Ant executes targets that are dependencies of other targets which are not selected because of an "if" attribute.
Date Wed, 21 Apr 2004 14:47:10 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28513>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28513

Ant executes targets that are dependencies of other targets which are not selected because
of an "if" attribute.

           Summary: Ant executes targets that are dependencies of other
                    targets which are not selected because of an "if"
                    attribute.
           Product: Ant
           Version: 1.6.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: schveiguy@yahoo.com


If a target is not selected because of the "if" attribute, it's dependencies 
are still executed, even if there is no other reason to execute them.  Here is 
an example, with output also listed:

<project name="testif" default="good">
  <property name="property-that-is-set" value="true" />
  <target name="good" depends="notselected1,notselected2"/>
  <target name="notselected1" if="property-that-isnt-set" depends="bad-
target1">
    <echo message="shouldn't display this 1" />
  </target>
  <target name="notselected2" unless="property-that-is-set" depends="bad-
target2">
    <echo message="shouldn't display this 2" />
  </target>
  <target name="bad-target1">
    <echo message="bad target 1" />
  </target>
  <target name="bad-target2">
    <echo message="bad target 2" />
  </target>
</project>

Output:

[steves@localhost testant]$ ant -f build2.xml
Buildfile: build2.xml

bad-target1:
     [echo] bad target 1

notselected1:

bad-target2:
     [echo] bad target 2

notselected2:

good:

BUILD SUCCESSFUL
Total time: 0 seconds
[steves@localhost testant]$

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


Mime
View raw message