Skip to content

Commit bd08352

Browse files
committed
Add Antora Gradle Build
1 parent 2ee3fff commit bd08352

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

spring-shell-docs/spring-shell-docs.gradle

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
plugins {
22
id 'org.springframework.shell.docs'
3+
id 'org.antora' version '1.0.0'
4+
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
35
}
46

57
description = 'Spring Shell Documentation'
@@ -12,6 +14,32 @@ dependencies {
1214
testImplementation 'org.awaitility:awaitility'
1315
}
1416

15-
asciidoctorj {
16-
version = '2.5.4'
17+
antora {
18+
version = '3.2.0-alpha.2'
19+
options = [clean: true, fetch: !project.gradle.startParameter.offline, stacktrace: true]
20+
dependencies = [
21+
'@antora/atlas-extension': '1.0.0-alpha.1',
22+
'@antora/collector-extension': '1.0.0-alpha.3',
23+
'@asciidoctor/tabs': '1.0.0-beta.3',
24+
'@springio/antora-extensions': '1.4.2',
25+
'@springio/asciidoctor-extensions': '1.0.0-alpha.8',
26+
]
1727
}
28+
29+
tasks.named("generateAntoraYml") {
30+
asciidocAttributes = project.provider( {
31+
def dependencies = resolvedVersions(project.configurations.testRuntimeClasspath)
32+
return ['project-version' : project.version,
33+
'spring-boot-version' : dependencies['spring-boot-starter-version'],
34+
'spring-version': dependencies['spring-core-version']
35+
]
36+
} )
37+
}
38+
39+
40+
41+
def resolvedVersions(Configuration configuration) {
42+
return configuration.resolvedConfiguration
43+
.resolvedArtifacts
44+
.collectEntries { [(it.name + '-version'): it.moduleVersion.id.version] }
45+
}

0 commit comments

Comments
 (0)