-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.gradle
266 lines (225 loc) · 13.2 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'gradle.plugin.org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.12.0'
classpath "gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0"
}
}
apply plugin: 'application'
apply plugin: 'java'
apply plugin: 'java-library'
//apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.github.johnrengelman.shadow'
group 'com.scienceminer.glutton'
version '0.3-SNAPSHOT'
//sourceCompatibility = 1.8
sourceCompatibility = 1.11
targetCompatibility = 1.11
// The main class of the application
mainClassName = 'com.scienceminer.glutton.web.LookupServiceApplication'
tasks.run.workingDir = rootProject.rootDir
repositories {
mavenLocal()
mavenCentral()
}
sourceSets.main.resources {
srcDirs = ["src/main/resources"];
}
configurations {
all*.exclude group: 'org.slf4j', module: "slf4j-log4j12"
all*.exclude group: 'log4j', module: "log4j"
all*.exclude group: 'log4j2', module: "log4j2"
implementation.setCanBeResolved(true)
}
processResources {
filesMatching('config/glutton.yml') {
filter {
it.replace('project.version', project.property('version_placeholder'))
}
}
}
task install(dependsOn: installShadowDist)
dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation "org.hamcrest:hamcrest-all:1.3"
testImplementation "org.easymock:easymock:3.5"
implementation "com.google.code.gson:gson:2.8.1"
//Dropwizard
implementation 'ru.vyarus:dropwizard-guicey:7.0.0'
implementation 'io.dropwizard:dropwizard-bom:4.0.0'
implementation 'io.dropwizard:dropwizard-core:4.0.0'
implementation 'io.dropwizard:dropwizard-assets:4.0.0'
implementation 'io.dropwizard:dropwizard-testing:4.0.0'
implementation 'io.dropwizard.modules:dropwizard-testing-junit4:4.0.0'
implementation 'io.dropwizard:dropwizard-forms:4.0.0'
implementation 'io.dropwizard:dropwizard-client:4.0.0'
implementation 'io.dropwizard:dropwizard-auth:4.0.0'
implementation 'io.dropwizard.metrics:metrics-core:4.2.22'
implementation 'io.dropwizard.metrics:metrics-servlets:4.2.22'
implementation 'jakarta.validation:jakarta.validation-api:2.0.2'
implementation 'org.slf4j:slf4j-api:1.7.30'
implementation 'ch.qos.logback:logback-classic:1.2.3'
implementation 'org.apache.logging.log4j:log4j-to-slf4j:2.8.2'
implementation "com.rockymadden.stringmetric:stringmetric-core_2.10:0.27.3"
//Parsing XML/Json
implementation group: 'org.codehaus.woodstox', name: 'stax2-api', version: '4.0.0'
implementation group: 'org.codehaus.woodstox', name: 'woodstox-core-asl', version: '4.4.1'
implementation 'org.lmdbjava:lmdbjava:0.9.0'
implementation 'de.ruedigermoeller:fst:2.56'
implementation 'org.xerial.snappy:snappy-java:1.1.7.2'
implementation 'org.elasticsearch.client:elasticsearch-rest-high-level-client:7.17.2'
implementation 'co.elastic.clients:elasticsearch-java:8.12.1'
implementation ('org.apache.solr:solr-solrj:9.5.0') {
exclude group: 'org.eclipse.jetty', module: 'jetty-http2'
exclude group: 'org.eclipse.jetty.http2', module: 'http2-client'
}
implementation 'org.apache.commons:commons-collections4:4.1'
implementation 'commons-beanutils:commons-beanutils:1.9.4'
implementation 'commons-io:commons-io:2.6'
implementation group: 'org.apache.commons', name: 'commons-compress', version: '1.20'
implementation group: 'org.tukaani', name: 'xz', version: '1.8'
implementation "com.fasterxml.jackson.core:jackson-core:2.14.3"
implementation "com.fasterxml.jackson.core:jackson-databind:2.14.3"
implementation "com.fasterxml.jackson.module:jackson-module-afterburner:2.14.3"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.3"
implementation group: 'com.opencsv', name: 'opencsv', version: '5.0'
}
distributions {
shadow {
/*contents {
from(new File(rootProject.rootDir, "data/config")) {
into "data/config"
}
}*/
}
}
shadowJar {
classifier = 'onejar'
mergeServiceFiles()
zip64 true
manifest {
attributes 'Main-Class': mainClassName
}
exclude("logback.xml")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
distTar.enabled = false
distZip.enabled = false
shadowDistTar.enabled = false
artifacts {
archives shadowJar
}
// arguments for exec tasks
ext.getArg = { propName, defaultVal ->
return project.hasProperty(propName) ? project.getProperty(propName) : defaultVal;
}
task server(dependsOn: 'classes', type: JavaExec, group: 'service') {
main = 'com.scienceminer.glutton.web.LookupServiceApplication'
classpath = sourceSets.main.runtimeClasspath
args 'server', getArg('config', 'config/glutton.yml')
if(JavaVersion.current().compareTo(JavaVersion.VERSION_1_8) > 0) {
jvmArgs '-Xmx3072m', "--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.text=ALL-UNNAMED", "--add-opens", "java.base/java.net=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.math=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED", "--add-opens", "java.base/java.time=ALL-UNNAMED"
} else {
jvmArgs '-Xmx3072m'
}
}
task crossref(dependsOn: 'classes', type: JavaExec, group: 'data') {
main = 'com.scienceminer.glutton.web.LookupServiceApplication'
classpath = sourceSets.main.runtimeClasspath
args 'crossref', '--input', getArg('input', ''), getArg('config', 'config/glutton.yml')
if(JavaVersion.current().compareTo(JavaVersion.VERSION_1_8) > 0) {
jvmArgs '-Xmx3072m', "--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.text=ALL-UNNAMED", "--add-opens", "java.base/java.net=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.math=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED", "--add-opens", "java.base/java.time=ALL-UNNAMED"
} else {
jvmArgs '-Xmx3072m'
}
}
task gap_crossref(dependsOn: 'classes', type: JavaExec, group: 'data') {
main = 'com.scienceminer.glutton.web.LookupServiceApplication'
classpath = sourceSets.main.runtimeClasspath
args 'gap_crossref', getArg('config', 'config/glutton.yml')
if(JavaVersion.current().compareTo(JavaVersion.VERSION_1_8) > 0) {
jvmArgs '-Xmx3072m', "--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.text=ALL-UNNAMED", "--add-opens", "java.base/java.net=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.math=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED", "--add-opens", "java.base/java.time=ALL-UNNAMED"
} else {
jvmArgs '-Xmx3072m'
}
}
task hal(dependsOn: 'classes', type: JavaExec, group: 'data') {
main = 'com.scienceminer.glutton.web.LookupServiceApplication'
classpath = sourceSets.main.runtimeClasspath
args 'hal', getArg('config', 'config/glutton.yml')
if(JavaVersion.current().compareTo(JavaVersion.VERSION_1_8) > 0) {
jvmArgs '-Xmx3072m', "--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.text=ALL-UNNAMED", "--add-opens", "java.base/java.net=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.math=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED", "--add-opens", "java.base/java.time=ALL-UNNAMED"
} else {
jvmArgs '-Xmx3072m'
}
}
task pmid(dependsOn: 'classes', type: JavaExec, group: 'service') {
main = 'com.scienceminer.glutton.web.LookupServiceApplication'
classpath = sourceSets.main.runtimeClasspath
args 'pmid', getArg('config', 'config/glutton.yml')
if(JavaVersion.current().compareTo(JavaVersion.VERSION_1_8) > 0) {
jvmArgs '-Xmx3072m', "--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.text=ALL-UNNAMED", "--add-opens", "java.base/java.net=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.math=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED", "--add-opens", "java.base/java.time=ALL-UNNAMED"
} else {
jvmArgs '-Xmx3072m'
}
}
task unpaywall(dependsOn: 'classes', type: JavaExec, group: 'data') {
main = 'com.scienceminer.glutton.web.LookupServiceApplication'
classpath = sourceSets.main.runtimeClasspath
args 'unpaywall', '--input', getArg('input', ''), getArg('config', 'config/glutton.yml')
if(JavaVersion.current().compareTo(JavaVersion.VERSION_1_8) > 0) {
jvmArgs '-Xmx3072m', "--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.text=ALL-UNNAMED", "--add-opens", "java.base/java.net=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.math=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED", "--add-opens", "java.base/java.time=ALL-UNNAMED"
} else {
jvmArgs '-Xmx3072m'
}
}
task istex(dependsOn: 'classes', type: JavaExec, group: 'data') {
main = 'com.scienceminer.glutton.web.LookupServiceApplication'
classpath = sourceSets.main.runtimeClasspath
args 'istex', '--input', getArg('input', ''), getArg('config', 'config/glutton.yml')
if(JavaVersion.current().compareTo(JavaVersion.VERSION_1_8) > 0) {
jvmArgs '-Xmx3072m', "--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.text=ALL-UNNAMED", "--add-opens", "java.base/java.net=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.math=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED", "--add-opens", "java.base/java.time=ALL-UNNAMED"
} else {
jvmArgs '-Xmx3072m'
}
}
// only used it to re-create the search index from scratch, keeping the LMDB unchanged
task index(dependsOn: 'classes', type: JavaExec, group: 'search') {
main = 'com.scienceminer.glutton.web.LookupServiceApplication'
classpath = sourceSets.main.runtimeClasspath
args 'index', getArg('config', 'config/glutton.yml')
if(JavaVersion.current().compareTo(JavaVersion.VERSION_1_8) > 0) {
jvmArgs '-Xmx3072m', "--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.text=ALL-UNNAMED", "--add-opens", "java.base/java.net=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.math=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED", "--add-opens", "java.base/java.time=ALL-UNNAMED"
} else {
jvmArgs '-Xmx3072m'
}
}
// experimental
task hal_audit(dependsOn: 'classes', type: JavaExec, group: 'search') {
main = 'com.scienceminer.glutton.web.LookupServiceApplication'
classpath = sourceSets.main.runtimeClasspath
args 'hal_audit', getArg('config', 'config/glutton.yml')
if(JavaVersion.current().compareTo(JavaVersion.VERSION_1_8) > 0) {
jvmArgs '-Xmx3072m', "--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.text=ALL-UNNAMED", "--add-opens", "java.base/java.net=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.math=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED", "--add-opens", "java.base/java.time=ALL-UNNAMED"
} else {
jvmArgs '-Xmx3072m'
}
}
test {
useJUnitPlatform()
testLogging.showStandardStreams = true
// enable for having separate test executor for different tests
forkEvery = 1
maxHeapSize = "1024m"
if (JavaVersion.current().compareTo(JavaVersion.VERSION_1_8) > 0) {
jvmArgs "--add-opens", "java.base/java.util.stream=ALL-UNNAMED",
"--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.text=ALL-UNNAMED", "--add-opens", "java.base/java.net=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.math=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED", "--add-opens", "java.base/java.time=ALL-UNNAMED"
}
}