Skip to content

Commit ac69a5d

Browse files
rwinchrstoyanchev
authored andcommitted
Copy default antora files
1 parent 7f9061a commit ac69a5d

File tree

4 files changed

+143
-78
lines changed

4 files changed

+143
-78
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy Docs
2+
on:
3+
push:
4+
branches-ignore: [ gh-pages ]
5+
tags: '**'
6+
repository_dispatch:
7+
types: request-build-reference # legacy
8+
#schedule:
9+
#- cron: '0 10 * * *' # Once per day at 10am UTC
10+
workflow_dispatch:
11+
permissions:
12+
actions: write
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
# FIXME enable when pushed to spring-projects
17+
# if: github.repository_owner == 'spring-projects'
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
with:
22+
ref: docs-build
23+
fetch-depth: 1
24+
- name: Dispatch (partial build)
25+
if: github.ref_type == 'branch'
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
29+
- name: Dispatch (full build)
30+
if: github.ref_type == 'tag'
31+
env:
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)

framework-docs/antora-playbook.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# PACKAGES [email protected] @antora/atlas-extension:1.0.0-alpha.1 @antora/[email protected] @springio/[email protected] @asciidoctor/[email protected] @opendevise/[email protected]
2+
#
3+
# The purpose of this Antora playbook is to build the docs in the current branch.
4+
antora:
5+
extensions:
6+
- '@antora/collector-extension'
7+
- require: '@springio/antora-extensions/tabs-migration-extension'
8+
unwrap_example_block: always
9+
site:
10+
title: Spring Framework Reference
11+
url: https://https://rwinch.github.io/spring-framework/
12+
content:
13+
sources:
14+
- url: https://github.com/rwinch/spring-framework
15+
branches: ./..
16+
start_path: framework-docs
17+
worktrees: true
18+
asciidoc:
19+
attributes:
20+
page-pagination: ''
21+
hide-uri-scheme: '@'
22+
tabs-sync-option: '@'
23+
chomp: 'all'
24+
extensions:
25+
- '@asciidoctor/tabs'
26+
- '@springio/asciidoctor-extensions'
27+
sourcemap: true
28+
urls:
29+
latest_version_segment: ''
30+
runtime:
31+
log:
32+
failure_level: warn
33+
ui:
34+
bundle:
35+
url: https://github.com/spring-io/antora-ui-spring/releases/download/latest/ui-bundle.zip
36+
snapshot: true

framework-docs/antora.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: framework
2+
version: true
3+
title: Spring Framework Documentation
4+
nav:
5+
- modules/ROOT/nav.adoc
6+
ext:
7+
collector:
8+
run:
9+
command: gradlew -q -PbuildSrc.skipTests=true "-Dorg.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError" :spring-boot-project:spring-boot-docs:generateAntoraResources
10+
local: true
11+
scan:
12+
dir: ./build/generated-antora-resources
13+
14+
asciidoc:
15+
attributes:
16+
attribute-missing: 'warn'
17+
# FIXME: the copyright is not removed
18+
# FIXME: The package is not renamed
19+
chomp: 'all'
20+
import-java: 'example$docs-src/main/java/org/springframework/docs'
21+
spring-framework-main-code: 'https://github.com/spring-projects/spring-framework/tree/main'
22+
docs-site: 'https://docs.spring.io'
23+
docs-spring: "{docs-site}/spring-framework/docs/{spring-version}"
24+
docs-spring-framework: '{docs_site}/spring-framework/docs/{spring-version}'
25+
api-spring-framework: '{docs-spring-framework}/javadoc-api/org/springframework'
26+
docs-graalvm: 'https://www.graalvm.org/22.3/reference-manual'
27+
docs-spring-boot: '{docs-site}/spring-boot/docs/current/reference'
28+
docs-spring-gemfire: '{docs_site}/spring-gemfire/docs/current/reference'
29+
docs-spring-security: '{docs_site}/spring-security/reference'
30+
gh-rsocket: 'https://github.com/rsocket'
31+
gh-rsocket-extensions: '{gh-rsocket}/rsocket/blob/master/Extensions'
32+
gh-rsocket-java: '{gh-rsocket}/rsocket-java{gh-rsocket}/rsocket-java'

framework-docs/framework-docs.gradle

Lines changed: 42 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,48 @@
1+
plugins {
2+
id 'kotlin'
3+
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
4+
id 'org.antora' version '1.0.0'
5+
}
6+
17
description = "Spring Framework Docs"
28

3-
apply plugin: 'kotlin'
4-
apply plugin: 'org.asciidoctor.jvm.convert'
5-
apply plugin: 'org.asciidoctor.jvm.pdf'
69
apply from: "${rootDir}/gradle/publications.gradle"
710

811

