-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
executable file
·140 lines (117 loc) · 3.43 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
apply plugin: "java"
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'application'
apply plugin: 'sonar-runner'
group = theGroup
sourceCompatibility = theSourceCompatibility
version=theVersion
if(theRelease){
version = theVersion + getDate()
}
mainClassName = 'de.teamgrit.grit.main.Boot'
jar {
manifest {
attributes 'Implementation-Title': group, 'Implementation-Version': version
attributes 'Main-Class': 'main.Boot'
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
srcDirs = ["src"]
}
}
test {
java {
srcDirs = ["tests"]
}
}
}
dependencies {
// convenience
compile group: 'commons-io', name: 'commons-io', version: '2.4'
compile group: 'commons-codec', name: 'commons-codec', version: '1.9'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2'
// config needs older versions of the commons api to run
compile group: 'commons-configuration', name: 'commons-configuration', version: '1.10'
runtime group: 'commons-collections', name: 'commons-collections',
version: '3.2.2'
runtime group: 'commons-lang', name: 'commons-lang', version: '2.6'
runtime group: 'commons-jxpath', name: 'commons-jxpath', version: '1.3'
runtime group: 'commons-beanutils', name: 'commons-beanutils', version: '1.8.0'
// Webserver
compile group: 'com.google.code.gson', name: 'gson', version: '2.2.4'
compile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.2.1.v20140609'
compile group: 'org.eclipse.jetty', name: 'jetty-security', version: '9.2.1.v20140609'
// Mail
compile group: 'javax.mail', name: 'mail', version: '1.4.7'
// Testing
compile group: 'junit', name: 'junit', version: '4.+'
// database conection
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.31'
runtime group: 'mysql', name: 'mysql-connector-java', version: '5.1.31'
// Only needed for the tests
testCompile group: 'junit', name: 'junit', version: '4.+'
testCompile group: 'commons-cli', name: 'commons-cli', version: '1.2'
}
// No need to install gradle
task wrapper(type: Wrapper) {
gradleVersion = '2.2.1'
}
// Distribution
distZip {
into(project.name + '-' + version) {
from '.'
include 'res/**'
include 'licence/**'
include 'src/**'
include 'config/**'
include 'runscript.bat'
include 'runscript.sh'
}
}
installApp {
into('') {
from '.'
include 'res/**'
include 'licence/**'
include 'src/**'
include 'config/**'
include 'runscript.bat'
include 'runscript.sh'
}
}
task dockerRebuild(dependsOn: 'installApp') << {
exec {
executable "cp"
args "-rf","build/install/GRIT", "docker/"
}
exec {
executable "docker"
args "build", "-t", "teamgrit/grit:extra","."
}
}
uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}
startScripts {
doLast {
String optionText = 'DEFAULT_JVM_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address="' + theDebugPort
unixScript.text = unixScript.text.replace('DEFAULT_JVM_OPTS=""', optionText)
windowsScript.text = windowsScript.text.replace('DEFAULT_JVM_OPTS=', optionText)
}
}
// Date Helper
def getDate() {
def date = new Date()
def formattedDate = date.format('yyyy-MM-dd-HH-mm')
return formattedDate
}