You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Danny Yates <da...@codeaholics.org> on 2010/06/24 21:50:13 UTC

[Proposal] Capture attributes in unknown namespaces

Hi guys,

Me again!

I have some more functionality that I'm interested in, but I fear it may be
quite specific to my requirements, so I thought I'd run it past you all
before getting to work on it.

I'm developing a custom executor which can execute targets in parallel, and
as an extension of that, it would be kind of cool to be able to mark
individual targets as CPU-bound or IO-bound so that the executor can be a
bit smarter about scheduling them. However, I can't find any sensible way to
communicate this information to the executor.

What would be kind of cool would be that if the parser encounters attributes
in a namespace that it doesn't recognise, then instead of ignoring them (as
it does now), it records them and makes them available through an API on the
Project and Target objects. This would allow the executor to inspect them.

I realise this is very specific to my parallel executor project, but I think
adding it would be a non-breaking change that wouldn't have any impact on
existing consumers of the API.

What do you folks think?

Cheers,

Danny.

Re: [Proposal] Capture attributes in unknown namespaces

Posted by Danny Yates <da...@codeaholics.org>.
By the way, if you're interested in taking a look at my work, you can find
it here:

http://parallel-ant.googlecode.com/svn/trunk/

On 25 June 2010 11:59, Danny Yates <da...@codeaholics.org> wrote:

> Yes, I nabbed an alternative logger from a similar project :-) Basically,
> it outputs when a target starts and when it finishes, and for each task it
> outputs [target/task] instead of just [task] so you can see what's going on.
>
> I can't claim any responsibility for it though!
>
>
> On 25 June 2010 11:48, <Ja...@rzf.fin-nrw.de> wrote:
>
>> btw - when using parallel executors the problem of parallel logging output
>> must be resolved ;-)
>>
>> Jan
>>
>> >-----Ursprüngliche Nachricht-----
>> >Von: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
>> >Gesendet: Freitag, 25. Juni 2010 12:46
>> >An: dev@ant.apache.org
>> >Betreff: AW: [Proposal] Capture attributes in unknown namespaces
>> >
>> >Other point: we have an implementation in the sandbox
>> >https://svn.apache.org/repos/asf/ant/sandbox/parallelexecutor
>> >
>> >Maybe you could use some code ;-)
>> >
>> >
>> >Jan
>> >
>> >>-----Ursprüngliche Nachricht-----
>> >>Von: Dominique Devienne [mailto:ddevienne@gmail.com]
>> >>Gesendet: Donnerstag, 24. Juni 2010 23:12
>> >>An: Ant Developers List
>> >>Betreff: Re: [Proposal] Capture attributes in unknown namespaces
>> >>
>> >>On Thu, Jun 24, 2010 at 2:50 PM, Danny Yates
>> >><da...@codeaholics.org> wrote:
>> >>> What would be kind of cool would be that if the parser
>> >>encounters attributes
>> >>> in a namespace that it doesn't recognise, then instead of
>> >>ignoring them (as
>> >>> it does now), it records them and makes them available
>> >>through an API on the
>> >>> Project and Target objects. This would allow the executor to
>> >>inspect them.
>> >>
>> >>Something related to that was discussed in the past to allow arbitrary
>> >>"cross-cutting" attributes to be added to tasks which wouldn't
>> >>normally support them, typically in the context of adding global
>> >>ant:if and ant:unless attributes (or maybe I just thought about it,
>> >>I'm no longer sure ;)
>> >>
>> >>> I realise this is very specific to my parallel executor
>> >>project, but I think
>> >>> adding it would be a non-breaking change that wouldn't have
>> >>any impact on
>> >>> existing consumers of the API.
>> >>
>> >>True. But I'd be more in favor of an opt-in framework, where you
>> >>explicitly tell Ant to record attributes from specific namespaces.
>> >>From the list, I think other people also use "extra" markup in their
>> >>builds for "external" tools, so in their case they don't need to
>> >>record those attributes for examples.
>> >>
>> >>> What do you folks think?
>> >>
>> >>I think it's a good idea. There are design considerations like, should
>> >>it be free form string=string recorded as-is, or should these
>> >>attributes be processed like ordinary attributes Ant deals with to do
>> >>property expansion and conversion to Java types (like boolean
>> >>accepting "true"/"on"/"yes" as a true). For example, imagine you group
>> >>your extra attributes into a DataType part of an AntLib bound to that
>> >>extra namespace, the DataType could be instantiated "as usual" by Ant
>> >>provided it looked at the UnknownElement specifically for a given
>> >>namespace, and then the DataType is "bound" somehow to the task or
>> >>type or target. That way everything is typed as usual, and could be
>> >>made to reuse a lot of the existing code/facilities. See what I mean?
>> >>--DD
>> >>
>> >>---------------------------------------------------------------------
>> >>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> >>For additional commands, e-mail: dev-help@ant.apache.org
>> >>
>> >>
>> >
>> >---------------------------------------------------------------------
>> >To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> >For additional commands, e-mail: dev-help@ant.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> For additional commands, e-mail: dev-help@ant.apache.org
>>
>>
>

Re: [Proposal] Capture attributes in unknown namespaces

Posted by Danny Yates <da...@codeaholics.org>.
Yes, I nabbed an alternative logger from a similar project :-) Basically, it
outputs when a target starts and when it finishes, and for each task it
outputs [target/task] instead of just [task] so you can see what's going on.

