Merge branch '5.6.x' into 5.7.x

Closes gh-11955
This commit is contained in:
Rob Winch 2022-10-05 13:57:25 -05:00
commit 37dd896d4b
3 changed files with 34 additions and 23 deletions

View File

@ -1,3 +1,12 @@
name: 'ROOT' name: ROOT
version: 5.7.4 version: true
prerelease: '-SNAPSHOT' title: Documentation
nav:
- modules/ROOT/nav.adoc
ext:
collector:
run:
command: gradlew -q -PbuildSrc.skipTests=true "-Dorg.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError" :spring-security-docs:generateAntora
local: true
scan:
dir: ./build/generateAntora

View File

@ -2,6 +2,7 @@
antora: antora:
extensions: extensions:
- ./antora-linked-worktree-patch.js - ./antora-linked-worktree-patch.js
- '@antora/collector-extension'
site: site:
title: Spring Security title: Spring Security
url: https://docs.spring.io/spring-security/reference url: https://docs.spring.io/spring-security/reference
@ -9,7 +10,7 @@ content:
sources: sources:
- url: ./.. - url: ./..
branches: HEAD branches: HEAD
start_paths: [docs, 'docs/build/generateAntora*'] start_path: docs
worktrees: true worktrees: true
asciidoc: asciidoc:
attributes: attributes:

View File

@ -1,6 +1,5 @@
plugins { plugins {
id 'org.antora' version '1.0.0-alpha.3' id 'org.antora' version '1.0.0-alpha.3'
id 'org.springframework.antora.check-version'
} }
apply plugin: 'io.spring.convention.docs' apply plugin: 'io.spring.convention.docs'
@ -15,10 +14,11 @@ antora {
'ALGOLIA_APP_ID': '244V8V9FGG', 'ALGOLIA_APP_ID': '244V8V9FGG',
'ALGOLIA_INDEX_NAME': 'security-docs' 'ALGOLIA_INDEX_NAME': 'security-docs'
] ]
dependencies = [
'@antora/collector-extension': '1.0.0-alpha.2'
]
} }
tasks.antora.dependsOn 'generateAntora'
tasks.register('generateAntora') { tasks.register('generateAntora') {
group = 'Documentation' group = 'Documentation'
description = 'Generates the antora.yml for dynamic properties' description = 'Generates the antora.yml for dynamic properties'
@ -33,21 +33,22 @@ tasks.register('generateAntora') {
def securityReferenceUrl = "$securityDocsUrl/reference/html5/" def securityReferenceUrl = "$securityDocsUrl/reference/html5/"
def springFrameworkApiUrl = "https://docs.spring.io/spring-framework/docs/$springFrameworkVersion/javadoc-api/" def springFrameworkApiUrl = "https://docs.spring.io/spring-framework/docs/$springFrameworkVersion/javadoc-api/"
def springFrameworkReferenceUrl = "https://docs.spring.io/spring-framework/docs/$springFrameworkVersion/reference/html/" def springFrameworkReferenceUrl = "https://docs.spring.io/spring-framework/docs/$springFrameworkVersion/reference/html/"
def versions = resolvedVersions(project.configurations.testRuntimeClasspath) def ymlVersions = resolvedVersions(project.configurations.testRuntimeClasspath).call()
def ymlVersions = '' .collect(v -> " ${v.getKey()}: ${v.getValue()}")
versions.call().each { name, version -> .join('\n')
ymlVersions += """ def outputFile = layout.buildDirectory.file('generateAntora/antora.yml').get().asFile
${name}: ${version}""" mkdir(outputFile.getParentFile())
} def (mainVersion, prerelease) = project.version.split(/(?=-)/, 2)
def outputFile = layout.buildDirectory.file('generateAntora/antora.yml').orNull.asFile def antoraYmlText = file('antora.yml').text
outputFile.getParentFile().mkdirs() layout.buildDirectory.file('.antora.yml').get().asFile.text = antoraYmlText
outputFile.createNewFile() antoraYmlText = antoraYmlText.lines().collect { l ->
def antoraYmlText = file('antora.yml').text.trim() if (l.startsWith('version: ')) {
outputFile.setText("""$antoraYmlText return prerelease == null ? "version: '${mainVersion}'" : "version: '${mainVersion}'\nprerelease: '${prerelease}'"
title: Spring Security }
start_page: ROOT:index.adoc if (l.startsWith('title: ')) return "title: ${project.parent.description}"
nav: return l == 'ext:' || l.getAt(0) == ' ' ? null : l
- modules/ROOT/nav.adoc }.findAll(Objects::nonNull).join('\n')
outputFile.text = """$antoraYmlText
asciidoc: asciidoc:
attributes: attributes:
icondir: icons icondir: icons
@ -60,7 +61,7 @@ asciidoc:
spring-framework-reference-url: $springFrameworkReferenceUrl spring-framework-reference-url: $springFrameworkReferenceUrl
spring-security-version: ${project.version} spring-security-version: ${project.version}
${ymlVersions} ${ymlVersions}
""") """
} }
} }