GH-713 - Create aggregating Asciidoc document including all files generated.

This commit is contained in:
Cora Iberkleid
2024-07-06 11:02:22 -04:00
committed by Oliver Drotbohm
parent bd2e4964fe
commit b94d13b717
4 changed files with 229 additions and 6 deletions

View File

@@ -7,6 +7,8 @@ Spring Modulith's `Documenter` abstraction can produce two different kinds of sn
* C4 and UML component diagrams describing the relationships between the individual application modules
* A so-called __Application Module Canvas__, a tabular overview about the module and the most relevant elements in those (Spring beans, aggregate roots, events published and listened to as well as configuration properties).
Additionally, `Documenter` can produce an aggregating Asciidoc file that includes all existing component diagrams and canvases.
[[component-diagrams]]
== Generating Application Module Component diagrams
@@ -302,3 +304,46 @@ This will detect component stereotypes defined by https://github.com/xmolecules/
* __Application events listened to by the module__ -- Derived from methods annotated with Spring's `@EventListener`, `@TransactionalEventListener`, jMolecules' `@DomainEventHandler` or beans implementing `ApplicationListener`.
* __Configuration properties__ -- Spring Boot Configuration properties exposed by the application module.
Requires the usage of the `spring-boot-configuration-processor` artifact to extract the metadata attached to the properties.
[[aggregating-document]]
== Generating an Aggregating Document
The aggregating document can be generated by calling `Documenter.writeAggregatingDocument()`:
.Generating an aggregating document using `Documenter`
[tabs]
======
Java::
+
[source, java, role="primary"]
----
class DocumentationTests {
ApplicationModules modules = ApplicationModules.of(Application.class);
@Test
void writeDocumentationSnippets() {
new Documenter(modules)
.writeAggregatingDocument();
}
}
----
Kotlin::
+
[source, kotlin, role="secondary"]
----
class DocumentationTests {
private val modules = ApplicationModules.of(Application::class)
@Test
fun writeDocumentationSnippets() {
Documenter(modules)
.writeAggregatingDocument()
}
}
----
======
The aggregating document will include any existing application module component diagrams and application module canvases. If there are none, then this method will not produce an output file.