Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
3f3fa58
Adjust headings in generated API reports
marcphilipp Nov 17, 2025
1b4b92e
Set up Antora module
marcphilipp Nov 17, 2025
58b94a4
Add task to build Antora site locally
marcphilipp Nov 23, 2025
843f074
Extract conventions plugin
marcphilipp Nov 23, 2025
74a2d7e
Update README to reference Antora
marcphilipp Nov 23, 2025
a586b4e
Remove Asciidoctor plugins
marcphilipp Nov 23, 2025
c76c6ab
Remove git-publish plugin and corresponding GitHub Action steps
marcphilipp Nov 23, 2025
fd01ffa
Use Node.js plugin directly
marcphilipp Dec 7, 2025
b915c80
Install Node.js via GitHub Action
marcphilipp Dec 7, 2025
6f770d0
Move images to Antora module
marcphilipp Dec 7, 2025
566beec
Migrate link attributes to antora.yml
marcphilipp Dec 7, 2025
06c3ee7
Remove Asciidoctor User Guide main document
marcphilipp Dec 7, 2025
502839e
Move overview.adoc to Antora module
marcphilipp Dec 7, 2025
af16b07
Migrate overview.adoc to Antora syntax
marcphilipp Dec 7, 2025
c5c89a1
Add overview.adoc to navigation
marcphilipp Dec 7, 2025
fab5ec0
Move writing-tests.adoc to Antora module
marcphilipp Dec 7, 2025
5c4e125
Migrate writing-tests.adoc sections to Antora
marcphilipp Dec 7, 2025
4133182
Migrate writing-tests sections to Antora syntax
marcphilipp Dec 7, 2025
b6185b4
Add writing-tests sections to navigation
marcphilipp Dec 7, 2025
7b6e4d6
Move migrating-from-junit4.adoc to Antora module
marcphilipp Dec 7, 2025
cb87b31
Migrate migrating-from-junit4.adoc to Antora syntax
marcphilipp Dec 7, 2025
ba9bc1c
Add migrating-from-junit4.adoc to navigation
marcphilipp Dec 7, 2025
4b21791
Move running-tests.adoc to Antora module
marcphilipp Dec 7, 2025
ce6b2b8
Migrate running-tests.adoc sections to Antora
marcphilipp Dec 7, 2025
9a91512
Migrate running-tests sections to Antora syntax
marcphilipp Dec 7, 2025
8f2ab79
Add running-tests sections to navigation
marcphilipp Dec 7, 2025
6ffb485
Move extensions.adoc to Antora module
marcphilipp Dec 7, 2025
27057c1
Migrate extensions.adoc sections to Antora
marcphilipp Dec 7, 2025
d9b8c54
Migrate extensions sections to Antora syntax
marcphilipp Dec 7, 2025
336f793
Add extensions sections to navigation
marcphilipp Dec 7, 2025
2a204f8
Remove Advanced Topics include file
marcphilipp Dec 7, 2025
679dd62
Move junit-platform-reporting.adoc to Antora module
marcphilipp Dec 7, 2025
94421b6
Migrate junit-platform-reporting.adoc to Antora syntax
marcphilipp Dec 7, 2025
1b25c9a
Move junit-platform-suite-engine.adoc to Antora module
marcphilipp Dec 7, 2025
1dc6ca4
Migrate junit-platform-suite-engine.adoc to Antora syntax
marcphilipp Dec 7, 2025
1b09417
Move testkit.adoc to Antora module
marcphilipp Dec 7, 2025
d81d53d
Migrate testkit.adoc to Antora syntax
marcphilipp Dec 7, 2025
1681476
Move launcher-api.adoc to Antora module
marcphilipp Dec 7, 2025
a19f51d
Migrate launcher-api.adoc to Antora syntax
marcphilipp Dec 7, 2025
42445c2
Move engines.adoc to Antora module
marcphilipp Dec 7, 2025
c374131
Migrate engines.adoc to Antora syntax
marcphilipp Dec 7, 2025
32c773f
Add advanced topics to navigation
marcphilipp Dec 7, 2025
873bca3
Move api-evolution.adoc to Antora module
marcphilipp Dec 7, 2025
218b471
Migrate api-evolution.adoc to Antora syntax
marcphilipp Dec 7, 2025
e37158d
Add api-evolution.adoc to navigation
marcphilipp Dec 7, 2025
4a10399
Remove Contributors link to GitHub
marcphilipp Dec 7, 2025
e195932
Move release-notes.adoc to Antora module
marcphilipp Dec 7, 2025
7ec0531
Migrate release-notes.adoc to Antora syntax
marcphilipp Dec 7, 2025
4183ffb
Add release-notes.adoc to navigation
marcphilipp Dec 7, 2025
057bb1b
Move individual release note files to Antora module
marcphilipp Dec 7, 2025
eee25ca
Move release-notes-TEMPLATE.adoc to Antora module
marcphilipp Dec 7, 2025
2b25d54
Migrate release-notes-TEMPLATE.adoc to Antora syntax
marcphilipp Dec 7, 2025
c1ef601
Move appendix.adoc to Antora module
marcphilipp Dec 7, 2025
2fb0b44
Migrate appendix.adoc to Antora syntax
marcphilipp Dec 7, 2025
7874051
Add appendix.adoc to navigation
marcphilipp Dec 7, 2025
a8eb0db
Fix links
marcphilipp Dec 7, 2025
3e4bbf7
Remove obsolete Asciidoctor resources
marcphilipp Dec 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,26 +122,15 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install graphviz
- name: Build Documentation
uses: ./.github/actions/run-gradle
- name: Install Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
encryptionKey: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
arguments: |
prepareDocsForUploadToGhPages \
-Dscan.tag.Documentation
- name: Configure Git
shell: bash
run: |
git config --global user.name "JUnit Team"
git config --global user.email "[email protected]"
- name: Upload Documentation
if: github.event_name == 'push' && github.repository == 'junit-team/junit-framework' && github.ref == 'refs/heads/main'
node-version-file: documentation/.tool-versions
- name: Build Documentation
uses: ./.github/actions/run-gradle
with:
encryptionKey: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
arguments: |
gitPublishPush \
antora \
-Pantora.downloadNode=false \
-Dscan.tag.Documentation
env:
GIT_USERNAME: git
GIT_PASSWORD: ${{ secrets.JUNIT_BUILDS_GITHUB_TOKEN_DOCS_REPO }}
5 changes: 5 additions & 0 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rules:
cache-poisoning:
ignore:
# reports issues for setup-node which isn't used while releasing
- main.yml
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ checksums*
# snapshot-tests
*.snapshot_actual
*.snapshot_raw

