GH-102 - ApplicationModules now allows traversing modules in topological order.

We now optionally integrate with the JGraphT library to calculate the topological order of modules based on their dependency structure. That order is then exposed in ApplicationModules' iteration and via ….getComparator().

Renamed FormattableJavaClass to FormattableType and allow it to be created from a plain Class as well.
This commit is contained in:
Oliver Drotbohm
2023-01-04 23:38:28 +01:00
parent dde02ae257
commit a7e033172b
12 changed files with 205 additions and 40 deletions

View File

@@ -34,7 +34,7 @@ import org.springframework.modulith.model.ApplicationModules;
import org.springframework.modulith.model.ArchitecturallyEvidentType;
import org.springframework.modulith.model.DependencyType;
import org.springframework.modulith.model.EventType;
import org.springframework.modulith.model.FormatableJavaClass;
import org.springframework.modulith.model.FormatableType;
import org.springframework.modulith.model.Source;
import org.springframework.modulith.model.SpringBean;
import org.springframework.util.Assert;
@@ -259,7 +259,7 @@ class Asciidoctor {
ApplicationModule module = modules.getModuleByType(source).orElse(null);
String typeAndMethod = toCode(
toTypeAndMethod(FormatableJavaClass.of(source).getAbbreviatedFullName(module), methodSignature));
toTypeAndMethod(FormatableType.of(source).getAbbreviatedFullName(module), methodSignature));
if (module == null
|| !source.getModifiers().contains(JavaModifier.PUBLIC)