per-module module-source-path for javac

Jonathan Gibbons jonathan.gibbons at oracle.com
Fri Dec 16 14:50:03 UTC 2016


Nikolay,

We are looking at this.

One aspect of the problem we have to take into account is that 
currently, the JavaFileManager API does not special case the module 
source path (yes, I know the *implementation* special cases it, even at 
the handleOption level) and so we need to come up with a way providing 
and specifying the functionality you are looking for in a way that fits 
in with the overall design.

-- Jon



On 12/16/16 5:05 AM, Nikolay Chashnikov wrote:
> Any comments?
>
> On Mon, Dec 12, 2016 at 8:29 PM, Nikolay Chashnikov <
> nikolay.chashnikov at jetbrains.com> wrote:
>
>> Hello,
>>
>> we're actively working on support for Jigsaw in IntelliJ IDEA. Some time
>> ago we asked (see this post
>> <http://mail.openjdk.java.net/pipermail/jigsaw-dev/2016-October/009713.html>)
>> about restrictions in --module-source-path parameter of javac command line.
>> It appears that currently javac has rather strict requirements regarding
>> layout of the source files of multi-module projects on the disk: module
>> sources must be located under a directory which name is equal to the
>> (qualified) module name, and locations of source directories for different
>> modules must follow some common scheme. It's ok for new projects, but it
>> complicates migration of existing projects to Jigsaw: you not only need to
>> create module-info.java files, get rid of split packages, etc, but also
>> most probably you'll need to rearrange directories containing the sources.
>> For me, the latter looks like an unnecessary complication, it may make
>> migration to Jigsaw more difficult, especially for big projects developed
>> by large teams. I think it would be great to allow users to specify
>> module-source-path for each module individually.
>>
>> Given that the implementation (com.sun.tools.javac.file.Locations.
>> ModuleSourcePathLocationHandler) already stores paths for different
>> modules separately, it seems to be rather easy to expose ability to specify
>> module-source-path on per-module basis to StandardJavaFileManager's API.
>> The change in API suggested by Jonathan Gibbons (see this post
>> <http://mail.openjdk.java.net/pipermail/jigsaw-dev/2016-October/009781.html>)
>> looks good, it will allow us to support arbitrary layout of sources in
>> IntelliJ IDEA. Do you plan to implement it? How can we help you with that?
>>
>> --
>> Nikolay Chashnikov
>> Team Lead
>> JetBrains
>> http://www.jetbrains.com
>> The Drive to Develop
>>
>
>



More information about the jigsaw-dev mailing list