Reusing module name token `*` in -d

Jonathan Gibbons jonathan.gibbons at
Mon Jan 23 19:51:18 UTC 2017


I don't think this proposal is a good way to go. If nothing else, it would
require all the module-specific output directories to be created ahead
of time, so that javac can determine which ones to use, which would
require additional setup commands to be executed after a "make clean"
or its equivalent in other build systems.

Also, I note that the output directory is typically never the final location
for the compiled classes; it is typically just a "staging area". It has 
been the case that a single compilation for different packages from 
libraries would result in the classes being placed in a single output 
hierarchy, and that the classes could then be selectively packaged into
different files like .jar files.   If you're compiling modules together,
why could you not do something similar?

-- Jon

On 01/21/2017 02:00 AM, Nicolai Parlog wrote:
>   Hi!
> Another feature request from the trenches regarding multi-module
> compilation. (It is possible that there was a similar thread a couple of
> days/weeks (?) back but I didn't find it.)
> It would be nice to have the ability to specify module specific target
> folders, so they do not automatically end up in
> `<whatever-was-given-to-d>/<module-name>`.
> It seems obvious (which could very well make it stupid) to reuse the
> asterisk here and allow something like
> javac
> 	--module-path mods
> 	--module-source-path "./*/src/main/java"
> 	-d "./*/target/classes"
> 	-module initial.module
> I have not thought through how this might or might not work with
> multiple module source paths. It looks like the only tractable approach
> would be to not allow more than one -d element.
>   so long ... Nicolai

More information about the jigsaw-dev mailing list