gradlex-org/java-module-dependencies

Improve project dependency calculation

Closed this issue · 1 comments

Currently we guess the complete module name of other modules (source sets in other subprojects) in the same build:

https://github.com/jjohannes/java-module-dependencies/blob/bb1b089bde9185827541d5271aaf40207b75b79b/src/main/java/de/jjohannes/gradle/moduledependencies/JavaModuleDependenciesPlugin.java#L169-L171

That is why currently all module names need to correspond to the project name and have the same prefix (if any). Ideally, we would know the real module names from the module-info.java files of the projects. For that however, we need to share this info between all projects before we do dependency analysis. Maybe this could be done during configuration time by storing this information in an Extension on the root project or in a build service.
When the actual dependencies are calculated in withDependencies { ... } al projects should be configured and the information should be available then.

Current solution is stabilized and tested; individual mappings or moduleNamePrefixToGroup mappings can be used for special cases.