Skip to content

Commit 429815f

Browse files
committed
Generate component diagram with plantuml separately
Since the file is missing intermittently from the output of Asciidoctor it's now generated separately in a standalone `plantuml` task.
1 parent 5483662 commit 429815f

File tree

4 files changed

+111
-104
lines changed

4 files changed

+111
-104
lines changed

documentation/documentation.gradle.kts

+11-7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ plugins {
1111
alias(libs.plugins.asciidoctorConvert)
1212
alias(libs.plugins.asciidoctorPdf)
1313
alias(libs.plugins.gitPublish)
14+
alias(libs.plugins.plantuml)
1415
id("junitbuild.build-parameters")
1516
id("junitbuild.kotlin-library-conventions")
1617
id("junitbuild.testing-conventions")
@@ -207,6 +208,13 @@ tasks {
207208
outputFile = standaloneConsoleLauncherShadowedArtifactsFile
208209
}
209210

211+
plantUml {
212+
fileFormat = "SVG"
213+
outputs.cacheIf { true }
214+
}
215+
216+
val componentDiagram = plantUml.flatMap { it.outputDirectory.file("component-diagram.svg") }
217+
210218
withType<AbstractAsciidoctorTask>().configureEach {
211219
inputs.files(
212220
generateConsoleLauncherOptions,
@@ -215,7 +223,8 @@ tasks {
215223
generateConsoleLauncherEnginesOptions,
216224
generateExperimentalApisTable,
217225
generateDeprecatedApisTable,
218-
generateStandaloneConsoleLauncherShadowedArtifactsFile
226+
generateStandaloneConsoleLauncherShadowedArtifactsFile,
227+
componentDiagram
219228
)
220229

221230
resources {
@@ -248,6 +257,7 @@ tasks {
248257
"experimentalApisTableFile" to experimentalApisTableFile.get(),
249258
"deprecatedApisTableFile" to deprecatedApisTableFile.get(),
250259
"standaloneConsoleLauncherShadowedArtifactsFile" to standaloneConsoleLauncherShadowedArtifactsFile.get(),
260+
"componentDiagramFile" to componentDiagram.get(),
251261
"outdir" to outputDir.absolutePath,
252262
"source-highlighter" to "rouge",
253263
"rouge-style" to "junit",
@@ -297,12 +307,6 @@ tasks {
297307
"userGuidePdfFileName" to userGuidePdfFileName,
298308
"releaseNotesUrl" to "../release-notes/index.html#release-notes"
299309
))
300-
doLast {
301-
val componentDiagramSvg = outputDirProperty.file("user-guide/images/component-diagram.svg").get().asFile
302-
require(componentDiagramSvg.exists()) {
303-
"Component diagram was not generated at $componentDiagramSvg"
304-
}
305-
}
306310
}
307311

308312
asciidoctorPdf {

documentation/src/docs/asciidoc/user-guide/appendix.adoc

+1-97
Original file line numberDiff line numberDiff line change
@@ -133,100 +133,4 @@ following _OpenTest4J_ JAR.
133133
[[dependency-diagram]]
134134
=== Dependency Diagram
135135

136-
[plantuml, component-diagram, svg]
137-
----
138-
skinparam {
139-
defaultFontName Open Sans
140-
}
141-
142-
package org.junit.jupiter {
143-
[junit-jupiter] as jupiter
144-
[junit-jupiter-api] as jupiter_api
145-
[junit-jupiter-engine] as jupiter_engine
146-
[junit-jupiter-params] as jupiter_params
147-
[junit-jupiter-migrationsupport] as jupiter_migration_support
148-
}
149-
150-
package org.junit.vintage {
151-
[junit-vintage-engine] as vintage_engine
152-
}
153-
154-
package org.junit.platform {
155-
[junit-platform-commons] as commons
156-
[junit-platform-console] as console
157-
[junit-platform-engine] as engine
158-
[junit-platform-jfr] as jfr
159-
[junit-platform-launcher] as launcher
160-
[junit-platform-reporting] as reporting
161-
[junit-platform-runner] as runner
162-
[junit-platform-suite] as suite
163-
[junit-platform-suite-api] as suite_api
164-
[junit-platform-suite-commons] as suite_commons
165-
[junit-platform-suite-engine] as suite_engine
166-
[junit-platform-testkit] as testkit
167-
}
168-
169-
package "JUnit 4" {
170-
[junit:junit] as junit4
171-
}
172-
173-
package org.opentest4j {
174-
[opentest4j]
175-
}
176-
177-
package org.apiguardian {
178-
[apiguardian-api] as apiguardian
179-
note bottom of apiguardian #white
180-
All artifacts except
181-
opentest4j and junit:junit
182-
have a dependency on this
183-
artifact. The edges have
184-
been omitted from this
185-
diagram for the sake of
186-
readability.
187-
endnote
188-
}
189-
190-
jupiter ..> jupiter_api
191-
jupiter ..> jupiter_params
192-
jupiter ..> jupiter_engine
193-
194-
jupiter_api ....> opentest4j
195-
jupiter_api ...> commons
196-
197-
jupiter_engine ...> engine
198-
jupiter_engine ..> jupiter_api
199-
200-
jupiter_params ..> jupiter_api
201-
jupiter_migration_support ..> jupiter_api
202-
jupiter_migration_support ...> junit4
203-
204-
console ..> launcher
205-
console ..> reporting
206-
207-
launcher ..> engine
208-
209-
jfr ..> launcher
210-
211-
engine ....> opentest4j
212-
engine ..> commons
213-
214-
reporting ..> launcher
215-
216-
runner ..> suite_commons
217-
runner ...> junit4
218-
219-
suite ..> suite_api
220-
suite ..> suite_engine
221-
222-
suite_engine ..> suite_commons
223-
224-
suite_commons ..> launcher
225-
suite_commons ..> suite_api
226-
227-
testkit ....> opentest4j
228-
testkit ..> launcher
229-
230-
vintage_engine ...> engine
231-
vintage_engine ..> junit4
232-
----
136+
image::{componentDiagramFile}[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
@startuml
2+
3+
skinparam {
4+
defaultFontName sans-serif
5+
}
6+
7+
package org.junit.jupiter {
8+
[junit-jupiter] as jupiter
9+
[junit-jupiter-api] as jupiter_api
10+
[junit-jupiter-engine] as jupiter_engine
11+
[junit-jupiter-params] as jupiter_params
12+
[junit-jupiter-migrationsupport] as jupiter_migration_support
13+
}
14+
15+
package org.junit.vintage {
16+
[junit-vintage-engine] as vintage_engine
17+
}
18+
19+
package org.junit.platform {
20+
[junit-platform-commons] as commons
21+
[junit-platform-console] as console
22+
[junit-platform-engine] as engine
23+
[junit-platform-jfr] as jfr
24+
[junit-platform-launcher] as launcher
25+
[junit-platform-reporting] as reporting
26+
[junit-platform-runner] as runner
27+
[junit-platform-suite] as suite
28+
[junit-platform-suite-api] as suite_api
29+
[junit-platform-suite-commons] as suite_commons
30+
[junit-platform-suite-engine] as suite_engine
31+
[junit-platform-testkit] as testkit
32+
}
33+
34+
package "JUnit 4" {
35+
[junit:junit] as junit4
36+
}
37+
38+
package org.opentest4j {
39+
[opentest4j]
40+
}
41+
42+
package org.apiguardian {
43+
[apiguardian-api] as apiguardian
44+
note bottom of apiguardian #white
45+
All artifacts except
46+
opentest4j and junit:junit
47+
have a dependency on this
48+
artifact. The edges have
49+
been omitted from this
50+
diagram for the sake of
51+
readability.
52+
endnote
53+
}
54+
55+
jupiter ..> jupiter_api
56+
jupiter ..> jupiter_params
57+
jupiter ..> jupiter_engine
58+
59+
jupiter_api ....> opentest4j
60+
jupiter_api ...> commons
61+
62+
jupiter_engine ...> engine
63+
jupiter_engine ..> jupiter_api
64+
65+
jupiter_params ..> jupiter_api
66+
jupiter_migration_support ..> jupiter_api
67+
jupiter_migration_support ...> junit4
68+
69+
console ..> launcher
70+
console ..> reporting
71+
72+
launcher ..> engine
73+
74+
jfr ..> launcher
75+
76+
engine ....> opentest4j
77+
engine ..> commons
78+
79+
reporting ..> launcher
80+
81+
runner ..> suite_commons
82+
runner ...> junit4
83+
84+
suite ..> suite_api
85+
suite ..> suite_engine
86+
87+
suite_engine ..> suite_commons
88+
89+
suite_commons ..> launcher
90+
suite_commons ..> suite_api
91+
92+
testkit ....> opentest4j
93+
testkit ..> launcher
94+
95+
vintage_engine ...> engine
96+
vintage_engine ..> junit4
97+
98+
@enduml

gradle/libs.versions.toml

+1
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,5 @@ gitPublish = { id = "org.ajoberstar.git-publish", version = "4.2.1" }
8383
jmh = { id = "me.champeau.jmh", version = "0.7.1" }
8484
nohttp = { id = "io.spring.nohttp", version = "0.0.11" }
8585
nexusPublish = { id = "io.github.gradle-nexus.publish-plugin", version = "2.0.0-rc-1" }
86+
plantuml = { id = "io.freefair.plantuml", version = "8.4" }
8687
versions = { id = "com.github.ben-manes.versions", version.ref = "gradleVersionsPlugin" }

0 commit comments

Comments
 (0)