2021-01-16 20:41:47 -08:00
|
|
|
import java.time.LocalDateTime
|
|
|
|
|
import java.time.format.DateTimeFormatter
|
|
|
|
|
import java.nio.file.Path
|
|
|
|
|
|
|
|
|
|
gradle.allprojects {
|
|
|
|
|
ext.getCurrentVersion = { ->
|
|
|
|
|
def stdout = new ByteArrayOutputStream()
|
|
|
|
|
String tagIsh
|
|
|
|
|
try {
|
|
|
|
|
exec {
|
2021-09-24 16:33:29 -04:00
|
|
|
commandLine 'git', 'describe', '--tags', '--exclude="Dev"'
|
2021-01-16 20:41:47 -08:00
|
|
|
standardOutput = stdout
|
|
|
|
|
}
|
|
|
|
|
tagIsh = stdout.toString().trim().toLowerCase()
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
tagIsh = "dev-Unknown"
|
|
|
|
|
}
|
2021-03-28 14:36:03 -07:00
|
|
|
// boolean isDev = tagIsh.matches(".*-[0-9]*-g[0-9a-f]*")
|
|
|
|
|
// if(isDev) tagIsh = "dev-" + tagIsh
|
2021-01-16 20:41:47 -08:00
|
|
|
println("Picked up version: " + tagIsh)
|
|
|
|
|
return tagIsh
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!ext.has("versionString")) {
|
|
|
|
|
ext.versionString = getCurrentVersion()
|
|
|
|
|
}
|
|
|
|
|
}
|