Currently ModuleDetector[1] is capable of detecting module names from pom.xml files, build.xml files, and MANIFEST.MF files. But I would also like to look for Gradle module names. Typically in a multi-module Gradle project, the module name would match the subdirectory that the module is in, but it can also be overridden by settings.gradle[2]. The easy way would be to find the build.gradle file the same way it looks for the other files, and take that file's parent directory name:
./
|-- settings.gradle
|-- build.gradle
|-- moduleA/
|-- build.gradle
|-- build/ (contains for example **/checkstyle-result.xml)
|-- moduleB/
|-- build.gradle
|-- build/
So as an example, when we find ./moduleA/build/reports/checkstyle/checkstyle-result.xml, that belongs to the ":moduleA" gradle module. [1] https://github.com/jenkinsci/analysis-model/blob/master/src/main/java/edu/hm/hafner/analysis/ModuleDetector.java [2] https://docs.gradle.org/current/userguide/organizing_gradle_projects.html |