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 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 (all compileJava and javadoc tasks would need to depend on such a task).
Currently, we instrument
javacandjavadocwith--module-pathand 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
Currently, Gradle will first try to compile B's
module-info.java, but it will fail saying that it can't find moduleA.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.module-info.javafiles into e.g.build/modules(allcompileJavaandjavadoctasks would need to depend on such a task).