You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2009/01/14 11:03:17 UTC

DO NOT REPLY [Bug 46526] New: Document behaviour of properties set in target called by antcall

https://issues.apache.org/bugzilla/show_bug.cgi?id=46526

           Summary: Document behaviour of properties set in target called by
                    antcall
           Product: Ant
           Version: 1.7.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Documentation
        AssignedTo: notifications@ant.apache.org
        ReportedBy: davidcorley@gmail.com


Having inherited a legacy build system, I came across strange behavior with an
antcall task. I found that properties set in the target called by the antcall
task were not available at later points in the build. I couldn't understand
this as the documentation states that properties are immutable.
It was only after coming across the antcall ant-contrib task that I understood
the antcall task behavior when it comes to properties set in the called target.

http://ant-contrib.sourceforge.net/tasks/tasks/antcallback_task.html

The current documentation for <antcall> in the Ant manual makes no reference to
the fact that:

a) A new Ant project is created
b) Any properties set in the target called by <antcall> are cleared after the
target has run.

Can someone please update the <antcall> manual page to reflect this
information?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46526] Document behaviour of properties set in target called by antcall

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46526





--- Comment #2 from David Corley <da...@gmail.com>  2009-01-14 07:29:29 PST ---
(In reply to comment #1)
> ! /Users/mbenson/oss/asf/ant/docs/manual> grep -ci "new project"
> CoreTasks/antcall.html 
> 10
> ! /Users/mbenson/oss/asf/ant/docs/manual> 
> 
> --------
> 
> I will concede that the manual could be more explicit:  "The called target(s)
> are run in a new project; be aware that this means properties, references, etc.
> set by called targets will not persist back to the calling project."
> 
> Finally, you should be aware that for probably going on five years now macros,
> rather than <antcall>ed targets, are the preferred way to perform
> compartmentalized tasks within your build.  I don't believe I've run into a
> situation where a macro wouldn't suffice for what I was trying to accomplish.
> 

I agree about macros and I use them wherever possible. In fact this was part of
the reason I came across this issue. I was not used to using antcall (inherited
old build code) and didn't understand its behavior.
Anyway, thanks for the update.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46526] Document behaviour of properties set in target called by antcall

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46526





--- Comment #1 from Matt Benson <gu...@yahoo.com>  2009-01-14 07:24:12 PST ---
! /Users/mbenson/oss/asf/ant/docs/manual> grep -ci "new project"
CoreTasks/antcall.html 
10
! /Users/mbenson/oss/asf/ant/docs/manual> 

--------

I will concede that the manual could be more explicit:  "The called target(s)
are run in a new project; be aware that this means properties, references, etc.
set by called targets will not persist back to the calling project."

Finally, you should be aware that for probably going on five years now macros,
rather than <antcall>ed targets, are the preferred way to perform
compartmentalized tasks within your build.  I don't believe I've run into a
situation where a macro wouldn't suffice for what I was trying to accomplish.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46526] Document behaviour of properties set in target called by antcall

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46526


Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |1.8.0




--- Comment #3 from Stefan Bodewig <bo...@apache.org>  2009-01-26 21:25:44 PST ---
svn revision 738005 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=738005 )


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.