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 31487] New: - execution of top level tasks in imported files get delayed by targets
Date Thu, 30 Sep 2004 14:32:57 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=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: dev@ant.apache.org
        ReportedBy: bodewig@apache.org


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

[bodewig@bodewig 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

[bodewig@bodewig 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: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message