# Antora
/documentation/node_modules/
1 change: 1 addition & 0 deletions documentation/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 24.11.1
21 changes: 6 additions & 15 deletions documentation/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
# JUnit User Guide

This subproject contains the AsciiDoc sources for the JUnit User Guide.
This subproject contains the Antora/AsciiDoc sources for the JUnit User Guide.

## Structure

- `src/docs/asciidoc`: AsciiDoc files
- `modules/ROOT/pages`: AsciiDoc files
- `src/test/java`: Java test source code that can be included in the AsciiDoc files
- `src/test/kotlin`: Kotlin test source code that can be included in the AsciiDoc files
- `src/test/resources`: Classpath resources that can be included in the AsciiDoc files or
used in tests

## Usage

### Generate AsciiDoc
### Generate Antora site

This following Gradle command generates the HTML version of the User Guide as
`build/docs/asciidoc/user-guide/index.html`.
`build/antora/build/site`.

```
./gradlew asciidoctor
./gradlew antora
```

On Linux operating systems, the `graphviz` package providing `/usr/bin/dot` must be
installed in order to generate the User Guide.

### Generate AsciiDocPdf

This following Gradle command generates the PDF version of the User Guide to
`build/docs/asciidocPdf/user-guide/index.pdf`.

```
./gradlew asciidoctorPdf
```
installed in order to generate the PlantUML images used in the User Guide.
26 changes: 26 additions & 0 deletions documentation/antora-playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
antora:
extensions:
- '@antora/collector-extension'
- '@antora/lunr-extension'
- require: '@springio/antora-extensions/root-component-extension'
root_component_name: junit
- require: '@springio/antora-extensions/root-attachments-extension'
site:
title: JUnit User Guide
url: https://docs.junit.org
content:
sources:
- url: @GIT_REPO_ROOT@
branches: @GIT_BRANCH_NAME@
start_path: documentation
worktrees: true
asciidoc:
attributes:
attribute-missing: warn
runtime:
log:
failure_level: warn
ui:
bundle:
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
snapshot: true
295 changes: 295 additions & 0 deletions documentation/antora.yml

Large diffs are not rendered by default.

