Java modules as Ant resources (was: Generate manifest files and add automatic module names for JPMS)

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Java modules as Ant resources (was: Generate manifest files and add automatic module names for JPMS)

Gintautas Grigelionis
2018-02-07 18:25 GMT+01:00 Stefan Bodewig <[hidden email]>:

>
>> Maybe it will be easier to digest if we start at a higher level of what
>> needs to be changed. I don't think moving classes so we don't have any
>> split packages anymore will be enough.
>>
>> I'd expect we'd need to replace all code that deals with classloaders
>> and replace it with ServiceLoaders if we want to avoid complex startup
>> scenarios for example. Given there is no interface or base class tasks
>> or types must implement this may again force us to change this model. Or
>> maybe I'm just wrong.
>>
>> If we want a broader audience we may want to change the subject :-)
>>
>
I would treating Java modules as Ant resources help in this scenario?

Gintas
Reply | Threaded
Open this post in threaded view
|

Re: Java modules as Ant resources

Stefan Bodewig
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Java modules as Ant resources

Gintautas Grigelionis
2018-06-16 15:30 GMT+02:00 Stefan Bodewig <[hidden email]>:

> 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
Reply | Threaded
Open this post in threaded view
|

Re: Java modules as Ant resources

Stefan Bodewig
On 2018-06-16, Gintautas Grigelionis wrote:

> 2018-06-16 15:30 GMT+02:00 Stefan Bodewig <[hidden email]>:

>> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Java modules as Ant resources

Gintautas Grigelionis
2018-06-16 16:04 GMT+02:00 Stefan Bodewig <[hidden email]>:

> On 2018-06-16, Gintautas Grigelionis wrote:
>
> > 2018-06-16 15:30 GMT+02:00 Stefan Bodewig <[hidden email]>:
>
> >> 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
Reply | Threaded
Open this post in threaded view
|

Re: Java modules as Ant resources

Stefan Bodewig
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Java modules as Ant resources

Gintautas Grigelionis
Den lör 16 juni 2018 kl 17:47 skrev Stefan Bodewig <[hidden email]>:

> 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