Skip to content

Commit

Permalink
Generate component diagram with plantuml separately
Browse files Browse the repository at this point in the history
Since the file is missing intermittently from the output of Asciidoctor
it's now generated separately in a standalone `plantuml` task.
  • Loading branch information
marcphilipp committed Oct 27, 2023
1 parent 5483662 commit 429815f
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 104 deletions.
18 changes: 11 additions & 7 deletions documentation/documentation.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {
alias(libs.plugins.asciidoctorConvert)
alias(libs.plugins.asciidoctorPdf)
alias(libs.plugins.gitPublish)
alias(libs.plugins.plantuml)
id("junitbuild.build-parameters")
id("junitbuild.kotlin-library-conventions")
id("junitbuild.testing-conventions")
Expand Down Expand Up @@ -207,6 +208,13 @@ tasks {
outputFile = standaloneConsoleLauncherShadowedArtifactsFile
}

plantUml {
fileFormat = "SVG"
outputs.cacheIf { true }
}

val componentDiagram = plantUml.flatMap { it.outputDirectory.file("component-diagram.svg") }

withType<AbstractAsciidoctorTask>().configureEach {
inputs.files(
generateConsoleLauncherOptions,
Expand All @@ -215,7 +223,8 @@ tasks {
generateConsoleLauncherEnginesOptions,
generateExperimentalApisTable,
generateDeprecatedApisTable,
generateStandaloneConsoleLauncherShadowedArtifactsFile
generateStandaloneConsoleLauncherShadowedArtifactsFile,
componentDiagram
)

resources {
Expand Down Expand Up @@ -248,6 +257,7 @@ tasks {
"experimentalApisTableFile" to experimentalApisTableFile.get(),
"deprecatedApisTableFile" to deprecatedApisTableFile.get(),
"standaloneConsoleLauncherShadowedArtifactsFile" to standaloneConsoleLauncherShadowedArtifactsFile.get(),
"componentDiagramFile" to componentDiagram.get(),
"outdir" to outputDir.absolutePath,
"source-highlighter" to "rouge",
"rouge-style" to "junit",
Expand Down Expand Up @@ -297,12 +307,6 @@ tasks {
"userGuidePdfFileName" to userGuidePdfFileName,
"releaseNotesUrl" to "../release-notes/index.html#release-notes"
))
doLast {
val componentDiagramSvg = outputDirProperty.file("user-guide/images/component-diagram.svg").get().asFile
require(componentDiagramSvg.exists()) {
"Component diagram was not generated at $componentDiagramSvg"
}
}
}

asciidoctorPdf {
Expand Down
98 changes: 1 addition & 97 deletions documentation/src/docs/asciidoc/user-guide/appendix.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -133,100 +133,4 @@ following _OpenTest4J_ JAR.
[[dependency-diagram]]
=== Dependency Diagram

[plantuml, component-diagram, svg]
----
skinparam {
defaultFontName Open Sans
}
package org.junit.jupiter {
[junit-jupiter] as jupiter
[junit-jupiter-api] as jupiter_api
[junit-jupiter-engine] as jupiter_engine
[junit-jupiter-params] as jupiter_params
[junit-jupiter-migrationsupport] as jupiter_migration_support
}
package org.junit.vintage {
[junit-vintage-engine] as vintage_engine
}
package org.junit.platform {
[junit-platform-commons] as commons
[junit-platform-console] as console
[junit-platform-engine] as engine
[junit-platform-jfr] as jfr
[junit-platform-launcher] as launcher
[junit-platform-reporting] as reporting
[junit-platform-runner] as runner
[junit-platform-suite] as suite
[junit-platform-suite-api] as suite_api
[junit-platform-suite-commons] as suite_commons
[junit-platform-suite-engine] as suite_engine
[junit-platform-testkit] as testkit
}
package "JUnit 4" {
[junit:junit] as junit4
}
package org.opentest4j {
[opentest4j]
}
package org.apiguardian {
[apiguardian-api] as apiguardian
note bottom of apiguardian #white
All artifacts except
opentest4j and junit:junit
have a dependency on this
artifact. The edges have
been omitted from this
diagram for the sake of
readability.
endnote
}
jupiter ..> jupiter_api
jupiter ..> jupiter_params
jupiter ..> jupiter_engine
jupiter_api ....> opentest4j
jupiter_api ...> commons
jupiter_engine ...> engine
jupiter_engine ..> jupiter_api
jupiter_params ..> jupiter_api
jupiter_migration_support ..> jupiter_api
jupiter_migration_support ...> junit4
console ..> launcher
console ..> reporting
launcher ..> engine
jfr ..> launcher
engine ....> opentest4j
engine ..> commons
reporting ..> launcher
runner ..> suite_commons
runner ...> junit4
suite ..> suite_api
suite ..> suite_engine
suite_engine ..> suite_commons
suite_commons ..> launcher
suite_commons ..> suite_api
testkit ....> opentest4j
testkit ..> launcher
vintage_engine ...> engine
vintage_engine ..> junit4
----
image::{componentDiagramFile}[]
98 changes: 98 additions & 0 deletions documentation/src/plantuml/component-diagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
@startuml

skinparam {
defaultFontName sans-serif
}

package org.junit.jupiter {
[junit-jupiter] as jupiter
[junit-jupiter-api] as jupiter_api
[junit-jupiter-engine] as jupiter_engine
[junit-jupiter-params] as jupiter_params
[junit-jupiter-migrationsupport] as jupiter_migration_support
}

package org.junit.vintage {
[junit-vintage-engine] as vintage_engine
}

package org.junit.platform {
[junit-platform-commons] as commons
[junit-platform-console] as console
[junit-platform-engine] as engine
[junit-platform-jfr] as jfr
[junit-platform-launcher] as launcher
[junit-platform-reporting] as reporting
[junit-platform-runner] as runner
[junit-platform-suite] as suite
[junit-platform-suite-api] as suite_api
[junit-platform-suite-commons] as suite_commons
[junit-platform-suite-engine] as suite_engine
[junit-platform-testkit] as testkit
}

package "JUnit 4" {
[junit:junit] as junit4
}

package org.opentest4j {
[opentest4j]
}

package org.apiguardian {
[apiguardian-api] as apiguardian
note bottom of apiguardian #white
All artifacts except
opentest4j and junit:junit
have a dependency on this
artifact. The edges have
been omitted from this
diagram for the sake of
readability.
endnote
}

jupiter ..> jupiter_api
jupiter ..> jupiter_params
jupiter ..> jupiter_engine

jupiter_api ....> opentest4j
jupiter_api ...> commons

jupiter_engine ...> engine
jupiter_engine ..> jupiter_api

jupiter_params ..> jupiter_api
jupiter_migration_support ..> jupiter_api
jupiter_migration_support ...> junit4

console ..> launcher
console ..> reporting

launcher ..> engine

jfr ..> launcher

engine ....> opentest4j
engine ..> commons

reporting ..> launcher

runner ..> suite_commons
runner ...> junit4

suite ..> suite_api
suite ..> suite_engine

suite_engine ..> suite_commons

suite_commons ..> launcher
suite_commons ..> suite_api

testkit ....> opentest4j
testkit ..> launcher

vintage_engine ...> engine
vintage_engine ..> junit4

@enduml
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ gitPublish = { id = "org.ajoberstar.git-publish", version = "4.2.1" }
jmh = { id = "me.champeau.jmh", version = "0.7.1" }
nohttp = { id = "io.spring.nohttp", version = "0.0.11" }
nexusPublish = { id = "io.github.gradle-nexus.publish-plugin", version = "2.0.0-rc-1" }
plantuml = { id = "io.freefair.plantuml", version = "8.4" }
versions = { id = "com.github.ben-manes.versions", version.ref = "gradleVersionsPlugin" }

0 comments on commit 429815f

Please sign in to comment.