I can't claim any responsibility for it though!


On 25 June 2010 11:48, <Ja...@rzf.fin-nrw.de> wrote:

> btw - when using parallel executors the problem of parallel logging output
> must be resolved ;-)
>
> Jan
>
> >-----Ursprüngliche Nachricht-----
> >Von: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
> >Gesendet: Freitag, 25. Juni 2010 12:46
> >An: dev@ant.apache.org
> >Betreff: AW: [Proposal] Capture attributes in unknown namespaces
> >
> >Other point: we have an implementation in the sandbox
> >https://svn.apache.org/repos/asf/ant/sandbox/parallelexecutor
> >
> >Maybe you could use some code ;-)
> >
> >
> >Jan
> >
> >>-----Ursprüngliche Nachricht-----
> >>Von: Dominique Devienne [mailto:ddevienne@gmail.com]
> >>Gesendet: Donnerstag, 24. Juni 2010 23:12
> >>An: Ant Developers List
> >>Betreff: Re: [Proposal] Capture attributes in unknown namespaces
> >>
> >>On Thu, Jun 24, 2010 at 2:50 PM, Danny Yates
> >><da...@codeaholics.org> wrote:
> >>> What would be kind of cool would be that if the parser
> >>encounters attributes
> >>> in a namespace that it doesn't recognise, then instead of
> >>ignoring them (as
> >>> it does now), it records them and makes them available
> >>through an API on the
> >>> Project and Target objects. This would allow the executor to
> >>inspect them.
> >>
> >>Something related to that was discussed in the past to allow arbitrary
> >>"cross-cutting" attributes to be added to tasks which wouldn't
> >>normally support them, typically in the context of adding global
> >>ant:if and ant:unless attributes (or maybe I just thought about it,
> >>I'm no longer sure ;)
> >>
> >>> I realise this is very specific to my parallel executor
> >>project, but I think
> >>> adding it would be a non-breaking change that wouldn't have
> >>any impact on
> >>> existing consumers of the API.
> >>
> >>True. But I'd be more in favor of an opt-in framework, where you
> >>explicitly tell Ant to record attributes from specific namespaces.
> >>From the list, I think other people also use "extra" markup in their
> >>builds for "external" tools, so in their case they don't need to
> >>record those attributes for examples.
> >>
> >>> What do you folks think?
> >>
> >>I think it's a good idea. There are design considerations like, should
> >>it be free form string=string recorded as-is, or should these
> >>attributes be processed like ordinary attributes Ant deals with to do
> >>property expansion and conversion to Java types (like boolean
> >>accepting "true"/"on"/"yes" as a true). For example, imagine you group
> >>your extra attributes into a DataType part of an AntLib bound to that
> >>extra namespace, the DataType could be instantiated "as usual" by Ant
> >>provided it looked at the UnknownElement specifically for a given
> >>namespace, and then the DataType is "bound" somehow to the task or
> >>type or target. That way everything is typed as usual, and could be
> >>made to reuse a lot of the existing code/facilities. See what I mean?
> >>--DD
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> >>For additional commands, e-mail: dev-help@ant.apache.org
> >>
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> >For additional commands, e-mail: dev-help@ant.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

AW: [Proposal] Capture attributes in unknown namespaces

Posted by Ja...@rzf.fin-nrw.de.
btw - when using parallel executors the problem of parallel logging output must be resolved ;-)

