Skip to content

Commit 37dd896

Browse files
committed
Merge branch '5.6.x' into 5.7.x
Closes gh-11955
2 parents cd4ddde + e0843aa commit 37dd896

File tree

3 files changed

+34
-23
lines changed

3 files changed

+34
-23
lines changed

Diff for: docs/antora.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1-
name: 'ROOT'
2-
version: 5.7.4
3-
prerelease: '-SNAPSHOT'
1+
name: ROOT
2+
version: true
3+
title: 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-security-docs:generateAntora
10+
local: true
11+
scan:
12+
dir: ./build/generateAntora

Diff for: docs/local-antora-playbook.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
antora:
33
extensions:
44
- ./antora-linked-worktree-patch.js
5+
- '@antora/collector-extension'
56
site:
67
title: Spring Security
78
url: https://docs.spring.io/spring-security/reference
89
content:
910
sources:
1011
- url: ./..
1112
branches: HEAD
12-
start_paths: [docs, 'docs/build/generateAntora*']
13+
start_path: docs
1314
worktrees: true
1415
asciidoc:
1516
attributes:

Diff for: docs/spring-security-docs.gradle

+20-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
plugins {
22
id 'org.antora' version '1.0.0-alpha.3'
3-
id 'org.springframework.antora.check-version'
43
}
54

65
apply plugin: 'io.spring.convention.docs'
@@ -15,10 +14,11 @@ antora {
1514
'ALGOLIA_APP_ID': '244V8V9FGG',
1615
'ALGOLIA_INDEX_NAME': 'security-docs'
1716
]
17+
dependencies = [
18+
'@antora/collector-extension': '1.0.0-alpha.2'
19+
]
1820
}
1921

20-
tasks.antora.dependsOn 'generateAntora'
21-
2222
tasks.register('generateAntora') {
2323
group = 'Documentation'
2424
description = 'Generates the antora.yml for dynamic properties'
@@ -33,21 +33,22 @@ tasks.register('generateAntora') {
3333
def securityReferenceUrl = "$securityDocsUrl/reference/html5/"
3434
def springFrameworkApiUrl = "https://docs.spring.io/spring-framework/docs/$springFrameworkVersion/javadoc-api/"
3535
def springFrameworkReferenceUrl = "https://docs.spring.io/spring-framework/docs/$springFrameworkVersion/reference/html/"
36-
def versions = resolvedVersions(project.configurations.testRuntimeClasspath)
37-
def ymlVersions = ''
38-
versions.call().each { name, version ->
39-
ymlVersions += """
40-
${name}: ${version}"""
41-
}
42-
def outputFile = layout.buildDirectory.file('generateAntora/antora.yml').orNull.asFile
43-
outputFile.getParentFile().mkdirs()
44-
outputFile.createNewFile()
45-
def antoraYmlText = file('antora.yml').text.trim()
46-
outputFile.setText("""$antoraYmlText
47-
title: Spring Security
48-
start_page: ROOT:index.adoc
49-
nav:
50-
- modules/ROOT/nav.adoc
36+
def ymlVersions = resolvedVersions(project.configurations.testRuntimeClasspath).call()
37+
.collect(v -> " ${v.getKey()}: ${v.getValue()}")
38+
.join('\n')
39+
def outputFile = layout.buildDirectory.file('generateAntora/antora.yml').get().asFile
40+
mkdir(outputFile.getParentFile())
41+
def (mainVersion, prerelease) = project.version.split(/(?=-)/, 2)
42+
def antoraYmlText = file('antora.yml').text
43+
layout.buildDirectory.file('.antora.yml').get().asFile.text = antoraYmlText
44+
antoraYmlText = antoraYmlText.lines().collect { l ->
45+
if (l.startsWith('version: ')) {
46+
return prerelease == null ? "version: '${mainVersion}'" : "version: '${mainVersion}'\nprerelease: '${prerelease}'"
47+
}
48+
if (l.startsWith('title: ')) return "title: ${project.parent.description}"
49+
return l == 'ext:' || l.getAt(0) == ' ' ? null : l
50+
}.findAll(Objects::nonNull).join('\n')
51+
outputFile.text = """$antoraYmlText
5152
asciidoc:
5253
attributes:
5354
icondir: icons
@@ -60,7 +61,7 @@ asciidoc:
6061
spring-framework-reference-url: $springFrameworkReferenceUrl
6162
spring-security-version: ${project.version}
6263
${ymlVersions}
63-
""")
64+
"""
6465
}
6566
}
6667

0 commit comments

Comments
 (0)