-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Migrate User Guide and Release Notes to Antora #5208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 1b4b92e
Set up Antora module
marcphilipp 58b94a4
Add task to build Antora site locally
marcphilipp 843f074
Extract conventions plugin
marcphilipp 74a2d7e
Update README to reference Antora
marcphilipp a586b4e
Remove Asciidoctor plugins
marcphilipp c76c6ab
Remove git-publish plugin and corresponding GitHub Action steps
marcphilipp fd01ffa
Use Node.js plugin directly
marcphilipp b915c80
Install Node.js via GitHub Action
marcphilipp 6f770d0
Move images to Antora module
marcphilipp 566beec
Migrate link attributes to antora.yml
marcphilipp 06c3ee7
Remove Asciidoctor User Guide main document
marcphilipp 502839e
Move overview.adoc to Antora module
marcphilipp af16b07
Migrate overview.adoc to Antora syntax
marcphilipp c5c89a1
Add overview.adoc to navigation
marcphilipp fab5ec0
Move writing-tests.adoc to Antora module
marcphilipp 5c4e125
Migrate writing-tests.adoc sections to Antora
marcphilipp 4133182
Migrate writing-tests sections to Antora syntax
marcphilipp b6185b4
Add writing-tests sections to navigation
marcphilipp 7b6e4d6
Move migrating-from-junit4.adoc to Antora module
marcphilipp cb87b31
Migrate migrating-from-junit4.adoc to Antora syntax
marcphilipp ba9bc1c
Add migrating-from-junit4.adoc to navigation
marcphilipp 4b21791
Move running-tests.adoc to Antora module
marcphilipp ce6b2b8
Migrate running-tests.adoc sections to Antora
marcphilipp 9a91512
Migrate running-tests sections to Antora syntax
marcphilipp 8f2ab79
Add running-tests sections to navigation
marcphilipp 6ffb485
Move extensions.adoc to Antora module
marcphilipp 27057c1
Migrate extensions.adoc sections to Antora
marcphilipp d9b8c54
Migrate extensions sections to Antora syntax
marcphilipp 336f793
Add extensions sections to navigation
marcphilipp 2a204f8
Remove Advanced Topics include file
marcphilipp 679dd62
Move junit-platform-reporting.adoc to Antora module
marcphilipp 94421b6
Migrate junit-platform-reporting.adoc to Antora syntax
marcphilipp 1b25c9a
Move junit-platform-suite-engine.adoc to Antora module
marcphilipp 1dc6ca4
Migrate junit-platform-suite-engine.adoc to Antora syntax
marcphilipp 1b09417
Move testkit.adoc to Antora module
marcphilipp d81d53d
Migrate testkit.adoc to Antora syntax
marcphilipp 1681476
Move launcher-api.adoc to Antora module
marcphilipp a19f51d
Migrate launcher-api.adoc to Antora syntax
marcphilipp 42445c2
Move engines.adoc to Antora module
marcphilipp c374131
Migrate engines.adoc to Antora syntax
marcphilipp 32c773f
Add advanced topics to navigation
marcphilipp 873bca3
Move api-evolution.adoc to Antora module
marcphilipp 218b471
Migrate api-evolution.adoc to Antora syntax
marcphilipp e37158d
Add api-evolution.adoc to navigation
marcphilipp 4a10399
Remove Contributors link to GitHub
marcphilipp e195932
Move release-notes.adoc to Antora module
marcphilipp 7ec0531
Migrate release-notes.adoc to Antora syntax
marcphilipp 4183ffb
Add release-notes.adoc to navigation
marcphilipp 057bb1b
Move individual release note files to Antora module
marcphilipp eee25ca
Move release-notes-TEMPLATE.adoc to Antora module
marcphilipp 2b25d54
Migrate release-notes-TEMPLATE.adoc to Antora syntax
marcphilipp c1ef601
Move appendix.adoc to Antora module
marcphilipp 2fb0b44
Migrate appendix.adoc to Antora syntax
marcphilipp 7874051
Add appendix.adoc to navigation
marcphilipp a8eb0db
Fix links
marcphilipp 3e4bbf7
Remove obsolete Asciidoctor resources
marcphilipp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,3 +38,6 @@ checksums* | |
| # snapshot-tests | ||
| *.snapshot_actual | ||
| *.snapshot_raw | ||
|
|
||
| # Antora | ||
| /documentation/node_modules/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| nodejs 24.11.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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") | ||
|
|
@@ -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 | ||
|
|
@@ -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") } | ||
|
|
@@ -270,8 +233,8 @@ tasks { | |
|
|
||
| val plantUmlOutputDirectory = plantUml.flatMap { it.outputDirectory } | ||
|
|
||
| withType<AbstractAsciidoctorTask>().configureEach { | ||
| inputs.files( | ||
| val generateAsciidocInputs by registering { | ||
| dependsOn( | ||
| generateConsoleLauncherOptions, | ||
| generateConsoleLauncherDiscoverOptions, | ||
| generateConsoleLauncherExecuteOptions, | ||
|
|
@@ -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 { | ||
|
|
@@ -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) | ||
| } | ||
| } | ||
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.