Another clarification on module source spread across multiple locations
Jonathan Gibbons
jonathan.gibbons at oracle.com
Thu Aug 18 15:53:23 UTC 2016
On 08/18/2016 05:17 AM, Alan Bateman wrote:
> On 11/08/2016 05:50, Jayaprakash Arthanareeswaran wrote:
>
>> Hi Alan,
>> I also need a clarification on the following passage in JEP 261:
>> /"In large systems the source code for a particular module may be
>> spread across several different directories. In the JDK itself
>> <http://openjdk.java.net/jeps/201>, e.g., the source files for a
>> module may be found in any one of the directories
>> |src/<module>/share/classes|, |src/<module>/<os>/classes|, or
>> |build/gensrc/<module>|, where |<os>| is the name of the target
>> operating system. To express this in a module source path while
>> preserving module identities we allow each element of such a path to
>> use braces (|{| and |}|) to enclose commas-separated lists of
>> alternatives and a single asterisk (|*|) to stand for the module
>> name. The module source path for the JDK can then be written as/
>> /|{src/*/{share,<os>}/classes,build/gensrc/*}|"/
>> While the first sentence states spread across several directories,
>> later on it states ' /may be found in any _one_ of the directories/'.
>> Does "any one of" really mean "any of" ?
>> Can you please confirm that it is indeed possible to specify multiple
>> directories at once for a specific module.
>>
> Jon would be the best person to answer this but "yes", the module
> source path specify multiple directories using this syntax. That is,
> the source code for a module may be in distinct directories. We have
> this in the JDK because there are platform specific classes, also a
> lot of source code generated at build time.
>
> -Alan
It means "any of". Once a module has been determined to be on the
module source path (as compared to any of the other module paths), the
sources for the module may appear in any of the appropriate directories
on the module source path. For any particular source file, "first one
wins", meaning that the items listed on the module source path are
checked in order, in the same way that javac searches a regular source path.
-- Jon
More information about the jigsaw-dev
mailing list