Skip to content

Commit 144af07

Browse files
committed
Use a dynamic version for Antora
1 parent cb6ca7f commit 144af07

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

docs/antora.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: ROOT
22
title: Spring Security
3-
version: 5.6
43
start_page: ROOT:index.adoc
54
nav:
65
- modules/ROOT/nav.adoc

docs/spring-security-docs.gradle

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ apply plugin: 'io.spring.convention.docs'
22
apply plugin: 'java'
33

44
tasks.register("generateAntora") {
5+
group = "Documentation"
6+
description = "Generates antora files"
7+
dependsOn 'generateAntoraYml', 'generateAntoraComponentVersion'
8+
}
9+
10+
tasks.register("generateAntoraYml") {
511
group = "Documentation"
612
description = "Generates the antora.yml for dynamic properties"
713
doLast {
@@ -26,7 +32,6 @@ tasks.register("generateAntora") {
2632
outputFile.createNewFile()
2733
outputFile.setText("""name: ROOT
2834
title: Spring Security
29-
version: 5.6
3035
start_page: ROOT:index.adoc
3136
asciidoc:
3237
attributes:
@@ -44,6 +49,20 @@ ${ymlVersions}
4449
}
4550
}
4651

52+
tasks.register("generateAntoraComponentVersion") {
53+
group = "Documentation"
54+
description = "Generates the antora.component.version file"
55+
doLast {
56+
def outputFile = new File("$buildDir/generateAntora/antora.component.version")
57+
outputFile.getParentFile().mkdirs()
58+
outputFile.createNewFile()
59+
def antoraVersion = project.version.replaceAll(/^(\d+\.\d+)\.\d+(-\w+)$/, '$1$2')
60+
outputFile.setText("$antoraVersion")
61+
}
62+
}
63+
64+
65+
4766
dependencies {
4867
testImplementation platform(project(":spring-security-dependencies"))
4968
testImplementation "com.unboundid:unboundid-ldapsdk"

0 commit comments

Comments
 (0)