Skip to content

Commit 27450b8

Browse files
committed
Merge remote-tracking branch 'origin/main' into rien/remove-unique-id-format-field
2 parents 1ddce1c + 500daea commit 27450b8

File tree

140 files changed

+9135
-7635
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+9135
-7635
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -122,26 +122,15 @@ jobs:
122122
run: |
123123
sudo apt-get update
124124
sudo apt-get install graphviz
125-
- name: Build Documentation
126-
uses: ./.github/actions/run-gradle
125+
- name: Install Node.js
126+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
127127
with:
128-
encryptionKey: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
129-
arguments: |
130-
prepareDocsForUploadToGhPages \
131-
-Dscan.tag.Documentation
132-
- name: Configure Git
133-
shell: bash
134-
run: |
135-
git config --global user.name "JUnit Team"
136-
git config --global user.email "team@junit.org"
137-
- name: Upload Documentation
138-
if: github.event_name == 'push' && github.repository == 'junit-team/junit-framework' && github.ref == 'refs/heads/main'
128+
node-version-file: documentation/.tool-versions
129+
- name: Build Documentation
139130
uses: ./.github/actions/run-gradle
140131
with:
141132
encryptionKey: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
142133
arguments: |
143-
gitPublishPush \
134+
antora \
135+
-Pantora.downloadNode=false \
144136
-Dscan.tag.Documentation
145-
env:
146-
GIT_USERNAME: git
147-
GIT_PASSWORD: ${{ secrets.JUNIT_BUILDS_GITHUB_TOKEN_DOCS_REPO }}

.github/zizmor.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
rules:
2+
cache-poisoning:
3+
ignore:
4+
# reports issues for setup-node which isn't used while releasing
5+
- main.yml

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ checksums*
3838
# snapshot-tests
3939
*.snapshot_actual
4040
*.snapshot_raw
41+
42+
# Antora
43+
/documentation/node_modules/

documentation/.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 24.11.1

documentation/README.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
11
# JUnit User Guide
22

3-
This subproject contains the AsciiDoc sources for the JUnit User Guide.
3+
This subproject contains the Antora/AsciiDoc sources for the JUnit User Guide.
44

55
## Structure
66

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

1313
## Usage
1414

15-
### Generate AsciiDoc
15+
### Generate Antora site
1616

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

2020
```
21-
./gradlew asciidoctor
21+
./gradlew antora
2222
```
2323

2424
On Linux operating systems, the `graphviz` package providing `/usr/bin/dot` must be
25-
installed in order to generate the User Guide.
26-
27-
### Generate AsciiDocPdf
28-
29-
This following Gradle command generates the PDF version of the User Guide to
30-
`build/docs/asciidocPdf/user-guide/index.pdf`.
31-
32-
```
33-
./gradlew asciidoctorPdf
34-
```
25+
installed in order to generate the PlantUML images used in the User Guide.

documentation/antora-playbook.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
antora:
2+
extensions:
3+
- '@antora/collector-extension'
4+
- '@antora/lunr-extension'
5+
- require: '@springio/antora-extensions/root-component-extension'
6+
root_component_name: junit
7+
- require: '@springio/antora-extensions/root-attachments-extension'
8+
site:
9+
title: JUnit User Guide
10+
url: https://docs.junit.org
11+
content:
12+
sources:
13+
- url: @GIT_REPO_ROOT@
14+
branches: @GIT_BRANCH_NAME@
15+
start_path: documentation
16+
worktrees: true
17+
asciidoc:
18+
attributes:
19+
attribute-missing: warn
20+
runtime:
21+
log:
22+
failure_level: warn
23+
ui:
24+
bundle:
25+
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
26+
snapshot: true

documentation/antora.yml

Lines changed: 295 additions & 0 deletions
Large diffs are not rendered by default.

documentation/documentation.gradle.kts

Lines changed: 22 additions & 183 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@ import junitbuild.exec.RunConsoleLauncher
55
import junitbuild.extensions.isSnapshot
66
import junitbuild.extensions.javaModuleName
77
import junitbuild.javadoc.ModuleSpecificJavadocFileOption
8-
import org.asciidoctor.gradle.base.AsciidoctorAttributeProvider
9-
import org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask
108
import org.gradle.api.tasks.PathSensitivity.RELATIVE
11-
import org.ysb33r.grolifant.api.core.jvm.ExecutionMode.JAVA_EXEC
129