Jan 

>-----Ursprüngliche Nachricht-----
>Von: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de] 
>Gesendet: Freitag, 25. Juni 2010 12:46
>An: dev@ant.apache.org
>Betreff: AW: [Proposal] Capture attributes in unknown namespaces
>
>Other point: we have an implementation in the sandbox
>https://svn.apache.org/repos/asf/ant/sandbox/parallelexecutor
>
>Maybe you could use some code ;-)
>
>
>Jan 
>
>>-----Ursprüngliche Nachricht-----
>>Von: Dominique Devienne [mailto:ddevienne@gmail.com] 
>>Gesendet: Donnerstag, 24. Juni 2010 23:12
>>An: Ant Developers List
>>Betreff: Re: [Proposal] Capture attributes in unknown namespaces
>>
>>On Thu, Jun 24, 2010 at 2:50 PM, Danny Yates 
>><da...@codeaholics.org> wrote:
>>> What would be kind of cool would be that if the parser 
>>encounters attributes
>>> in a namespace that it doesn't recognise, then instead of 
>>ignoring them (as
>>> it does now), it records them and makes them available 
>>through an API on the
>>> Project and Target objects. This would allow the executor to 
>>inspect them.
>>
>>Something related to that was discussed in the past to allow arbitrary
>>"cross-cutting" attributes to be added to tasks which wouldn't
>>normally support them, typically in the context of adding global
>>ant:if and ant:unless attributes (or maybe I just thought about it,
>>I'm no longer sure ;)
>>
>>> I realise this is very specific to my parallel executor 
>>project, but I think
>>> adding it would be a non-breaking change that wouldn't have 
>>any impact on
>>> existing consumers of the API.
>>
>>True. But I'd be more in favor of an opt-in framework, where you
>>explicitly tell Ant to record attributes from specific namespaces.
>>>From the list, I think other people also use "extra" markup in their
>>builds for "external" tools, so in their case they don't need to
>>record those attributes for examples.
>>
>>> What do you folks think?
>>
>>I think it's a good idea. There are design considerations like, should
>>it be free form string=string recorded as-is, or should these
>>attributes be processed like ordinary attributes Ant deals with to do
>>property expansion and conversion to Java types (like boolean
>>accepting "true"/"on"/"yes" as a true). For example, imagine you group
>>your extra attributes into a DataType part of an AntLib bound to that
>>extra namespace, the DataType could be instantiated "as usual" by Ant
>>provided it looked at the UnknownElement specifically for a given
>>namespace, and then the DataType is "bound" somehow to the task or
>>type or target. That way everything is typed as usual, and could be
>>made to reuse a lot of the existing code/facilities. See what I mean?
>>--DD
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>>For additional commands, e-mail: dev-help@ant.apache.org
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>
>

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


AW: [Proposal] Capture attributes in unknown namespaces

Posted by Ja...@rzf.fin-nrw.de.
Other point: we have an implementation in the sandbox
https://svn.apache.org/repos/asf/ant/sandbox/parallelexecutor

Maybe you could use some code ;-)


Jan 