9-
configurations {
10-
asciidoctorExtensions
12+
antora {
13+
version = '3.2.0-alpha.2'
14+
playbook = 'antora-playbook.yml'
15+
// playbookProvider {
16+
// repository = 'rwinch/spring-framework'
17+
// branch = 'docs-build'
18+
// path = 'lib/antora/templates/per-branch-antora-playbook.yml'
19+
// checkLocalBranch = true
20+
// }
21+
options = ['--clean', '--stacktrace']
22+
environment = [
23+
'ALGOLIA_API_KEY': '82c7ead946afbac3cf98c32446154691',
24+
'ALGOLIA_APP_ID': '244V8V9FGG',
25+
'ALGOLIA_INDEX_NAME': 'framework-docs'
26+
]
27+
dependencies = [
28+
'@antora/atlas-extension': '1.0.0-alpha.1',
29+
'@antora/collector-extension': '1.0.0-alpha.3',
30+
'@asciidoctor/tabs': '1.0.0-beta.3',
31+
'@opendevise/antora-release-line-extension': '1.0.0-alpha.2',
32+
'@springio/antora-extensions': '1.1.0',
33+
'@springio/asciidoctor-extensions': '1.0.0-alpha.9'
34+
]
1135
}
1236

13-
dependencies {
14-
api(project(":spring-context"))
15-
api(project(":spring-web"))
16-
api("jakarta.servlet:jakarta.servlet-api")
1737

18-
implementation(project(":spring-core-test"))
19-
implementation("org.assertj:assertj-core")
38+
tasks.named("generateAntoraYml") {
39+
dependsOn dependencyVersions
40+
asciidocAttributes = project.provider( {
41+
return ["spring-version": project.version ]
42+
} )
2043
}
2144

45+
2246
jar {
2347
enabled = false
2448
}
@@ -27,8 +51,10 @@ javadoc {
2751
enabled = false
2852
}
2953

30-
dependencies {
31-
asciidoctorExtensions "io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.5"
54+
repositories {
55+
maven {
56+
url "https://repo.spring.io/release"
57+
}
3258
}
3359

3460
/**
@@ -82,69 +108,10 @@ rootProject.tasks.dokkaHtmlMultiModule.configure {
82108
outputDirectory.set(project.file("$buildDir/docs/kdoc"))
83109
}
84110

85-
asciidoctorj {
86-
version = '2.4.3'
87-
fatalWarnings ".*"
88-
options doctype: 'book', eruby: 'erubis'
89-
attributes([
90-
icons: 'font',
91-
idprefix: '',
92-
idseparator: '-',
93-
revnumber: project.version,
94-
sectanchors: '',
95-
sectnums: '',
96-
'spring-version': project.version
97-
])
98-
}
99-
100-
/**
101-
* Generate the Spring Framework Reference documentation from
102-
* "src/docs/asciidoc" in "build/docs/ref-docs/html5".
103-
*/
104-
asciidoctor {
105-
baseDirFollowsSourceDir()
106-
configurations "asciidoctorExtensions"
107-
sources {
108-
include '*.adoc'
109-
}
110-
resources {
111-
from(sourceDir) {
112-
include 'images/*.png'
113-
}
114-
}
115-
outputDir "$buildDir/docs/ref-docs/html5"
116-
outputOptions {
117-
backends "spring-html"
118-
}
119-
forkOptions {
120-
jvmArgs += ["--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED"]
121-
}
122-
logDocuments = true
123-
}
124-
125-
asciidoctor.mustRunAfter "check"
126-
127-
/**
128-
* Generate the Spring Framework Reference documentation from "src/docs/asciidoc"
129-
* in "build/docs/ref-docs/pdf".
130-
*/
131-
asciidoctorPdf {
132-
baseDirFollowsSourceDir()
133-
configurations 'asciidoctorExtensions'
134-
sources {
135-
include 'spring-framework.adocbook'
136-
}
137-
outputDir "$buildDir/docs/ref-docs/pdf"
138-
forkOptions {
139-
jvmArgs += ["--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED"]
140-
}
141-
logDocuments = true
142-
}
143-
144111
/**
145112
* Zip all docs (API and reference) into a single archive
146113
*/
147-
task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor', 'asciidoctorPdf', rootProject.tasks.dokkaHtmlMultiModule]) {
114+
task docsZip(type: Zip, dependsOn: ['api', 'antora', rootProject.tasks.dokkaHtmlMultiModule]) {
148115
group = "Distribution"
149116
description = "Builds -${archiveClassifier} archive containing api and reference " +
150117
"for deployment at https://docs.spring.io/spring-framework/docs/."
@@ -157,12 +124,9 @@ task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor', 'asciidoctorPdf', root
157124
from (api) {
158125
into "javadoc-api"
159126
}
160-
from ("$asciidoctor.outputDir") {
127+
from ("build/site") {
161128
into "reference/html"
162129
}
163-
from ("$asciidoctorPdf.outputDir") {
164-
into "reference/pdf"
165-
}
166130
from (rootProject.tasks.dokkaHtmlMultiModule.outputDirectory) {
167131
into "kdoc-api"
168132
}
@@ -251,4 +215,4 @@ publishing {
251215
artifact distZip
252216
}
253217
}
254-
}
218+
}

0 commit comments

Comments
 (0)