-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
88 lines (74 loc) · 2.24 KB
/
build.gradle
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
* Copyright (c) 2017 German Cancer Research Center (DKFZ).
*
* Distributed under the MIT License (license terms are at https://www.github.com/theroddywms/Roddy/LICENSE.txt).
*/
plugins {
id 'org.ajoberstar.grgit' version '1.7.2'
}
apply plugin: 'groovy'
apply plugin: 'maven'
group = "com.github.theroddywms"
/*
* Gets the version name from the current Git tag. If the current commit is not tagged,
* this returned string will indicate that. Also if the repository is dirty.
*/
def getVersionName() {
def dirtySuffix = grgit.status().isClean() ? '' : '-dirty'
return grgit.describe() + dirtySuffix
}
rootProject.version = getVersionName()
repositories {
mavenCentral()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.4.21'
testCompile 'junit:junit:4.13.1'
testCompile 'org.spockframework:spock-core:1.1-groovy-2.4'
compile group: 'commons-codec', name: 'commons-codec', version: '1.13'
compile group: 'org.apache.commons', name: 'commons-io', version: '1.3.2'
}
// Fix Java Version
ext.langLevel = 1.8
task writePom {
doLast {
pom {
project {
version rootProject.version
inceptionYear '2017'
licenses {
license {
name 'MIT License'
url 'https://raw.githubusercontent.com/eilslabs/RoddyToolLib/master/LICENSE'
distribution 'repo'
}
}
}
}.writeTo("$buildDir/pom.xml")
}
}
jar {
version = getVersionName()
manifest {
attributes("Implementation-Vendor": "German Cancer Research Center (DKFZ)")
attributes("Implementation-Title": baseName)
attributes 'Implementation-Version': rootProject.version
}
dependsOn writePom
into("META-INF/maven/$project.group/$project.name") {
from "$buildDir/pom.xml"
}
}
test {
workingDir = System.getProperty("user.dir")
ignoreFailures = project.hasProperty("ignoreFailedTests")
testLogging {
debug {
events "started", "skipped", "failed"
exceptionFormat "full"
}
events "failed"
exceptionFormat "full"
setShowStandardStreams true
}
}