ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Lalevée <nicolas.lale...@hibnet.org>
Subject Re: Command Line Debugging
Date Thu, 16 Jun 2011 18:03:42 GMT

Le 16 juin 2011 à 19:46, Matt Benson a écrit :

> On Thu, Jun 16, 2011 at 12:37 PM, Siddhartha Purkayastha
> <kpsiddharth@gmail.com> wrote:
>> Hi Matt,
>> 
>> I am not sure I understand the whole of what you said (probably I lack
>> sufficient context here), so I am trying to rephrase here -
>> 
>> What you are suggesting is we defer the creation of the PropertyDebugHelper
>> (our custom helper) till the execution of the "" target (which I assume is
>> the implicit target) is complete. The assumption being that we may expect a
>> custom propertyhelper, if available at all, to have been instantiated by
>> then. If there is such a propertyhelper it will be wrapped by the
>> PropertyDebugHelper instance and all that the latter would do is to do its
>> own stuff and then delegate the call to the actual wrapped helper. Is this
>> correct?
>> 
> 
> Correct.
> 
>> If so, I see two problems with this:
>> 
>> (a) It seems it is also possible to create propertyhelpers inside
>> user-defined targets - in which case we will not be able to track such
>> property helpers? May be that is why you brought up the question of
>> listeners for the project references table.
> 
> Correct again.
> 
>> (b) If the creation of the PropertyDebugHelper is deferred till later we
>> will not be able to define watch points on property creations that are
>> happening in the "" target.
> 
> I hadn't considered this.
> 
>> 
>> I think another way of attaining it could be to 'indirectly listen' for
>> calls to set a PropertyHelper instance in the taskFinished method of the
>> listener itself. As soon as we detect a call to the propertyhelper task has
>> finished, we can retrieve the new PropertyHelper, replace the existing
>> wrapped instance in PropertyDebugHelper with the new one, and set this
>> PropertyDebugHelper instance back as the PropertyHelper reference for the
>> project.
>> 
>> How does this sound?
> 
> Strictly speaking, it isn't 100% necessary to use the
> PropertyHelperTask to replace the PropertyHelper.  However, in my
> experience it's not something you can do with stock Ant tasks, instead
> requiring Java (or, I suppose, script) code to do.  So why would
> anyone *not* use the provided task to do it?  Therefore this seems
> reasonable.

Or instead of monitoring the execution of the task PropertyHelperTask, you can simply check
that after each task execution the current property helper is still the wrapped one. If not
the wrapped one, then wrap it. It should be cpu costless as a simple comparison of pointers
should be enough.

Nicolas


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


Mime
View raw message