From 82ac22ffefde9efe00255b008a5cbf892fb09063 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 19 Aug 2014 10:27:01 +0200 Subject: Removed Annotation based servlet configuration, added Version Servlet --- simpleSigning/build.gradle | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) (limited to 'simpleSigning/build.gradle') diff --git a/simpleSigning/build.gradle b/simpleSigning/build.gradle index 58d3680..084b739 100644 --- a/simpleSigning/build.gradle +++ b/simpleSigning/build.gradle @@ -4,20 +4,32 @@ apply plugin: 'eclipse-wtp' apply plugin: 'war' sourceCompatibility = 1.6 -version = '1.0-RC1' +version = '1.0-RC2' +revision = getCheckedOutGitCommitHash() -jar { - manifest { - attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': version - } + +war { + manifest { + attributes provider: 'EGIZ', 'Specification-Version': getCheckedOutGitCommitHash(), 'Implementation-Title': 'Einfach Signieren', 'Implementation-Version': version + } } -repositories { - mavenCentral() +repositories { mavenCentral() } + + +def getCheckedOutGitCommitHash() { + def gitFolder = "$projectDir/../.git/" + def takeFromHash = 40 + def head = new File(gitFolder + "HEAD").text.split(":") // .git/HEAD + 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 } dependencies { - compile group: 'commons-collections', name: 'commons-collections', version: '3.2' + compile group: 'commons-collections', name: 'commons-collections', version: '3.2' compile group: 'commons-fileupload', name: 'commons-fileupload', version: '1.2' compile group: 'org.apache.commons', name: 'commons-io', version: '1.3.2' compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.5' @@ -25,17 +37,13 @@ dependencies { //compile group: 'org.apache.pdfbox', name: 'pdfbox', version: '1.8.5' compile 'com.lowagie:itext:4.2.0' providedCompile 'javax.servlet:javax.servlet-api:3.1.0' - testCompile group: 'junit', name: 'junit', version: '4.+' + testCompile group: 'junit', name: 'junit', version: '4.+' } -test { - systemProperties 'property': 'value' -} +test { systemProperties 'property': 'value' } uploadArchives { - repositories { - flatDir { - dirs 'repos' - } - } + repositories { + flatDir { dirs 'repos' } + } } -- cgit v1.2.3