You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2006/12/07 19:12:16 UTC

DO NOT REPLY [Bug 41127] New: - Need getter for oata.taskdefs.Ant.newProject

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

           Summary: Need getter for oata.taskdefs.Ant.newProject
           Product: Ant
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P4
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: carej@us.ibm.com


I have an extension of the Ant task that needs access to the "newProject"
member; unfortunately this member is private and no getter is provided.

I am requesting that a getter be provided for the "newProject" member.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41127] - Need getter for oata.taskdefs.Ant.newProject

Posted by bu...@apache.org.
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=41127>.
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=41127





------- Additional Comments From carej@us.ibm.com  2006-12-07 11:35 -------
I had tried overriding the init method, but unfortunately that wasn't enough for
my use case.

I'll spare you the gory details, but basically I needed to inject certain things
into the new project's reference table *before* the build.xml for the new
project is parsed (and the implicit target is run). I tried using addReference
to do the injection, but the references are actually copied to the new project
too late for the scenario I'm in.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41127] - Need getter for oata.taskdefs.Ant.newProject

Posted by bu...@apache.org.
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=41127>.
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=41127





------- Additional Comments From carej@us.ibm.com  2006-12-07 10:37 -------
Looks great Matt; thanks a lot - this will make my life a little easier when Ant
1.7 goes GA.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41127] - Need getter for oata.taskdefs.Ant.newProject

Posted by bu...@apache.org.
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=41127>.
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=41127





------- Additional Comments From ddevienne@gmail.com  2006-12-07 12:12 -------
I believe that I hack I've presented would suffise, but not knowing the
specifics of what you are doing, I could be wrong, especially since I was
writting an AntReturn task, that got access to properties and references from
the sub-project, to inject them back into the parent project (Ant-Contrib has
the same thing, but as a copy-paste of Ant, unlike my version).

The _newProject is populated by the call to createProperty with the subproject
before it is run, so you could have done your reference injection at this point.
But in any case, having a protected getNewProject() is cleaner, although I
wonder what kind of "hacks" you'll be using it ;-) What I was doing was not
exactly kosher either ;-))) --DD

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41127] - Need getter for oata.taskdefs.Ant.newProject

Posted by bu...@apache.org.
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=41127>.
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=41127


gudnabrsam@yahoo.com changed:

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




------- Additional Comments From gudnabrsam@yahoo.com  2006-12-07 10:25 -------
Jeff, I've made this small change in svn HEAD with a little more internal
refactoring.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41127] - Need getter for oata.taskdefs.Ant.newProject

Posted by bu...@apache.org.
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=41127>.
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=41127





------- Additional Comments From carej@us.ibm.com  2006-12-07 12:38 -------
(In reply to comment #7)

Taking a closer look at your hack, I think you're right - we probably could have
used that or something similar. At first inspection I was just assuming that you
were trying to add implicit nested elements - an approach that I had tried and
not had any luck with. That's what I get for reading quickly...

Fortunately we distribute Ant (1.6.5) with our add-on antlibs as a complete
bundle, so I'm able to replace the oata.taskdefs.Ant class with a patched
version (from SVN trunk) - not an ideal solution but we've had to do this for
other bug fixes so it's a well established pattern.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41127] - Need getter for oata.taskdefs.Ant.newProject

Posted by bu...@apache.org.
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=41127>.
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=41127





------- Additional Comments From ddevienne@gmail.com  2006-12-07 11:21 -------
Oh yeah, and I had code like this in the task's init() method:

      // Create dummy property to get at nested project
      Property p = createProperty();
      p.setName("sdliugyhspuygh.asdjhriawu120983472$376asdbfandbfa7347");
      p.setValue("");

      // Now use _newProject...

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41127] - Need getter for oata.taskdefs.Ant.newProject

Posted by bu...@apache.org.
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=41127>.
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=41127





------- Additional Comments From ddevienne@gmail.com  2006-12-07 11:18 -------
Note that I faked this change a long time ago, for a task that extends Ant,
using the code below. You'd need an accessor or reflection if you can't derive
from the Ant task/class. --DD

  /**
   * Creates a new nested property element.
   * <p>
   * This call is used to catch the new project thru the created property...
   * Since the nested project is normally not accessible: Wicked!
   *
   * @return the created (unconfigured) property.
   */
  public Property createProperty() {
    Property p = super.createProperty();
    _newProject = p.getProject();
    return p;
  }

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41127] - Need getter for oata.taskdefs.Ant.newProject

Posted by bu...@apache.org.
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=41127>.
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=41127





------- Additional Comments From carej@us.ibm.com  2006-12-07 10:18 -------
Created an attachment (id=19225)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=19225&action=view)
suggested patch


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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org