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 4884] New: - Dependant targets fire unnecessarily
Date Thu, 15 Nov 2001 07:33:11 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=4884>.
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=4884

Dependant targets fire unnecessarily

           Summary: Dependant targets fire unnecessarily
           Product: Ant
           Version: 1.4.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: tgochenour@peregrine.com


Test this example:

<?xml version="1.0"?>
 
<project name="depends_test" default="test" basedir=".">
 
 <target name="start">
   <antcall target="test00"/>
   <antcall target="test01"/>
   <antcall target="test10"/>
   <antcall target="test11"/>
 </target>

 <target name="test00">
   <echo message="test00 fired"/>
   <antcall target="test"/>
 </target>
 <target name="test01">
   <echo message="test01 fired"/>
   <property name="test.ok" value="present"/>
   <antcall target="test"/>
 </target>
 <target name="test10">
   <echo message="test10 fired"/>
   <property name="skip.test" value="present"/>
   <antcall target="test"/>
 </target>
 <target name="test11">
   <echo message="test11 fired"/>
   <property name="test.ok" value="present"/>
   <property name="skip.present" value="present"/>
   <antcall target="test"/>
 </target>

 <target name="test" if="test.ok" unless="skip.test" depends="something">
    <echo message="test fired"/>
 </target>
 
 <target name="something">
  <echo message="something fired"/>
  <property name="skip.test" value="present"/>
 </target>
 
</project>

You'll get

test00 
something fired
test01
something fired
test10
something fired
test11
something fired

I don't want the target "something" to fire if "test.ok" is false 
or "skip.test" is true.  That's why the attribute is called "depends". 
Shouldn't dependant targets fire only when we're unsure whether the parent 
target could fire?  If we know it won't, why bother checking a dependant?

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