build: update versioning

dependabot/gradle/org.projectlombok-lombok-1.18.34
William 5 months ago
parent a129b90110
commit a43cc4108b
No known key found for this signature in database

@ -189,15 +189,20 @@ logger.lifecycle("Building Uniform ${version} by William278")
@SuppressWarnings('GrMethodMayBeStatic') @SuppressWarnings('GrMethodMayBeStatic')
def versionMetadata() { def versionMetadata() {
// Get if there is a tag for this commit // Require grgit
if (grgit == null) {
return '-unknown'
}
// If unclean, return the last commit hash with -indev
if (!grgit.status().clean) {
return '-' + grgit.head().abbreviatedId + '-indev'
}
// Otherwise if this matches a tag, return nothing
def tag = grgit.tag.list().find { it.commit.id == grgit.head().id } def tag = grgit.tag.list().find { it.commit.id == grgit.head().id }
if (tag != null) { if (tag != null) {
return '' return ''
} }
return '-' + grgit.head().abbreviatedId
// Otherwise, get the last commit hash and if it's a clean head
if (grgit == null) {
return '-' + System.getenv("GITHUB_RUN_NUMBER") ? 'build.' + System.getenv("GITHUB_RUN_NUMBER") : 'unknown'
}
return '-' + grgit.head().abbreviatedId + (grgit.status().clean ? '' : '-indev')
} }
Loading…
Cancel
Save