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=31513>.
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=31513

task dependencies are being executed even if 'if' attribute do not match

           Summary: task dependencies are being executed even if 'if'
                    attribute do not match
           Product: Ant
           Version: 1.6.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Trying to run the build only if some preconditions are set, like the property
containing a the path to an existing directory.

Unfortunately all preconditions of an tasks are being addressed although the
'if' attribute of the task is not set and the task itself won't, this seems not
to be the correct behavior.

EXAMPLE:

  <target name="all" depends="check-preconditions, build" />
  
  <target name="check-preconditions" depends="test-jcc-dir, casual-error-msg" />
  
  <target name="test-jcc-dir">
    <available file="${jcc_home.dir}" type="dir" property="valid-precondition" 
/>
  </target>  
  
  <target name="casual-error-msg" unless="valid-precondition">
      <echo message="ERROR: Please set the path of 'jcc_home.dir' in the
build.xml file!" />
  </target>    
  
  <target name="build" depends="clean, compile, test, dist"
if="valid-precondition" />

All targets listed as dependencies of 'build' are being addressed, although
there is no valid precondition.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to