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

execution of top level tasks in imported files get delayed by targets

           Summary: execution of top level tasks in imported files get
                    delayed by targets
           Product: Ant
           Version: 1.7Alpha (nightly)
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Core
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I've stripped down the problem mentioned in
<http://marc.theaimsgroup.com/?l=ant-user&m=109655281326491&w=2>.

Suppose we have

outer.xml
=========
<project name="outer">
  <import file="inner.xml"/>
  <property name="foo" value="${bar}"/>
  <echo>foo is ${foo}</echo>
</project>

inner.xml
=========
<project name="inner">
  <target name="baz"/>
  <property name="bar" value="bar is set"/>
  <echo>bar is ${bar}</echo>
</project>

This results in

[EMAIL PROTECTED] tmp]$ ant -f outer.xml 
Buildfile: outer.xml
     [echo] foo is ${bar}
     [echo] bar is bar is set

BUILD SUCCESSFUL
Total time: 1 second


Now remove the target from inner.xml

[EMAIL PROTECTED] tmp]$ ant -f outer.xml 
Buildfile: outer.xml
     [echo] bar is set
     [echo] foo is bar is set

BUILD SUCCESSFUL
Total time: 1 second

So if the imported file contains targets, its top level task get delayed until
the ones of the importing file are done.  If it doesn't, they get executed
immediately.  This is clearly wrong, both should behave the same way.

One can argue which way is the correct one, my vote would be for "execute
immediately" since it seems more intuitive.

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

Reply via email to