>-----Ursprüngliche Nachricht-----
>Von: Dominique Devienne [mailto:ddevienne@gmail.com] 
>Gesendet: Donnerstag, 24. Juni 2010 23:12
>An: Ant Developers List
>Betreff: Re: [Proposal] Capture attributes in unknown namespaces
>
>On Thu, Jun 24, 2010 at 2:50 PM, Danny Yates 
><da...@codeaholics.org> wrote:
>> What would be kind of cool would be that if the parser 
>encounters attributes
>> in a namespace that it doesn't recognise, then instead of 
>ignoring them (as
>> it does now), it records them and makes them available 
>through an API on the
>> Project and Target objects. This would allow the executor to 
>inspect them.
>
>Something related to that was discussed in the past to allow arbitrary
>"cross-cutting" attributes to be added to tasks which wouldn't
>normally support them, typically in the context of adding global
>ant:if and ant:unless attributes (or maybe I just thought about it,
>I'm no longer sure ;)
>
>> I realise this is very specific to my parallel executor 
>project, but I think
>> adding it would be a non-breaking change that wouldn't have 
>any impact on
>> existing consumers of the API.
>
>True. But I'd be more in favor of an opt-in framework, where you
>explicitly tell Ant to record attributes from specific namespaces.
>>From the list, I think other people also use "extra" markup in their
>builds for "external" tools, so in their case they don't need to
>record those attributes for examples.
>
>> What do you folks think?
>
>I think it's a good idea. There are design considerations like, should
>it be free form string=string recorded as-is, or should these
>attributes be processed like ordinary attributes Ant deals with to do
>property expansion and conversion to Java types (like boolean
>accepting "true"/"on"/"yes" as a true). For example, imagine you group
>your extra attributes into a DataType part of an AntLib bound to that
>extra namespace, the DataType could be instantiated "as usual" by Ant
>provided it looked at the UnknownElement specifically for a given
>namespace, and then the DataType is "bound" somehow to the task or
>type or target. That way everything is typed as usual, and could be
>made to reuse a lot of the existing code/facilities. See what I mean?
>--DD
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>
>

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


Re: [Proposal] Capture attributes in unknown namespaces

Posted by Dominique Devienne <dd...@gmail.com>.
On Thu, Jun 24, 2010 at 2:50 PM, Danny Yates <da...@codeaholics.org> wrote:
> What would be kind of cool would be that if the parser encounters attributes
> in a namespace that it doesn't recognise, then instead of ignoring them (as
> it does now), it records them and makes them available through an API on the
> Project and Target objects. This would allow the executor to inspect them.

