From 2b5d441db59d48b480d5f933b91c66557bef07ba Mon Sep 17 00:00:00 2001 From: Jonatan Ivanov Date: Mon, 16 Oct 2023 16:21:20 -0700 Subject: [PATCH] set version from tag manually --- build.gradle | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ea3f87f95c..609ffeaf98 100644 --- a/build.gradle +++ b/build.gradle @@ -36,8 +36,13 @@ buildscript { // Unfortunately jgit does not support worktrees: https://bugs.eclipse.org/bugs/show_bug.cgi?id=477475 // TODO: remove this hack once jgit supports worktrees and nebula upgrades. if (project.hasProperty('antora')) { - 'git fetch --unshallow --all --tags'.execute().text // antora shallow-clones so there is no history + 'git fetch --unshallow --all --tags'.execute() // antora shallow-clones so there is no history + String tag = 'git tag --points-at HEAD'.execute().text.trim() // jgit does not able to figure out tags in antora's setup + if (tag) { ext['release.version'] = tag } ext['git.root'] = 'git rev-parse --path-format=absolute --git-common-dir'.execute().text.trim() + println '------------' + println "${tag}" + println '------------' } // TODO: remove this hack, see: https://github.com/nebula-plugins/nebula-release-plugin/issues/213