gradle/grgit.gradle
/*
* Copyright © 2017-2023 Kynetics LLC
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
ext {
versionFromGit = { prj ->
def gitversion = "none"
try {
gitversion = grgit.describe(tags: true) ?: grgit.head().getAbbreviatedId(7)
} catch (Exception ex) {
logger.error(ex.toString())
}
return gitversion
}
differentVersions = subprojects.collectEntries {
[versionFromGit(it), it]
}
firstVersion = differentVersions.keySet().first()
}
task showVersions {
group 'uf'
doLast {
subprojects.each {
println it.name + ": Building version " + versionFromGit(it)
}
}
}