From 517c767bf6f96c9cab8e51375e8e32d7923e67b3 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Tue, 26 Oct 2021 16:36:37 -0500 Subject: [PATCH] Use dynamic version --- spring-session-docs/antora.yml | 1 - .../spring-session-docs.gradle | 20 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/spring-session-docs/antora.yml b/spring-session-docs/antora.yml index ab00f460..5bc1225f 100644 --- a/spring-session-docs/antora.yml +++ b/spring-session-docs/antora.yml @@ -1,6 +1,5 @@ name: session title: Spring Session -version: 2.6 start_page: ROOT:index.adoc diff --git a/spring-session-docs/spring-session-docs.gradle b/spring-session-docs/spring-session-docs.gradle index fe32226d..74e86cac 100644 --- a/spring-session-docs/spring-session-docs.gradle +++ b/spring-session-docs/spring-session-docs.gradle @@ -36,8 +36,13 @@ sourceSets { def versions = dependencyManagement.managedVersions - tasks.register("generateAntora") { + group = "Documentation" + description = "Generates antora files" + dependsOn 'generateAntoraYml', 'generateAntoraComponentVersion' +} + +tasks.register("generateAntoraYml") { group = "Documentation" description = "Generates the antora.yml for dynamic properties" doLast { @@ -49,7 +54,6 @@ tasks.register("generateAntora") { outputFile.createNewFile() outputFile.setText("""name: session title: Spring Session -version: 2.6 start_page: ROOT:index.adoc asciidoc: attributes: @@ -75,6 +79,18 @@ asciidoc: } } +tasks.register("generateAntoraComponentVersion") { + group = "Documentation" + description = "Generates the antora.component.version file" + doLast { + def outputFile = new File("$buildDir/generateAntora/antora.component.version") + outputFile.getParentFile().mkdirs() + outputFile.createNewFile() + def antoraVersion = project.version.replaceAll(/^(\d+\.\d+)\.\d+(-\w+)?$/, '$1') + outputFile.setText("$antoraVersion") + } +} + asciidoctorPdf { clearSources() sources {