aboutsummaryrefslogtreecommitdiff
path: root/moaSig/build.gradle
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-06-27 08:58:10 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-06-27 08:58:10 +0200
commita98fe4810f6926bd459e45d9a92cffc5e7eafb38 (patch)
treeba1522a01d499d5148b3c7023bbcac702a078e71 /moaSig/build.gradle
parenteb87ee9380badeb99558f6e4fab6c0d55cc4f57c (diff)
downloadmoa-sig-a98fe4810f6926bd459e45d9a92cffc5e7eafb38.tar.gz
moa-sig-a98fe4810f6926bd459e45d9a92cffc5e7eafb38.tar.bz2
moa-sig-a98fe4810f6926bd459e45d9a92cffc5e7eafb38.zip
Version 3.0.0 + git commit
Diffstat (limited to 'moaSig/build.gradle')
-rw-r--r--moaSig/build.gradle18
1 files changed, 13 insertions, 5 deletions
diff --git a/moaSig/build.gradle b/moaSig/build.gradle
index ada954f..738ebbc 100644
--- a/moaSig/build.gradle
+++ b/moaSig/build.gradle
@@ -21,13 +21,21 @@ subprojects {
testCompile 'junit:junit:4.8.2'
}
- version = '3.0.0-RC5'
+ version = '3.0.0'
- jar {
- manifest.attributes provider: 'EGIZ'
- }
+ jar { manifest.attributes provider: 'EGIZ', 'Specification-Version': getCheckedOutGitCommitHash(), 'Implementation-Version': project.version }
}
task wrapper(type: Wrapper) {
gradleVersion = '2.8'
-} \ No newline at end of file
+}
+
+def getCheckedOutGitCommitHash() {
+ def gitFolder = "$projectDir/.git/"
+ def takeFromHash = 40
+ def head = new File(gitFolder + "HEAD").text.split(":")
+ def isCommit = head.length == 1
+ if(isCommit) return head[0].trim().take(takeFromHash)
+ def refHead = new File(gitFolder + head[1].trim())
+ refHead.text.trim().take takeFromHash
+}