From 2ae57cbba88714ee7fad8e023e2cdd0a635ed89c Mon Sep 17 00:00:00 2001 From: Micah Zoltu Date: Wed, 31 Aug 2022 02:41:01 -0700 Subject: [PATCH 1/2] Adds support for light (non-annotated) tags. This *should* work, but beware that it is possible it will result in a different `git describe` output that breaks the parser. --- src/main/kotlin/com/zoltu/gradle/plugin/GitVersioning.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/zoltu/gradle/plugin/GitVersioning.kt b/src/main/kotlin/com/zoltu/gradle/plugin/GitVersioning.kt index 4c1a60c..51a5991 100644 --- a/src/main/kotlin/com/zoltu/gradle/plugin/GitVersioning.kt +++ b/src/main/kotlin/com/zoltu/gradle/plugin/GitVersioning.kt @@ -65,7 +65,7 @@ class GitVersioning : Plugin { .build()!! val git = Git.wrap(repository)!! if (git.repository.allRefs.count() == 0) throw Exception("Your repository must have at least one commit in the repository for git-versioning to work. Recommended solution: git commit") - return git.describe().setLong(true).call() ?: throw Exception("Your repository must have at least one tag in it for git-versioning to work. Recommended solution: git tag v0.0") + return git.describe().setLong(true).setTags(true).call() ?: throw Exception("Your repository must have at least one tag in it for git-versioning to work. Recommended solution: git tag v0.0") } private fun setProjectVersion(project: Project, versionInfo: VersionInfo) { From 8b19ffb7dd24491a99bafe306118ec5d768f3b73 Mon Sep 17 00:00:00 2001 From: Micah Zoltu Date: Wed, 31 Aug 2022 02:44:13 -0700 Subject: [PATCH 2/2] Updates `jgit` to latest. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will hopefully add support for `setTags` on `DescribeCommand` without breaking anything else. 😬 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index fe8bf6f..349b212 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ repositories { dependencies { compile(group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: '1.0.5') - compile(group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '4.5.0.201609210915-r') + compile(group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '6.2.0.202206071550-r') testCompile(group: 'junit', name: 'junit', version: '4.12') }