Description
Currently, we instrument javac
and javadoc
with --module-path
and some other options, but we're not making use of --module-source-path
. Such approach means that some references between module descriptors are not allowed although they should (compilation fails).
Example
module A {
requires B;
}
module B {
exports org.test.pkg to A;
}
Currently, Gradle will first try to compile B's module-info.java
, but it will fail saying that it can't find module A
.
With --module-source-path
+ --module
(as suggested by @sormuras), we should be able to compile one module at a time (as we do now), but with the awareness of other modules before they're compiled.
Problems
-
To use
--module-source-path
, projects need to be in a layout where project dir name = module name. There's a convention for such naming (again, by @sormuras), but it's not widely used yet. Hence, this plugin would need to work for any kind of layout.- Potential solution: add a build-wide task that would copy all the
module-info.java
files into e.g.build/modules
(allcompileJava
andjavadoc
tasks would need to depend on such a task).
- Potential solution: add a build-wide task that would copy all the