205 changes: 22 additions & 183 deletions documentation/documentation.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ import junitbuild.exec.RunConsoleLauncher
import junitbuild.extensions.isSnapshot
import junitbuild.extensions.javaModuleName
import junitbuild.javadoc.ModuleSpecificJavadocFileOption
import org.asciidoctor.gradle.base.AsciidoctorAttributeProvider
import org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask
import org.gradle.api.tasks.PathSensitivity.RELATIVE
import org.ysb33r.grolifant.api.core.jvm.ExecutionMode.JAVA_EXEC

plugins {
alias(libs.plugins.asciidoctorConvert)
alias(libs.plugins.asciidoctorPdf)
alias(libs.plugins.gitPublish)
alias(libs.plugins.plantuml)
id("junitbuild.antora-conventions")
id("junitbuild.build-parameters")
id("junitbuild.kotlin-library-conventions")
id("junitbuild.testing-conventions")
Expand Down Expand Up @@ -84,14 +79,6 @@ dependencies {
standaloneConsoleLauncher(projects.junitPlatformConsoleStandalone)
}

asciidoctorj {
setJrubyVersion(libs.versions.jruby)
modules {
pdf.version(libs.versions.asciidoctorj.pdf)
}
requires(file("src/docs/asciidoc/resources/themes/rouge_junit.rb"))
}

val buildRevision: String by rootProject.extra
val snapshot = version.isSnapshot()
val docsVersion = if (snapshot) "snapshot" else version
Expand All @@ -103,30 +90,6 @@ val userGuidePdfFileName = "junit-user-guide-${version}.pdf"
val ota4jDocVersion = libs.versions.opentest4j.map { if (it.isSnapshot()) "snapshot" else it }.get()
val apiGuardianDocVersion = libs.versions.apiguardian.map { if (it.isSnapshot()) "snapshot" else it }.get()

gitPublish {
repoUri = "https://github.com/junit-team/docs.junit.org.git"

branch = "main"
sign = false
fetchDepth = 1

username = providers.environmentVariable("GIT_USERNAME")
password = providers.environmentVariable("GIT_PASSWORD")

contents {
from(docsDir)
into(".")
}

preserve {
include("**/*")
exclude("$docsVersion/**")
if (replaceCurrentDocs) {
exclude("current/**")
}
}
}

val generatedAsciiDocPath = layout.buildDirectory.dir("generated/asciidoc")
val consoleLauncherOptionsFile = generatedAsciiDocPath.map { it.file("console-launcher-options.txt") }
val consoleLauncherDiscoverOptionsFile = generatedAsciiDocPath.map { it.file("console-launcher-discover-options.txt") }
Expand Down Expand Up @@ -270,8 +233,8 @@ tasks {

val plantUmlOutputDirectory = plantUml.flatMap { it.outputDirectory }

withType<AbstractAsciidoctorTask>().configureEach {
inputs.files(
val generateAsciidocInputs by registering {
dependsOn(
generateConsoleLauncherOptions,
generateConsoleLauncherDiscoverOptions,
generateConsoleLauncherExecuteOptions,
Expand All @@ -280,100 +243,6 @@ tasks {
generateStandaloneConsoleLauncherShadowedArtifactsFile,
plantUmlOutputDirectory
)

resources {
from(sourceDir) {
include("**/images/**/*.png")
include("**/images/**/*.svg")
}
from(plantUmlOutputDirectory) {
into("user-guide/images")
}
}

// Temporary workaround for https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/599
inputs.dir(sourceDir).withPropertyName("sourceDir").withPathSensitivity(RELATIVE)

attributeProviders += AsciidoctorAttributeProvider {
mapOf(
"version" to version,
"junit4-version" to libs.versions.junit4.get(),
"apiguardian-version" to libs.versions.apiguardian.get(),
"ota4j-version" to libs.versions.opentest4j.get(),
"surefire-version" to libs.versions.surefire.get(),
"release-branch" to releaseBranch,
"docs-version" to docsVersion,
"revnumber" to version,
"consoleLauncherOptionsFile" to consoleLauncherOptionsFile.get(),
"consoleLauncherDiscoverOptionsFile" to consoleLauncherDiscoverOptionsFile.get(),
"consoleLauncherExecuteOptionsFile" to consoleLauncherExecuteOptionsFile.get(),
"consoleLauncherEnginesOptionsFile" to consoleLauncherEnginesOptionsFile.get(),
"experimentalApisTableFile" to experimentalApisTableFile.get(),
"deprecatedApisTableFile" to deprecatedApisTableFile.get(),
"standaloneConsoleLauncherShadowedArtifactsFile" to standaloneConsoleLauncherShadowedArtifactsFile.get(),
"outdir" to outputDir.absolutePath,
"source-highlighter" to "rouge",
"rouge-style" to "junit",
"tabsize" to "4",
"toc" to "left",
"icons" to "font",
"sectanchors" to true,
"idprefix" to "",
"idseparator" to "-",
"jdk-javadoc-base-url" to jdkJavadocBaseUrl
)
}

sourceSets["test"].apply {
attributes(mapOf(
"testDir" to java.srcDirs.first(),
"testResourcesDir" to resources.srcDirs.first()
))
inputs.dir(java.srcDirs.first())
inputs.dir(resources.srcDirs.first())
attributes(mapOf("kotlinTestDir" to kotlin.srcDirs.first()))
inputs.dir(kotlin.srcDirs.first())
}

jvm {
// To avoid warning, see https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/597
jvmArgs(
"--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED",
"--add-opens", "java.base/java.io=ALL-UNNAMED"
)
}

notCompatibleWithConfigurationCache("https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/564")
}

asciidoctor {
sources {
include("**/index.adoc")
}
resources {
from(sourceDir) {
include("tocbot-*/**")
}
}
attributes(mapOf(
"linkToPdf" to uploadPdfs,
"userGuidePdfFileName" to userGuidePdfFileName,
"releaseNotesUrl" to "../release-notes/index.html#release-notes"
))
}

asciidoctorPdf {
// Avoid classpath conflicts with other Gradle plugins (e.g. JReleaser)
// Avoid propagating apparent memory leaks in Asciidoctor/JRuby to Gradle daemon.
setExecutionMode(JAVA_EXEC)
jvm {
maxHeapSize = "512M"
}
sources {
include("user-guide/index.adoc")
}
copyAllResources()
attributes(mapOf("releaseNotesUrl" to "https://docs.junit.org/$docsVersion/release-notes/"))
}

val downloadJavadocElementLists by registering {
Expand Down Expand Up @@ -496,58 +365,28 @@ tasks {
into(layout.buildDirectory.dir("docs/fixedJavadoc"))
}

val prepareDocsForUploadToGhPages by registering(Copy::class) {
dependsOn(fixJavadoc, asciidoctor, asciidoctorPdf)
outputs.dir(docsDir)

from(asciidoctor.map { it.outputDir }) {
include("user-guide/**")
include("release-notes/**")
include("tocbot-*/**")
}
if (uploadPdfs) {
from(asciidoctorPdf.map { it.outputDir }) {
include("**/*.pdf")
rename { userGuidePdfFileName }
}
}
from(fixJavadoc.map { it.destinationDir }) {
into("api")
}
into(docsDir.map { it.dir(docsVersion.toString()) })
includeEmptyDirs = false
}

val createCurrentDocsFolder by registering(Copy::class) {
dependsOn(prepareDocsForUploadToGhPages)
onlyIf { replaceCurrentDocs }

from(docsDir.map { it.dir(docsVersion.toString()) })
into(docsDir.map { it.dir("current") })
}

val configureGitAuthor by registering {
dependsOn(gitPublishReset)
doFirst {
File(gitPublish.repoDir.get().asFile, ".git/config").appendText("""
[user]
name = JUnit Team
email = [email protected]
""".trimIndent())
}
}

gitPublishCopy {
dependsOn(prepareDocsForUploadToGhPages, createCurrentDocsFolder)
}

gitPublishCommit {
dependsOn(configureGitAuthor)
}

val prepareGitHubAttestation by registering(Sync::class) {
from(attestationClasspath)
into(layout.buildDirectory.dir("attestation"))
rename("(.*)-SNAPSHOT.jar", "$1-SNAPSHOT+${buildRevision.substring(0, 7)}.jar")
}

generateAntoraYml {
asciidocAttributes.putAll(provider {
mapOf(
"version" to project.version,
"junit4-version" to libs.versions.junit4.get(),
"apiguardian-version" to libs.versions.apiguardian.get(),
"ota4j-version" to libs.versions.opentest4j.get(),
"surefire-version" to libs.versions.surefire.get(),
"release-branch" to releaseBranch,
"docs-version" to docsVersion,
"jdk-javadoc-base-url" to jdkJavadocBaseUrl
)
})
}

generateAntoraResources {
dependsOn(generateAsciidocInputs, fixJavadoc)
}
}
Loading