1310
plugins {
14-
alias(libs.plugins.asciidoctorConvert)
15-
alias(libs.plugins.asciidoctorPdf)
16-
alias(libs.plugins.gitPublish)
1711
alias(libs.plugins.plantuml)
12+
id("junitbuild.antora-conventions")
1813
id("junitbuild.build-parameters")
1914
id("junitbuild.kotlin-library-conventions")
2015
id("junitbuild.testing-conventions")
@@ -84,14 +79,6 @@ dependencies {
8479
standaloneConsoleLauncher(projects.junitPlatformConsoleStandalone)
8580
}
8681

87-
asciidoctorj {
88-
setJrubyVersion(libs.versions.jruby)
89-
modules {
90-
pdf.version(libs.versions.asciidoctorj.pdf)
91-
}
92-
requires(file("src/docs/asciidoc/resources/themes/rouge_junit.rb"))
93-
}
94-
9582
val buildRevision: String by rootProject.extra
9683
val snapshot = version.isSnapshot()
9784
val docsVersion = if (snapshot) "snapshot" else version
@@ -103,30 +90,6 @@ val userGuidePdfFileName = "junit-user-guide-${version}.pdf"
10390
val ota4jDocVersion = libs.versions.opentest4j.map { if (it.isSnapshot()) "snapshot" else it }.get()
10491
val apiGuardianDocVersion = libs.versions.apiguardian.map { if (it.isSnapshot()) "snapshot" else it }.get()
10592

106-
gitPublish {
107-
repoUri = "https://github.com/junit-team/docs.junit.org.git"
108-
109-
branch = "main"
110-
sign = false
111-
fetchDepth = 1
112-
113-
username = providers.environmentVariable("GIT_USERNAME")
114-
password = providers.environmentVariable("GIT_PASSWORD")
115-
116-
contents {
117-
from(docsDir)
118-
into(".")
119-
}
120-
121-
preserve {
122-
include("**/*")
123-
exclude("$docsVersion/**")
124-
if (replaceCurrentDocs) {
125-
exclude("current/**")
126-
}
127-
}
128-
}
129-
13093
val generatedAsciiDocPath = layout.buildDirectory.dir("generated/asciidoc")
13194
val consoleLauncherOptionsFile = generatedAsciiDocPath.map { it.file("console-launcher-options.txt") }
13295
val consoleLauncherDiscoverOptionsFile = generatedAsciiDocPath.map { it.file("console-launcher-discover-options.txt") }
@@ -270,8 +233,8 @@ tasks {
270233

271234
val plantUmlOutputDirectory = plantUml.flatMap { it.outputDirectory }
272235

273-
withType<AbstractAsciidoctorTask>().configureEach {
274-
inputs.files(
236+
val generateAsciidocInputs by registering {
237+
dependsOn(
275238
generateConsoleLauncherOptions,
276239
generateConsoleLauncherDiscoverOptions,
277240
generateConsoleLauncherExecuteOptions,
@@ -280,100 +243,6 @@ tasks {
280243
generateStandaloneConsoleLauncherShadowedArtifactsFile,
281244
plantUmlOutputDirectory
282245
)
283-
284-
resources {
285-
from(sourceDir) {
286-
include("**/images/**/*.png")
287-
include("**/images/**/*.svg")
288-
}
289-
from(plantUmlOutputDirectory) {
290-
into("user-guide/images")
291-
}
292-
}
293-
294-
// Temporary workaround for https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/599
295-
inputs.dir(sourceDir).withPropertyName("sourceDir").withPathSensitivity(RELATIVE)
296-
297-
attributeProviders += AsciidoctorAttributeProvider {
298-
mapOf(
299-
"version" to version,
300-
"junit4-version" to libs.versions.junit4.get(),
301-
"apiguardian-version" to libs.versions.apiguardian.get(),
302-
"ota4j-version" to libs.versions.opentest4j.get(),
303-
"surefire-version" to libs.versions.surefire.get(),
304-
"release-branch" to releaseBranch,
305-
"docs-version" to docsVersion,
306-
"revnumber" to version,
307-
"consoleLauncherOptionsFile" to consoleLauncherOptionsFile.get(),
308-
"consoleLauncherDiscoverOptionsFile" to consoleLauncherDiscoverOptionsFile.get(),
309-
"consoleLauncherExecuteOptionsFile" to consoleLauncherExecuteOptionsFile.get(),
310-
"consoleLauncherEnginesOptionsFile" to consoleLauncherEnginesOptionsFile.get(),
311-
"experimentalApisTableFile" to experimentalApisTableFile.get(),
312-
"deprecatedApisTableFile" to deprecatedApisTableFile.get(),
313-
"standaloneConsoleLauncherShadowedArtifactsFile" to standaloneConsoleLauncherShadowedArtifactsFile.get(),
314-
"outdir" to outputDir.absolutePath,
315-
"source-highlighter" to "rouge",
316-
"rouge-style" to "junit",
317-
"tabsize" to "4",
318-
"toc" to "left",
319-
"icons" to "font",
320-
"sectanchors" to true,
321-
"idprefix" to "",
322-
"idseparator" to "-",
323-
"jdk-javadoc-base-url" to jdkJavadocBaseUrl
324-
)
325-
}
326-
327-
sourceSets["test"].apply {
328-
attributes(mapOf(
329-
"testDir" to java.srcDirs.first(),
330-
"testResourcesDir" to resources.srcDirs.first()
331-
))
332-
inputs.dir(java.srcDirs.first())
333-
inputs.dir(resources.srcDirs.first())
334-
attributes(mapOf("kotlinTestDir" to kotlin.srcDirs.first()))
335-
inputs.dir(kotlin.srcDirs.first())
336-
}
337-
338-
jvm {
339-
// To avoid warning, see https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/597
340-
jvmArgs(
341-
"--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED",
342-
"--add-opens", "java.base/java.io=ALL-UNNAMED"
343-
)
344-
}
345-
346-
notCompatibleWithConfigurationCache("https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/564")
347-
}
348-
349-
asciidoctor {
350-
sources {
351-
include("**/index.adoc")
352-
}
353-
resources {
354-
from(sourceDir) {
355-
include("tocbot-*/**")
356-
}
357-
}
358-
attributes(mapOf(
359-
"linkToPdf" to uploadPdfs,
360-
"userGuidePdfFileName" to userGuidePdfFileName,
361-
"releaseNotesUrl" to "../release-notes/index.html#release-notes"
362-
))
363-
}
364-
365-
asciidoctorPdf {
366-
// Avoid classpath conflicts with other Gradle plugins (e.g. JReleaser)
367-
// Avoid propagating apparent memory leaks in Asciidoctor/JRuby to Gradle daemon.
368-
setExecutionMode(JAVA_EXEC)
369-
jvm {
370-
maxHeapSize = "512M"
371-
}
372-
sources {
373-
include("user-guide/index.adoc")
374-
}
375-
copyAllResources()
376-
attributes(mapOf("releaseNotesUrl" to "https://docs.junit.org/$docsVersion/release-notes/"))
377246
}
378247

379248
val downloadJavadocElementLists by registering {
@@ -496,58 +365,28 @@ tasks {
496365
into(layout.buildDirectory.dir("docs/fixedJavadoc"))
497366
}
498367

499-
val prepareDocsForUploadToGhPages by registering(Copy::class) {
500-
dependsOn(fixJavadoc, asciidoctor, asciidoctorPdf)
501-
outputs.dir(docsDir)
502-
503-
from(asciidoctor.map { it.outputDir }) {
504-
include("user-guide/**")
505-
include("release-notes/**")
506-
include("tocbot-*/**")
507-
}
508-
if (uploadPdfs) {
509-
from(asciidoctorPdf.map { it.outputDir }) {
510-
include("**/*.pdf")
511-
rename { userGuidePdfFileName }
512-
}
513-
}
514-
from(fixJavadoc.map { it.destinationDir }) {
515-
into("api")
516-
}
517-
into(docsDir.map { it.dir(docsVersion.toString()) })
518-
includeEmptyDirs = false
519-
}
520-
521-
val createCurrentDocsFolder by registering(Copy::class) {
522-
dependsOn(prepareDocsForUploadToGhPages)
523-
onlyIf { replaceCurrentDocs }
524-
525-
from(docsDir.map { it.dir(docsVersion.toString()) })
526-
into(docsDir.map { it.dir("current") })
527-
}
528-
529-
val configureGitAuthor by registering {
530-
dependsOn(gitPublishReset)
531-
doFirst {
532-
File(gitPublish.repoDir.get().asFile, ".git/config").appendText("""
533-
[user]
534-
name = JUnit Team
535-
email = team@junit.org
536-
""".trimIndent())
537-
}
538-
}
539-
540-
gitPublishCopy {
541-
dependsOn(prepareDocsForUploadToGhPages, createCurrentDocsFolder)
542-
}
543-
544-
gitPublishCommit {
545-
dependsOn(configureGitAuthor)
546-
}
547-
548368
val prepareGitHubAttestation by registering(Sync::class) {
549369
from(attestationClasspath)
550370
into(layout.buildDirectory.dir("attestation"))
551371
rename("(.*)-SNAPSHOT.jar", "$1-SNAPSHOT+${buildRevision.substring(0, 7)}.jar")
552372
}
373+
374+
generateAntoraYml {
375+
asciidocAttributes.putAll(provider {
376+
mapOf(
377+
"version" to project.version,
378+
"junit4-version" to libs.versions.junit4.get(),
379+
"apiguardian-version" to libs.versions.apiguardian.get(),
380+
"ota4j-version" to libs.versions.opentest4j.get(),
381+
"surefire-version" to libs.versions.surefire.get(),
382+
"release-branch" to releaseBranch,
383+
"docs-version" to docsVersion,
384+
"jdk-javadoc-base-url" to jdkJavadocBaseUrl
385+
)
386+
})
387+
}
388+
389+
generateAntoraResources {
390+
dependsOn(generateAsciidocInputs, fixJavadoc)
391+
}
553392
}

documentation/src/docs/asciidoc/user-guide/images/extensions_BrokenLifecycleMethodConfigDemo.png renamed to documentation/modules/ROOT/images/extensions_BrokenLifecycleMethodConfigDemo.png

File renamed without changes.

documentation/src/docs/asciidoc/user-guide/images/extensions_BrokenLifecycleMethodConfigDemo.txt renamed to documentation/modules/ROOT/images/extensions_BrokenLifecycleMethodConfigDemo.txt

File renamed without changes.

0 commit comments

Comments
 (0)