fixes #319 allow building if .git is not present (e.g. from source zip)

This commit is contained in:
Anton Keks 2022-01-20 21:08:37 +02:00
parent c1a367c756
commit 66f4ed9d72
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,6 @@
Unreleased:
- Allow building if .git is not present (e.g. from source zip) #319
Changes in 3.8.1:
- Make 32-bit Windows build still run under Oracle Java 8 - it seems to still be popular #324
- Make deb files install on older Debian without zst compression support #327

View File

@ -9,7 +9,6 @@ buildscript {
plugins {
id "java"
id "com.palantir.git-version" version "0.12.2"
}
def osName = System.getProperty("os.name")
@ -19,7 +18,10 @@ def platform = osName.contains("Linux") ? 'linux' + (is64 ? '64' : '32') :
osName.contains("Windows") ? 'win' + (is64 ? '64' : '32') :
osName.contains("OS X") ? 'mac' + (isArm ? "Arm64" : "X86") : 'unknown'
version = gitVersion()
def versionGetter = Runtime.getRuntime().exec("git describe --tags")
versionGetter.waitFor()
version = versionGetter.waitFor() == 0 ? new String(versionGetter.inputStream.readAllBytes()) : "unknown"
sourceCompatibility = 8
targetCompatibility = 8