-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
246 lines (206 loc) · 7.32 KB
/
build.gradle
File metadata and controls
246 lines (206 loc) · 7.32 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
plugins {
id 'java'
id 'application'
id 'jacoco'
id "synapticloop.copyrightr" version "1.3.1"
id "com.github.ben-manes.versions" version "0.53.0"
}
// load the properties for versioning - not that this is also used by the Panl
// server to output the version on startup.
def properties = new Properties()
file("src/main/resources/gradle.properties").withInputStream { properties.load(it) }
version = properties.getProperty("panl.version")
group = 'com.synapticloop'
repositories {
mavenCentral()
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
sourceSets {
testIntegration {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/testintegration/java')
resources.srcDir file('src/testintegration/resources')
}
}
testIntegrationSpider {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/testintegrationspider/java')
resources.srcDir file('src/testintegrationspider/resources')
}
}
}
configurations {
testIntegrationCompile.extendsFrom testCompile
testIntegrationRuntime.extendsFrom testRuntime
testIntegrationRuntime.extendsFrom runtime
testIntegrationSpiderCompile.extendsFrom testCompile
testIntegrationSpiderRuntime.extendsFrom testRuntime
testIntegrationSpiderRuntime.extendsFrom runtime
}
dependencies {
// solrj
implementation 'org.apache.solr:solr-solrj:9.10.0'
// logging
implementation 'org.slf4j:slf4j-api:2.0.13'
implementation 'org.apache.logging.log4j:log4j-core:2.23.1'
implementation 'org.apache.logging.log4j:log4j-api:2.23.1'
implementation 'org.apache.logging.log4j:log4j-slf4j2-impl:2.23.1'
// additional utilities
implementation 'commons-io:commons-io:2.16.1'
implementation 'org.json:json:20240303'
implementation 'net.harawata:appdirs:1.2.2'
// testing
testImplementation 'org.apache.solr:solr-solrj:9.10.0'
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core:5.14.2'
testImplementation 'org.powermock:powermock-api-mockito2:2.0.9'
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.17.1'
testImplementation 'commons-codec:commons-codec:1.17.1'
// for the panl editor
implementation "com.formdev:flatlaf:3.5.1"
implementation 'org.apache.commons:commons-lang3:3.17.0'
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//
// integration testing
//
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
testIntegrationImplementation 'org.apache.solr:solr-solrj:9.10.0'
testIntegrationImplementation platform('org.junit:junit-bom:5.9.1')
testIntegrationImplementation 'org.junit.jupiter:junit-jupiter'
testIntegrationImplementation 'org.mockito:mockito-core:5.12.0'
testIntegrationImplementation 'com.fasterxml.jackson.core:jackson-databind:2.17.1'
testIntegrationImplementation 'commons-io:commons-io:2.16.1'
testIntegrationImplementation 'org.json:json:20240303'
// logging
testIntegrationImplementation 'org.slf4j:slf4j-api:2.0.13'
testIntegrationImplementation 'org.apache.logging.log4j:log4j-core:2.23.1'
testIntegrationImplementation 'org.apache.logging.log4j:log4j-api:2.23.1'
testIntegrationImplementation 'org.apache.logging.log4j:log4j-slf4j2-impl:2.23.1'
// additional utilities
testIntegrationImplementation 'commons-io:commons-io:2.16.1'
testIntegrationImplementation 'org.json:json:20240303'
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//
// Site Spidering
//
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
testIntegrationSpiderImplementation 'org.apache.solr:solr-solrj:9.10.0'
testIntegrationSpiderImplementation platform('org.junit:junit-bom:5.9.1')
testIntegrationSpiderImplementation 'org.junit.jupiter:junit-jupiter'
testIntegrationSpiderImplementation 'org.mockito:mockito-core:5.12.0'
testIntegrationSpiderImplementation 'com.fasterxml.jackson.core:jackson-databind:2.17.1'
testIntegrationSpiderImplementation 'commons-io:commons-io:2.16.1'
testIntegrationSpiderImplementation 'org.json:json:20240303'
// logging
testIntegrationSpiderImplementation 'org.slf4j:slf4j-api:2.0.13'
testIntegrationSpiderImplementation 'org.apache.logging.log4j:log4j-core:2.23.1'
testIntegrationSpiderImplementation 'org.apache.logging.log4j:log4j-api:2.23.1'
testIntegrationSpiderImplementation 'org.apache.logging.log4j:log4j-slf4j2-impl:2.23.1'
// additional utilities
testIntegrationSpiderImplementation 'commons-io:commons-io:2.16.1'
testIntegrationSpiderImplementation 'org.json:json:20240303'
}
application {
mainClass = 'com.synapticloop.panl.Main'
}
startScripts {
classpath = files( '$APP_HOME/lib/*' )
}
distributions {
main {
distributionBaseName = 'solr-panl-' + properties.getProperty("panl.solr.version")
}
configurations.all {
resolutionStrategy {
failOnVersionConflict()
force "org.slf4j:slf4j-api:2.0.13",
"commons-io:commons-io:2.17.0",
"org.mockito:mockito-core:5.14.2",
"net.bytebuddy:byte-buddy:1.15.4",
"net.bytebuddy:byte-buddy-agent:1.15.4",
"com.fasterxml.jackson.core:jackson-databind:2.18.0",
"commons-codec:commons-codec:1.17.1",
"org.objenesis:objenesis:3.3"
}
}
}
tasks.register('copyLoggingFile') {
copy {
from file("src/main/resources/log4j2.xml")
into file("src/dist/lib/")
}
}
tasks.register('dockerWindows', Exec) {
commandLine "cmd.exe", "/C", "build-docker", properties.getProperty("panl.solr.version") + "-" + properties.getProperty("panl.version"), properties.getProperty("solr.server.version")
dependsOn tasks.distTar
}
tasks.register('dockerLinux', Exec) {
commandLine "./build-docker.sh", properties.getProperty("panl.solr.version") + "-" + properties.getProperty("panl.version"), properties.getProperty("solr.server.version")
dependsOn tasks.distTar
}
import org.apache.tools.ant.taskdefs.condition.Os
tasks.register('docker') {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
dependsOn('dockerWindows')
} else {
dependsOn('dockerLinux')
}
}
tasks.withType(Copy).configureEach {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
tasks.register('testIntegration', Test) {
useJUnitPlatform()
testClassesDirs = sourceSets.testIntegration.output.classesDirs
classpath = sourceSets.testIntegration.runtimeClasspath
classpath += sourceSets.main.runtimeClasspath
outputs.upToDateWhen { false }
}
tasks.register('testIntegrationSpider', Test) {
useJUnitPlatform()
testClassesDirs = sourceSets.testIntegrationSpider.output.classesDirs
classpath = sourceSets.testIntegrationSpider.runtimeClasspath
classpath += sourceSets.main.runtimeClasspath
outputs.upToDateWhen { false }
}
tasks.named('distTar', Tar) {
// Example: Change the compression to GZIP (if it wasn't already)
compression = Compression.GZIP
}
jacocoTestReport {
dependsOn test
}
copyrightr {
dryRun = false
copyrightHolder = "synapticloop"
includes = [
"src/**/*.java",
"src/**/*.js"
]
excludes = [
"src/test/java/**/*.java",
"src/testintegration/java/**/*.java",
"src/testintegrationspider/java/**/*.java",
"**/*.class",
"**/package-info.java",
"**/LpseTokeniser.java",
"**/*.*",
"**/nouislider.min.js"
]
onlyReplaceFirst = true
yearSeparator = " - "
failOnMissing = false
}