-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
206 lines (166 loc) · 6.54 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
buildscript {
ext {
querydslVersion = '4.1.4'
springVersion = '4.2.6.+'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.1.RELEASE")
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'idea'
group 'dg-lab'
version '1.0-SNAPSHOT'
mainClassName = "com.dglab.cia.Main"
/*idea {
module {
sourceDirs += file('generated/')
}
}*/
configurations.all {
exclude group: 'commons-logging', module: 'commons-logging'
}
repositories {
mavenCentral()
}
dependencies {
compile group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.+'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.7'
}
task bigJar(type: Jar) {
manifest {
attributes 'Main-Class': 'com.dglab.cia.Main'
}
baseName = project.name
from {
[
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) },
'build/classes/main'
]
}
with jar
}
ext.killProcess = { int port ->
try {
def idGetter = new ProcessBuilder('fuser', + port + '/tcp')
def process = idGetter.start()
def id = process.text
process.waitFor()
new ProcessBuilder('kill', '1', id).start()
} catch (Exception e) {
println(e.getMessage())
}
}
ext.runProcess = { int port ->
def builder = new ProcessBuilder(
'java',
'-XX:+HeapDumpOnOutOfMemoryError',
'-jar',
'build/libs/' + project.name + '-' + project.version + '.jar'
)
builder.directory(projectDir)
builder.redirectErrorStream(true)
builder.redirectOutput(new File(project.name + "-log.txt"))
builder.start()
}
}
def shared = project(':cia-shared')
project(':cia-shared') {
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.7.+'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.7.+'
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.7.+'
}
task publish(dependsOn: bigJar) << {}
}
project(':cia-proxy') {
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile group: 'com.sparkjava', name: 'spark-core', version: '2.+'
compile group: 'com.mashape.unirest', name: 'unirest-java', version: '1.4.+'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.+'
compile group: 'org.json', name: 'json', version: '20160212'
}
task kill() << {
killProcess(3637)
}
task publish(dependsOn: bigJar) << {
runProcess(3637)
}
compileJava.dependsOn(kill)
}
project(':cia-storage') {
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile group: 'com.sparkjava', name: 'spark-core', version: '2.+'
compile group: 'commons-dbcp', name: 'commons-dbcp', version: '1.2.+'
compile group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.1'
compile group: 'org.postgresql', name: 'postgresql', version: '9.4.1209.jre7'
compile group: 'org.hibernate', name: 'hibernate-core', version: '5.1.+'
compile group: 'org.hibernate', name: 'hibernate-entitymanager', version: '5.1.+'
compile group: 'org.hibernate', name: 'hibernate-java8', version: '5.1.+'
compile group: 'org.hibernate', name: 'hibernate-hikaricp', version: '5.1.+'
compile group: 'org.hibernate.javax.persistence', name: 'hibernate-jpa-2.1-api'
compile 'org.springframework.data:spring-data-jpa:1.10.+'
compile "com.querydsl:querydsl-apt:4.1.4:jpa"
compile "com.querydsl:querydsl-jpa:4.1.4"
compile group: 'org.springframework', name: 'spring-context', version: "$springVersion"
compile group: 'org.springframework', name: 'spring-tx', version: "$springVersion"
compile group: 'org.springframework', name: 'spring-orm', version: "$springVersion"
compile group: 'com.github.koraktor', name: 'steam-condenser', version: '1.3.+'
compile group: 'com.lukaspradel', name: 'steam-web-api', version: '1.2'
compile group: 'net.jodah', name: 'expiringmap', version: '0.5.7'
compile shared
}
idea {
module {
sourceDirs += file("generated/")
}
}
task kill() << {
killProcess(5141)
}
task publish(dependsOn: bigJar) << {
runProcess(5141)
}
compileJava.dependsOn(kill)
}
project(':cia-view') {
apply plugin: 'spring-boot'
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.+'
compile (group: 'org.kohsuke', name: 'github-api', version: '1.77') {
exclude group: 'org.jenkins-ci', module: 'annotation-indexer'
}
compile group: 'com.squareup.okhttp', name: 'okhttp', version: '2.7.5'
compile group: 'com.squareup.okhttp', name: 'okhttp-urlconnection', version: '2.7.5'
compile (group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.4.1.RELEASE') {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
compile ("com.domingosuarez.boot:spring-boot-starter-jade4j:0.3.0") {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
compile("org.springframework.boot:spring-boot-starter-security")
compile group: 'de.neuland-bfi', name: 'jade4j', version: '1.2.2'
compile group: 'org.springframework.boot', name: 'spring-boot-devtools'
compile group: 'org.openid4java', name: 'openid4java', version: '1.0.0'
/*compile group: 'org.springframework.boot', name: 'spring-boot-starter-security'
compile group: 'org.springframework.security', name: 'spring-security-openid'*/
compile shared
}
task kill() << {
killProcess(80)
}
task publish(dependsOn: build) << {
runProcess(80)
}
compileJava.dependsOn(kill)
}