blob: 8edceeb2324123230caf3db2f632c285ac4ffc97 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
def getCommitHash(){
try {
def commitHashProc = "git describe --always --dirty".execute()
commitHashProc.waitFor()
if(commitHashProc.exitValue() == 0){
def commitHash = commitHashProc.text.trim()
return commitHash
} else {
println commitHashProc.err.text
throw new Exception("git describe exited with non-zero return value")
}
} catch(Exception e){
println "Failed to get commit version: " + e.getMessage()
}
return "UNKNOWN" // fallback
}
jar {
manifest {
attributes (
'FMLAT': "LODMod_at.cfg",
'Commit-ID': getCommitHash(),
)
}
}
apply from: "makalibs.gradle"
|