-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
225 lines (178 loc) · 6.75 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
/*
* Gradle build specifications for
* LangPi: language processing interface
*
* Copyright 2017 Abdelkrime Aries <kariminfo0@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Java plugin to add support for Java
apply plugin: 'java'
apply plugin: 'jacoco'
//For jitPack to build
apply plugin: 'maven'
// Gradle java plugin
sourceCompatibility = 1.8
targetCompatibility = 1.8
// Release version
version = '1.1.5'
//TODO this will prevent tests
check.dependsOn.remove(test)
ext.current_Date = getDate()
def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMddHHmm')
return formattedDate
}
sourceSets {
basic
basic_main {
compileClasspath += basic.output
}
basic_agpl3 {
compileClasspath += basic.output
}
wordnet
eval {
compileClasspath += basic.output
compileClasspath += basic_main.output
compileClasspath += basic_agpl3.output
compileClasspath += wordnet.output
}
test {
compileClasspath += basic.output
compileClasspath += basic_main.output
compileClasspath += basic_agpl3.output
compileClasspath += wordnet.output
compileClasspath += eval.output
}
}
//Jar tasks
def getManifest(specif, implem) {
return {
attributes 'Created-By': System.getProperty('java.version') + ' (' + System.getProperty('java.vendor') + ')',
"Specification-Title" : specif,
"Specification-Version" : version,
"Specification-Vendor" : "Kariminf",
"Implementation-Title" : implem,
"Implementation-Version" : version + "-build" + current_Date ,
"Implementation-Vendor" : "Kariminf",
"Built-With": "gradle-${project.getGradle().getGradleVersion()}, groovy-${GroovySystem.getVersion()}",
"Build-Time": current_Date,
"Built-By": project.hasProperty('BF_USER') ? project.getProperty('BF_USER') : System.getProperty('user.name'),
"Built-On": "${InetAddress.localHost.hostName}/${InetAddress.localHost.hostAddress}"
}
}
task jarBasicMain(type: Jar) {
baseName = "langpi-basic-main"
from sourceSets.basic_main.output
from sourceSets.basic.output
manifest getManifest("Language processing interface: basic main", "kariminf.langpi.basic-main")
}
task jarBasicAgpl3(type: Jar) {
baseName = "langpi-basic-agpl3"
from sourceSets.basic_agpl3.output
from sourceSets.basic.output
manifest getManifest("Language processing interface: basic agpl3", "kariminf.langpi.basic-agpl3")
}
task jarEval(type: Jar) {
baseName = "langpi-eval"
from sourceSets.eval.output
manifest getManifest("Language processing interface: evaluation", "kariminf.langpi.eval")
}
task jarWordnet(type: Jar) {
baseName = "langpi-wordnet"
from sourceSets.wordnet.output
manifest getManifest("Language processing interface: wordnet", "kariminf.langpi.wordnet")
}
// artifacts
artifacts {
archives jarBasicMain
archives jarBasicAgpl3
archives jarWordnet
archives jarEval
}
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
// The production code uses the SLF4J logging API at compile time
compile 'org.slf4j:slf4j-api:1.7.21'
basic_mainCompile 'org.apache.lucene:lucene-core:4.10.2'
basic_mainCompile 'org.apache.lucene:lucene-analyzers-common:4.10.2'
basic_agpl3Compile 'org.apache.lucene:lucene-analyzers-common:4.10.2'
basic_mainCompile 'org.apache.lucene:lucene-analyzers-kuromoji:4.10.2'
basic_mainCompile 'org.apache.lucene:lucene-analyzers-smartcn:4.10.2'
basic_mainCompile 'org.apache.opennlp:opennlp-maxent:3.0.2-incubating'
basic_mainCompile 'org.apache.opennlp:opennlp-tools:1.7.2'
wordnetCompile 'org.xerial:sqlite-jdbc:3.8.11.2'
wordnetCompile 'edu.mit:jwi:2.2.3'
//com.github.kariminf (https://jitpack.io)
basic_agpl3Compile 'com.github.kariminf:k-hebmorph:2.0.3'
basic_mainCompile 'com.github.kariminf:k-jhazm:1.0.2'
basic_agpl3Compile 'com.github.kariminf:k-opennlp1.4:1.4.4'
//Remote release
basicCompile 'com.github.kariminf:k-toolja:1.1.0'
basic_mainCompile 'com.github.kariminf:k-toolja:1.1.0'
basic_agpl3Compile 'com.github.kariminf:k-toolja:1.1.0'
evalCompile 'com.github.kariminf:k-toolja:1.1.0'
//Local release
//sharedCompile project(':k-toolja')
//basic_mainCompile project(':k-toolja')
//basic_agpl3Compile project(':k-toolja')
//compile project(':k-toolja')
testCompile 'junit:junit:4.12'
testCompile configurations.basicCompile
testCompile configurations.basic_mainCompile
testCompile configurations.basic_agpl3Compile
testCompile configurations.wordnetCompile
testCompile configurations.evalCompile
runtime configurations.basicRuntime
runtime configurations.basic_mainRuntime
runtime configurations.basic_agpl3Runtime
runtime configurations.wordnetRuntime
runtime configurations.evalRuntime
testRuntime configurations.basicRuntime
testRuntime configurations.basic_mainRuntime
testRuntime configurations.basic_agpl3Runtime
testRuntime configurations.wordnetRuntime
testRuntime configurations.evalRuntime
}
javadoc {
source = sourceSets.basic.allJava
source += sourceSets.basic_main.allJava
source += sourceSets.basic_agpl3.allJava
source += sourceSets.wordnet.allJava
source += sourceSets.eval.allJava
options.memberLevel = JavadocMemberLevel.PRIVATE
//classpath = configurations.compile
destinationDir = file("docs")
failOnError false
}
// this step is necessary when installing both jars in the local maven repository
install {
repositories.mavenInstaller {
addFilter('basic-main') { artifact, file -> artifact.name.endsWith('basic-main') }
addFilter('basic-agpl3') { artifact, file -> artifact.name.endsWith('basic-agpl3') }
addFilter('eval') { artifact, file -> artifact.name.endsWith('eval') }
addFilter('wordnet') { artifact, file -> artifact.name.endsWith('wordnet') }
}
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
check.dependsOn jacocoTestReport