-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
156 lines (127 loc) · 4.34 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
plugins {
id 'java'
id 'application'
id 'jacoco'
}
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 {
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration/java')
}
resources.srcDir file('src/integration/resources')
}
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
integrationTestRuntime.extendsFrom runtime
}
dependencies {
// solrj
implementation 'org.apache.solr:solr-solrj:9.6.1'
implementation 'org.apache.solr:solr-solrj-zookeeper:9.6.1'
// HTTP server
implementation 'org.eclipse.jetty.http2:http2-server:10.0.20'
implementation 'org.eclipse.jetty:jetty-servlet:10.0.20'
// 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 platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core:5.12.0'
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.17.1'
// for the panl editor
implementation "com.formdev:flatlaf:3.5.1"
implementation 'org.apache.commons:commons-lang3:3.17.0'
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//
// integration testing
//
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
integrationTestImplementation platform('org.junit:junit-bom:5.9.1')
integrationTestImplementation 'org.junit.jupiter:junit-jupiter'
integrationTestImplementation 'org.mockito:mockito-core:5.12.0'
integrationTestImplementation 'com.fasterxml.jackson.core:jackson-databind:2.17.1'
integrationTestImplementation 'commons-io:commons-io:2.16.1'
integrationTestImplementation 'org.json:json:20240303'
// HTTP server
integrationTestImplementation 'org.eclipse.jetty.http2:http2-server:10.0.20'
integrationTestImplementation 'org.eclipse.jetty:jetty-servlet:10.0.20'
// logging
integrationTestImplementation 'org.slf4j:slf4j-api:2.0.13'
integrationTestImplementation 'org.apache.logging.log4j:log4j-core:2.23.1'
integrationTestImplementation 'org.apache.logging.log4j:log4j-api:2.23.1'
integrationTestImplementation 'org.apache.logging.log4j:log4j-slf4j2-impl:2.23.1'
// additional utilities
integrationTestImplementation 'commons-io:commons-io:2.16.1'
integrationTestImplementation 'org.json:json:20240303'}
application {
mainClass = 'com.synapticloop.panl.Main'
}
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.16.1",
"com.fasterxml.jackson.core:jackson-databind:2.17.1",
"com.fasterxml.jackson.core:jackson-annotations:2.17.1"
}
}
}
task copyLoggingFile {
copy {
from file("src/main/resources/log4j2.xml")
into file("src/dist/lib/")
}
}
tasks.startScripts.doLast {
def unixScriptFile = file getUnixScript()
unixScriptFile.text = unixScriptFile.text.replace('DEFAULT_JVM_OPTS=""', 'DEFAULT_JVM_OPTS="-Dlog4j2.configurationFile=lib/log4j2.xml"')
def windowsScriptFile = file getWindowsScript()
windowsScriptFile.text = windowsScriptFile.text.replace('set DEFAULT_JVM_OPTS=', 'set DEFAULT_JVM_OPTS=-Dlog4j2.configurationFile=lib\\log4j2.xml')
}
//
// Exclude the Log4J configuration
//
jar {
exclude('log4j2.xml')
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
tasks.register('integrationTest', Test) {
useJUnitPlatform()
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
classpath += sourceSets.main.runtimeClasspath
outputs.upToDateWhen { false }
}
jacocoTestReport {
dependsOn test
}