Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for light (non-annotated) tags. #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/zoltu/gradle/plugin/GitVersioning.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class GitVersioning : Plugin<Project> {
.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) {
Expand Down