Skip to content

Commit 339a053

Browse files
committed
Use Antora
Closes gh-5835
2 parents 7b73b94 + 14fd213 commit 339a053

File tree

264 files changed

+3499
-3555
lines changed

Some content is hidden

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

264 files changed

+3499
-3555
lines changed

.github/actions/dispatch.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
REPOSITORY_REF="$1"
2+
TOKEN="$2"
3+
4+
curl -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${TOKEN}" --request POST --data '{"event_type": "request-build"}' https://api.github.com/repos/${REPOSITORY_REF}/dispatches
5+
echo "Requested Build for $REPOSITORY_REF"

.github/workflows/build-reference.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: reference
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'gh-pages'
7+
8+
env:
9+
GH_TOKEN_DISPATCH: ${{ secrets.GH_TOKEN_DISPATCH }}
10+
GH_TOKEN_PUSH: ${{ secrets.GH_TOKEN_PUSH }}
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Source
17+
uses: actions/checkout@v2
18+
- name: Generate antora.yml
19+
run: ./gradlew :spring-security-docs:generateAntora
20+
- name: Push generated antora files to the spring-security-docs-generated
21+
uses: JamesIves/[email protected]
22+
with:
23+
branch: "spring-security/main" # The branch the action should deploy to.
24+
folder: "docs/build/generateAntora" # The folder the action should deploy.
25+
repository-name: "rwinch/spring-security-docs-generated"
26+
token: ${{ secrets.GH_TOKEN_PUSH }}
27+
- name: Dispatch Build Request
28+
run: ${GITHUB_WORKSPACE}/.github/actions/dispatch.sh 'rwinch/spring-reference' "$GH_TOKEN_DISPATCH"

buildSrc/build.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,9 @@ dependencies {
7676
implementation 'gradle.plugin.org.gretty:gretty:3.0.1'
7777
implementation 'com.apollographql.apollo:apollo-runtime:2.4.5'
7878
implementation 'com.github.ben-manes:gradle-versions-plugin:0.38.0'
79-
implementation 'io.spring.gradle:docbook-reference-plugin:0.3.1'
8079
implementation 'io.spring.gradle:propdeps-plugin:0.0.10.RELEASE'
8180
implementation 'io.spring.javaformat:spring-javaformat-gradle-plugin:0.0.15'
8281
implementation 'io.spring.nohttp:nohttp-gradle:0.0.10'
83-
implementation 'org.aim42:htmlSanityCheck:1.1.6'
84-
implementation 'org.asciidoctor:asciidoctor-gradle-jvm:3.1.0'
85-
implementation 'org.asciidoctor:asciidoctor-gradle-jvm-pdf:3.1.0'
8682
implementation 'org.hidetake:gradle-ssh-plugin:2.10.1'
8783
implementation 'org.jfrog.buildinfo:build-info-extractor-gradle:4.9.10'
8884
implementation 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1'

buildSrc/src/main/groovy/io/spring/gradle/convention/DocsPlugin.groovy

+3-42
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
package io.spring.gradle.convention
22

3-
import org.aim42.htmlsanitycheck.HtmlSanityCheckPlugin
4-
import org.aim42.htmlsanitycheck.HtmlSanityCheckTask
5-
import org.aim42.htmlsanitycheck.check.BrokenHttpLinksChecker
6-
import org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask
73
import org.gradle.api.Plugin
84
import org.gradle.api.Project
95
import org.gradle.api.Task
6+
import org.gradle.api.plugins.BasePlugin
107
import org.gradle.api.plugins.PluginManager
118
import org.gradle.api.tasks.bundling.Zip
129

@@ -19,54 +16,18 @@ public class DocsPlugin implements Plugin<Project> {
1916
public void apply(Project project) {
2017

2118
PluginManager pluginManager = project.getPluginManager();
22-
pluginManager.apply("org.asciidoctor.jvm.convert");
23-
pluginManager.apply("org.asciidoctor.jvm.pdf");
24-
pluginManager.apply(AsciidoctorConventionPlugin);
19+
pluginManager.apply(BasePlugin);
2520
pluginManager.apply(DeployDocsPlugin);
2621
pluginManager.apply(JavadocApiPlugin);
27-
pluginManager.apply(HtmlSanityCheckPlugin)
28-
29-
String projectName = Utils.getProjectName(project);
30-
String pdfFilename = projectName + "-reference.pdf";
31-
32-
project.tasks.withType(AbstractAsciidoctorTask) { t ->
33-
project.configure(t) {
34-
sources {
35-
include "**/*.adoc"
36-
exclude '_*/**'
37-
}
38-
}
39-
}
40-
41-
project.tasks.withType(HtmlSanityCheckTask) { HtmlSanityCheckTask t ->
42-
project.configure(t) {
43-
t.dependsOn 'asciidoctor'
44-
t.checkerClasses = [BrokenHttpLinksChecker]
45-
t.checkingResultsDir = new File(project.getBuildDir(), "/report/htmlchecks")
46-
t.failOnErrors = false
47-
t.httpConnectionTimeout = 3000
48-
t.sourceDir = new File(project.getBuildDir(), "/docs/asciidoc/")
49-
t.sourceDocuments = project.files(new File(project.getBuildDir(), "/docs/asciidoc/index.html"))
50-
}
51-
}
5222

5323
Task docsZip = project.tasks.create('docsZip', Zip) {
54-
dependsOn 'api', 'asciidoctor'
24+
dependsOn 'api'
5525
group = 'Distribution'
5626
archiveBaseName = project.rootProject.name
5727
archiveClassifier = 'docs'
5828
description = "Builds -${classifier} archive containing all " +
5929
"Docs for deployment at docs.spring.io"
6030

61-
from(project.tasks.asciidoctor.outputs) {
62-
into 'reference/html5'
63-
include '**'
64-
}
65-
from(project.tasks.asciidoctorPdf.outputs) {
66-
into 'reference/pdf'
67-
include '**'
68-
rename "index.pdf", pdfFilename
69-
}
7031
from(project.tasks.api.outputs) {
7132
into 'api'
7233
}

buildSrc/src/main/java/io/spring/gradle/convention/AsciidoctorConventionPlugin.java

-208
This file was deleted.

0 commit comments

Comments
 (0)