-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
256 lines (210 loc) · 7.8 KB
/
Copy pathbuild.gradle
File metadata and controls
256 lines (210 loc) · 7.8 KB
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
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.8.4'
id "com.github.johnrengelman.shadow" version "5.2.0"
id "com.jfrog.bintray" version "1.8.4"
id 'net.researchgate.release' version '2.6.0'
id 'java'
id 'maven'
id 'application'
}
group = "org.grobid"
description = """The goal of this GROBID module is to recognize in textual documents any expressions of
measurements (e.g. pressure, temperature, etc.), to parse and normalization them, and finally to convert
these measurements into SI units. We focus our work on technical and scientific articles (text, XML and PDF input)
and patents (text and XML input)."""
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.run.workingDir = rootProject.rootDir
ext {
// treating them separately, these jars will be flattened into grobid-core.jar on installing,
// to avoid missing dependencies from the projects that include grobid-core (see 'jar' taskin grobid-core)
localLibs = []
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://dl.bintray.com/rookies/maven" }
maven { url "http://oss.jfrog.org/artifactory/libs-release" }
}
dependencies {
//Tests
testCompile 'junit:junit:4.12'
testCompile 'org.easymock:easymock:4.0.2'
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile group: 'org.easymock', name: 'easymock', version: '3.4'
testCompile 'org.powermock:powermock-module-junit4:2.0.2'
testCompile 'org.powermock:powermock-api-easymock:2.0.2'
//GROBID
compile 'org.grobid:grobid-core:0.6.2'
compile 'org.grobid:grobid-trainer:0.6.2'
compile('org.grobid:grobid-service:0.6.2') {
transitive = false
}
//Apache commons
compile 'org.apache.commons:commons-collections4:4.1'
compile 'org.apache.commons:commons-lang3:3.6'
compile 'commons-logging:commons-logging:1.2'
compile 'commons-io:commons-io:2.6'
compile 'commons-pool:commons-pool:1.6'
//Json
compile "com.fasterxml.jackson.core:jackson-core:2.10.1"
compile "com.fasterxml.jackson.core:jackson-databind:2.10.1"
compile "com.fasterxml.jackson.module:jackson-module-afterburner:2.10.1"
// measurements
compile group: 'si.uom', name: 'si-units-java8', version: '0.9'
compile group: 'si.uom', name: 'si-quantity', version: '0.9'
compile group: 'tec.uom', name: 'uom-se', version: '1.0.9'
compile group: 'systems.uom', name: 'systems-ucum-java8', version: '0.9'
compile group: 'systems.uom', name: 'systems-unicode-java8', version: '0.9'
compile group: 'systems.uom', name: 'systems-quantity', version: '0.9'
compile group: 'systems.uom', name: 'systems-common', version: '0.9'
// compile 'tech.units:indriya:1.3'
// compile group: 'si.uom', name: 'si-units', version: '1.2'
// compile group: 'si.uom', name: 'si-quantity', version: '1.2'
// compile group: 'systems.uom', name: 'systems-quantity', version: '1.0'
// compile group: 'systems.uom', name: 'systems-common', version: '1.0'
// compile group: 'systems.uom', name: 'systems-unicode', version: '1.0'
// compile group: 'systems.uom', name: 'systems-ucum', version: '1.0'
// compile group: 'systems.uom', name: 'systems-ucum-java8', version: '1.0'
// compile group: 'systems.uom', name: 'systems-unicode-java8', version: '1.0'
//Dropwizard
compile "io.dropwizard:dropwizard-core:1.3.23"
compile "io.dropwizard:dropwizard-assets:1.3.23"
compile "com.hubspot.dropwizard:dropwizard-guicier:1.3.5.2"
compile "io.dropwizard:dropwizard-testing:1.3.23"
compile "io.dropwizard:dropwizard-forms:1.3.23"
compile "io.dropwizard:dropwizard-client:1.3.23"
compile "io.dropwizard:dropwizard-auth:1.3.23"
compile "io.dropwizard.metrics:metrics-core:4.0.0"
compile "io.dropwizard.metrics:metrics-servlets:4.0.0"
compile 'javax.servlet:javax.servlet-api:3.1.0'
//Misc
compile group: 'com.googlecode.clearnlp', name: 'clearnlp', version: '1.3.1'
compile "com.google.guava:guava:28.2-jre"
compile group: 'net.arnx', name: 'jsonic', version: '1.3.10'
// XML
implementation 'org.codehaus.woodstox:stax2-api:3.1.4'
implementation 'com.fasterxml.woodstox:woodstox-core:5.1.0'
// Needed for compatibility with JDK > 8
compile 'javax.activation:activation:1.1.1'
//NLP
// compile 'edu.emory.mathcs.nlp:nlp4j-api:1.1.3'
// compile 'edu.emory.mathcs.nlp:nlp4j-english:1.1.3'
}
configurations {
compile.exclude group: "org.slf4j", module: "slf4j-jdk14"
compile.exclude group: 'org.slf4j', module: "slf4j-log4j12"
compile.exclude group: 'log4j', module: "log4j"
}
configurations.all {
resolutionStrategy {
force 'xml-apis:xml-apis:1.4.01'
}
}
test {
exclude '**/**IntegrationTest**'
}
task integration(type: Test) {
include '**'
}
// Training configuration
def trainerTasks = [
//Training models
"train_units" : "org.grobid.trainer.UnitTrainer",
"train_quantities" : "org.grobid.trainer.QuantityTrainer",
"train_values" : "org.grobid.trainer.ValueTrainer",
"train_quantifiedObjects": "org.grobid.trainer.QuantifiedObjectTrainer"
]
trainerTasks.each { taskName, mainClassName ->
tasks.create(name: taskName, type: JavaExec, group: 'training') {
main = mainClassName
classpath = sourceSets.main.runtimeClasspath
}
}
// return the default value if the property has not been specified in command line
ext.getArg = { propName, defaultVal ->
return project.hasProperty(propName) ? project.getProperty(propName) : defaultVal;
}
/*** Packaging and distribution ***/
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
task mainJar(type: ShadowJar, group: 'onejar') {
zip64 true
from sourceSets.main.output
mergeServiceFiles()
from {
project.configurations.compile.collect {
it.isDirectory() ? [] : localLibs.contains(it.getName()) ? zipTree(it) : []
}
}
}
shadowJar {
mainClassName = 'org.grobid.service.main.GrobidQuantitiesApplication'
classifier = 'onejar'
mergeServiceFiles()
zip64 true
manifest {
attributes 'Main-Class': mainClassName
}
}
jar {
dependsOn mainJar
}
artifacts {
archives shadowJar
archives mainJar
}
task copyModels(type: Copy) {
from "${rootDir}/resources/models"
include "**/model.wapiti", "**/config.json", "**/model_weights.hdf5", "**/preprocessor.pkl"
into "${rootDir}/../grobid-home/models/"
}
wrapper {
gradleVersion "6.8.3"
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
coveralls {
jacocoReportPath 'build/reports/jacoco/test/jacocoTestReport.xml'
}
/*** Release ***/
bintray {
dryRun = true // Whether to run this as dry-run, without deploying
publish = false // If version should be auto published after an upload
// read from ~/.gradle/gradle.properties. Set those up before releasing
user = project.hasProperty('bintrayUser') ? bintrayUser : ''
key = project.hasProperty('bintrayApiKey') ? bintrayApiKey : ''
configurations = ['archives']
pkg {
name = 'grobid-quantities'
repo = 'maven'
userOrg = 'rookies'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/kermitt2/grobid-quantities'
issueTrackerUrl = 'https://github.com/kermitt2/grobid-quantities/issues'
githubRepo = 'kermitt2/grobid'
version {
name = rootProject.version
vcsTag = rootProject.version
released = new Date()
}
}
}