Modules merging support in ClassAnalyzer
Mandy Chung
Mandy.Chung at Sun.COM
Wed Oct 28 10:45:44 PDT 2009
Mark Reinhold wrote:
> I think it would be cleaner, and simpler, not to introduce a two-level
> naming scheme and a distinct concept of "group" module. Instead just
> have modules with a single flat namespace and the ability to include one
> module into another. The analyzer would only generate output files for
> "top level" modules, i.e., those that are not included in any other
> module.
>
> This would allow the fine-grained modules we've been using for analysis
> to be defined independently of the coarser-grained modules we'll use when
> we actually modularize the build. Ideally such definitions could be kept
> in two separate files in order to allow easy experimentation.
>
> In concrete terms:
>
> module jdbc-base
> include java.sql.*
>
> module jdbc-enterprise
> include javax.sql.XA* javax.sql.rowset.**
>
> module jdbc
> include jdbc-base jdbc-enterprise
>
>
My initial proposal was very close to what you suggest except that I
used "require" instead of "include" for merging modules. "require" may
not be a good match and I didn't think of using "include" (that's a
great suggestion). In addition, Alan and I have an assumption that we
only need to support two-level naming scheme and thus revised the proposal.
I agree that it's cleaner and simpler syntax that provides the ability
to include one module into another instead of introducing a two-level
naming scheme.
> This would generate just jdbc.{classlist,dependencies,summary}.
>
>
>> Alan suggests to remove the "module" key and instead have the module name
>> quoted in a square bracket like this:
>>
>> [base]
>>
>> [jdbc:jdbc-base]
>> include = java.sql.*
>>
>> I don't have any objection to this syntax change. I can make the change along
>> with the modules merging support.
>>
>
> If we're going to change the syntax then I'd like to see it evolve toward
> something more like that of module-info.java files. We'll gradually need
> to add more module-info-like constructs (e.g., permits), and in the long
> term I'd like the tool to be able to generate the module-info.java files
> which we'll need in the build.
>
That's what we want the tool to do (generating the module-info.java file
for the build to use). I'll change the syntax after I add the module
merging support.
Thanks
Mandy
> Something like this:
>
> module jdbc-base {
> include java.sql.*;
> }
>
> module jdbc-enterprise {
> include java.sql.XA*, javax.sql.rowset.**;
> }
>
> module jdbc {
> include jdbc-base, jdbc-enterprise;
> }
>
> - Mark
>
More information about the jigsaw-dev
mailing list