Something related to that was discussed in the past to allow arbitrary
"cross-cutting" attributes to be added to tasks which wouldn't
normally support them, typically in the context of adding global
ant:if and ant:unless attributes (or maybe I just thought about it,
I'm no longer sure ;)

> I realise this is very specific to my parallel executor project, but I think
> adding it would be a non-breaking change that wouldn't have any impact on
> existing consumers of the API.

True. But I'd be more in favor of an opt-in framework, where you
explicitly tell Ant to record attributes from specific namespaces.
>From the list, I think other people also use "extra" markup in their
builds for "external" tools, so in their case they don't need to
record those attributes for examples.

> What do you folks think?

I think it's a good idea. There are design considerations like, should
it be free form string=string recorded as-is, or should these
attributes be processed like ordinary attributes Ant deals with to do
property expansion and conversion to Java types (like boolean
accepting "true"/"on"/"yes" as a true). For example, imagine you group
your extra attributes into a DataType part of an AntLib bound to that
extra namespace, the DataType could be instantiated "as usual" by Ant
provided it looked at the UnknownElement specifically for a given
namespace, and then the DataType is "bound" somehow to the task or
type or target. That way everything is typed as usual, and could be
made to reuse a lot of the existing code/facilities. See what I mean?
--DD

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


Re: [Proposal] Capture attributes in unknown namespaces

Posted by Matt Benson <gu...@gmail.com>.
On Jun 24, 2010, at 3:04 PM, Danny Yates wrote:

> Hmm... that's interesting. I hadn't discovered that before. It's not clear
> to me what that does - it appears to manipulate the DOM somehow.
> 
> Could you explain what it's for and how to use it and then I can see if it
> will help me solve my current problem.
> 

Admittedly, I didn't read the entire message to see _what_ you wanted namespaced attributes for.  :)  The Dynamic* interfaces are more for custom tasks, etc.  I could swear we've had a similar discussion about putting attributes on Targets before; at the very least you could create a custom ProjectHelper that instantiated a particular Target subclass.  One of our committers, Alexey Solofnenko, was once working on a parallel executor, but I don't know whether he ever completed it.

-Matt

> Many thanks,
> 
> Danny.
> 
> 
> On 24 June 2010 20:58, Matt Benson <gu...@gmail.com> wrote:
> 
>> Like org.apache.tools.ant.Dynamic*NS?
>> 
>> -Matt
>> 
>> On Jun 24, 2010, at 2:50 PM, Danny Yates wrote:
>> 
>>> Hi guys,
>>> 
>>> Me again!
>>> 
>>> I have some more functionality that I'm interested in, but I fear it may
>> be
>>> quite specific to my requirements, so I thought I'd run it past you all
>>> before getting to work on it.
>>> 
>>> I'm developing a custom executor which can execute targets in parallel,
>> and
>>> as an extension of that, it would be kind of cool to be able to mark
>>> individual targets as CPU-bound or IO-bound so that the executor can be a
>>> bit smarter about scheduling them. However, I can't find any sensible way
>> to
>>> communicate this information to the executor.
>>> 
>>> What would be kind of cool would be that if the parser encounters
>> attributes
>>> in a namespace that it doesn't recognise, then instead of ignoring them
>> (as
>>> it does now), it records them and makes them available through an API on
>> the
>>> Project and Target objects. This would allow the executor to inspect
>> them.
>>> 
>>> I realise this is very specific to my parallel executor project, but I
>> think
>>> adding it would be a non-breaking change that wouldn't have any impact on
>>> existing consumers of the API.
>>> 
>>> What do you folks think?
>>> 
>>> Cheers,
>>> 
>>> Danny.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> For additional commands, e-mail: dev-help@ant.apache.org
>> 
>> 


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


Re: [Proposal] Capture attributes in unknown namespaces

Posted by Danny Yates <da...@codeaholics.org>.
Hmm... that's interesting. I hadn't discovered that before. It's not clear
to me what that does - it appears to manipulate the DOM somehow.

Could you explain what it's for and how to use it and then I can see if it
will help me solve my current problem.

Many thanks,

Danny.


On 24 June 2010 20:58, Matt Benson <gu...@gmail.com> wrote:

> Like org.apache.tools.ant.Dynamic*NS?
>
> -Matt
>
> On Jun 24, 2010, at 2:50 PM, Danny Yates wrote:
>
> > Hi guys,
> >
> > Me again!
> >
> > I have some more functionality that I'm interested in, but I fear it may
> be
> > quite specific to my requirements, so I thought I'd run it past you all
> > before getting to work on it.
> >
> > I'm developing a custom executor which can execute targets in parallel,
> and
> > as an extension of that, it would be kind of cool to be able to mark
> > individual targets as CPU-bound or IO-bound so that the executor can be a
> > bit smarter about scheduling them. However, I can't find any sensible way
> to
> > communicate this information to the executor.
> >
> > What would be kind of cool would be that if the parser encounters
> attributes
> > in a namespace that it doesn't recognise, then instead of ignoring them
> (as
> > it does now), it records them and makes them available through an API on
> the
> > Project and Target objects. This would allow the executor to inspect
> them.
> >
> > I realise this is very specific to my parallel executor project, but I
> think
> > adding it would be a non-breaking change that wouldn't have any impact on
> > existing consumers of the API.
> >
> > What do you folks think?
> >
> > Cheers,
> >
> > Danny.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

Re: [Proposal] Capture attributes in unknown namespaces

Posted by Matt Benson <gu...@gmail.com>.
Like org.apache.tools.ant.Dynamic*NS?

-Matt

On Jun 24, 2010, at 2:50 PM, Danny Yates wrote:

> Hi guys,
> 
> Me again!
> 
> I have some more functionality that I'm interested in, but I fear it may be
> quite specific to my requirements, so I thought I'd run it past you all
> before getting to work on it.
> 
> I'm developing a custom executor which can execute targets in parallel, and
> as an extension of that, it would be kind of cool to be able to mark
> individual targets as CPU-bound or IO-bound so that the executor can be a
> bit smarter about scheduling them. However, I can't find any sensible way to
> communicate this information to the executor.
> 
> What would be kind of cool would be that if the parser encounters attributes
> in a namespace that it doesn't recognise, then instead of ignoring them (as
> it does now), it records them and makes them available through an API on the
> Project and Target objects. This would allow the executor to inspect them.
> 
> I realise this is very specific to my parallel executor project, but I think
> adding it would be a non-breaking change that wouldn't have any impact on
> existing consumers of the API.
> 
> What do you folks think?
> 
> Cheers,
> 
> Danny.


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