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') } 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) {