You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2018/06/16 13:30:35 UTC

Re: Java modules as Ant resources

On 2018-06-10, Gintautas Grigelionis wrote:

> I would treating Java modules as Ant resources help in this scenario?

What extactly - beyond using a module as a zipfileset - would you want
to do?

Stefan

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


Re: Java modules as Ant resources

Posted by Gintautas Grigelionis <g....@gmail.com>.
Den lör 16 juni 2018 kl 17:47 skrev Stefan Bodewig <bo...@apache.org>:

> On 2018-06-16, Gintautas Grigelionis wrote:
>
> > if services would become a new mechanism for adding tasks, modules
> > would be of help by providing an API to discover them.
>
> Which may be a bit more tricky than it looks as currently tasks don't
> provide metadata about themselves (tag name, namespace uri) as this is
> handled by the surounding concepts like the antlib task.
>

Namespace is usually derived from package name and can be derived from
module name.
Tag name can be derived from service name, and it looks like provider
method [1] could be used as a mechanism for aliasing.

> Since modules are a jar with a twist, it seems that they could be
> > abstracted as resources if one would like to expose what's happening
> > under the hood/bonnet.
>
> The term resource might be overloaded and mean different things to you
> and me. In Ant terms a module would be a ResourceCollection, probably.
>

I see. Thanks for correction.


> > The question was more about whether that exposure would be useful (so
> > that there could be ModuleSets, etc).
>
> Something like a ZipGroupFileset?
>

Exactly.

Gintas

[1]
https://docs.oracle.com/javase/9/docs/api/java/util/ServiceLoader.html#developing-service-providers

Re: Java modules as Ant resources

Posted by Stefan Bodewig <bo...@apache.org>.
On 2018-06-16, Gintautas Grigelionis wrote:

> if services would become a new mechanism for adding tasks, modules
> would be of help by providing an API to discover them.

Which may be a bit more tricky than it looks as currently tasks don't
provide metadata about themselves (tag name, namespace uri) as this is
handled by the surounding concepts like the antlib task.

I agree, if we want to add an additional mechanism it should probably
use ServiceLoader and thus be supported by modules.

> Since modules are a jar with a twist, it seems that they could be
> abstracted as resources if one would like to expose what's happening
> under the hood/bonnet.

The term resource might be overloaded and mean different things to you
and me. In Ant terms a module would be a ResourceCollection, probably.

> The question was more about whether that exposure would be useful (so
> that there could be ModuleSets, etc).

Something like a ZipGroupFileset?

Stefan

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


Re: Java modules as Ant resources

Posted by Gintautas Grigelionis <g....@gmail.com>.
2018-06-16 16:04 GMT+02:00 Stefan Bodewig <bo...@apache.org>:

> On 2018-06-16, Gintautas Grigelionis wrote:
>
> > 2018-06-16 15:30 GMT+02:00 Stefan Bodewig <bo...@apache.org>:
>
> >> On 2018-06-10, Gintautas Grigelionis wrote:
>
> >>> I would treating Java modules as Ant resources help in this scenario?
>
> >> What exactly - beyond using a module as a zipfileset - would you want
> >> to do?
>
> > What about dependency graphs and service discovery? :-) [1]
>
> I'm afraid I'm too slow today. What exactly do you mean when you say you
> want to support Java modules as Ant resources?
>
> An Ant Resource (the class in org.apache.tools.ant.types) is something
> we can read from like a file or an URI and sometimes write to. I don't
> think this is what you have in mind as we can already do that to a Java
> module (which is a jar) and it is not related to dependency graphs or
> service discovery at all.
>

Sorry for not presenting the idea clearly because of time skip: if services
would become
a new mechanism for adding tasks, modules would be of help by providing an
API to discover them.
Since modules are a jar with a twist, it seems that they could be
abstracted as resources
if one would like to expose what's happening under the hood/bonnet.
The question was more about whether that exposure would be useful
(so that there could be ModuleSets, etc).

Gintas

Re: Java modules as Ant resources

Posted by Stefan Bodewig <bo...@apache.org>.
On 2018-06-16, Gintautas Grigelionis wrote:

> 2018-06-16 15:30 GMT+02:00 Stefan Bodewig <bo...@apache.org>:

>> On 2018-06-10, Gintautas Grigelionis wrote:

>>> I would treating Java modules as Ant resources help in this scenario?

>> What exactly - beyond using a module as a zipfileset - would you want
>> to do?

> What about dependency graphs and service discovery? :-) [1]

I'm afraid I'm too slow today. What exactly do you mean when you say you
want to support Java modules as Ant resources?

An Ant Resource (the class in org.apache.tools.ant.types) is something
we can read from like a file or an URI and sometimes write to. I don't
think this is what you have in mind as we can already do that to a Java
module (which is a jar) and it is not related to dependency graphs or
service discovery at all.

Stefan

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


Re: Java modules as Ant resources

Posted by Gintautas Grigelionis <g....@gmail.com>.
2018-06-16 15:30 GMT+02:00 Stefan Bodewig <bo...@apache.org>:

> On 2018-06-10, Gintautas Grigelionis wrote:
>
> > I would treating Java modules as Ant resources help in this scenario?
>
> What exactly - beyond using a module as a zipfileset - would you want
> to do?
>

What about dependency graphs and service discovery? :-) [1]

Gintas

[1]
https://docs.oracle.com/javase/9/docs/api/java/lang/module/package-summary.html