-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
426 lines (350 loc) · 13.4 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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
import groovy.json.JsonOutput
buildscript {
ext {
ktlin = [:].with {
v = '1.8.10'
majorV = '1.8'
std = [group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: v]
reflect = [group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: v]
delegate
}
coroutines = [:].with {
v = '1.6.4'
core = [group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: v]
javaFx = [group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-javafx', version: v]
debug = [group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-debug', version: v]
test = [group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-test', version: v]
delegate
}
guice = [group: 'com.google.inject', name: 'guice', version: '5.1.0']
classGraph = [group: 'io.github.classgraph', name: 'classgraph', version: '4.8.156']
slf4j = [:].with {
v = '2.0.6'
api = [group: 'org.slf4j', name: 'slf4j-api', version: v]
julBridge = [group: 'org.slf4j', name: 'jul-to-slf4j', version: v]
delegate
}
// This is the highest version of logback which supports JDK 8.
logback = [group: 'ch.qos.logback', name: 'logback-classic', version: '1.3.5']
typesafeConfig = [group: 'com.typesafe', name: 'config', version: '1.4.2']
config4k = [group: 'io.github.config4k', name: 'config4k', version: '0.5.0']
guava = [group: 'com.google.guava', name: 'guava', version: '31.1-jre']
jodaTime = [group: 'joda-time', name: 'joda-time', version: '2.12.2']
khttp = [group: 'com.github.jkcclemens', name: 'khttp', version: 'master-SNAPSHOT']
jackson = [:].with {
v = '2.14.2'
core = [group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: v]
kotlin = [group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: v]
joda = [group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-joda', version: v]
delegate
}
// Newer versions of H2 are slower when importing a 2k+ items db...
h2 = [group: 'com.h2database', name: 'h2', version: '1.4.196']
exposed = [:].with {
v = '0.41.1'
core = [group: 'org.jetbrains.exposed', name: 'exposed-core', version: v]
dao = [group: 'org.jetbrains.exposed', name: 'exposed-dao', version: v]
jdbc = [group: 'org.jetbrains.exposed', name: 'exposed-jdbc', version: v]
jodaTime = [group: 'org.jetbrains.exposed', name: 'exposed-jodatime', version: v]
javaTime = [group: 'org.jetbrains.exposed', name: 'exposed-java-time', version: v]
delegate
}
controlsFx = [group: 'org.controlsfx', name: 'controlsfx', version: '8.40.18']
jFoenix = [group: 'com.jfoenix', name: 'jfoenix', version: '8.0.10']
// This is the highest version of TornadoFx which doesn't break the build.
tornadoFx = [group: 'no.tornado', name: 'tornadofx', version: '1.7.18']
ikonli = [:].with {
v = '2.6.0'
javaFx = [group: 'org.kordamp.ikonli', name: 'ikonli-javafx', version: v]
fontAwesome = [group: 'org.kordamp.ikonli', name: 'ikonli-fontawesome5-pack', version: v]
materialDesign = [group: 'org.kordamp.ikonli', name: 'ikonli-materialdesign-pack', version: v]
delegate
}
// This is the highest version of RichTextFx which supports JDK 8.
richTextFx = [group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.10.8']
// bootstrapFx = [group: 'org.kordamp.bootstrapfx', name: 'bootstrapfx-core', version: '0.2.2']
diff = [group: 'com.googlecode.java-diff-utils', name: 'diffutils', version: '1.3.0']
completely = [group: 'com.miguelfonseca.completely', name: 'completely-core', version: '0.8.0']
stringSimilarity = [group: 'info.debatty', name: 'java-string-similarity', version: '2.0.0']
koTest = [:].with {
v = '5.5.5'
junit = [group: 'io.kotest', name: 'kotest-runner-junit5', version: v]
assertions = [group: 'io.kotest', name: 'kotest-assertions-core', version: v]
delegate
}
mockK = [group: 'io.mockk', name: 'mockk', version: '1.13.4']
ktor = [:].with {
v = '2.2.4'
serverCore = [group: 'io.ktor', name: 'ktor-server-core', version: v]
serverStatusPages = [group: 'io.ktor', name: 'ktor-server-status-pages', version: v]
serverNetty = [group: 'io.ktor', name: 'ktor-server-netty', version: v]
clientCore = [group: 'io.ktor', name: 'ktor-client-core-jvm', version: v]
clientCio = [group: 'io.ktor', name: 'ktor-client-cio', version: v]
clientSerialization = [group: 'io.ktor', name: 'ktor-serialization-kotlinx-json', version: v]
clientContentNegotiation = [group: 'io.ktor', name: 'ktor-client-content-negotiation', version: v]
// clientJson = [group: 'io.ktor', name: 'ktor-client-json', version: v]
clientLogging = [group: 'io.ktor', name: 'ktor-client-logging-jvm', version: v]
clientJackson = [group: 'io.ktor', name: 'ktor-serialization-jackson', version: v]
delegate
}
wiremock = [group: 'com.github.tomakehurst', name: 'wiremock', version: '2.27.2']
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${ktlin.v}"
classpath "io.github.fvarrui:javapackager:1.7.0"
}
}
plugins {
id 'com.github.hierynomus.license-base' version '0.16.1'
id 'com.github.ben-manes.versions' version '0.46.0'
// This is the highest version of Shadow which supports Gradle 7.
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
// Equivalent to calling --continue from the command line.
// Will run all tests and produce a report of all failed tests at the end.
gradle.startParameter.continueOnFailure = true
apply from: gradleFile('build-metadata.gradle')
apply from: gradleFile('git-version.gradle')
apply from: gradleFile('versions.gradle')
version = gitVersion()
allprojects {
group 'com.gitlab.ykrasik.gamedex'
repositories {
mavenLocal()
mavenCentral()
}
}
subprojects {
apply plugin: 'java-library'
apply plugin: 'java-test-fixtures'
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
sourceCompatibility = 1.8
targetCompatibility = 1.8
if (subprojects.isEmpty()) {
apply from: gradleFile('license.gradle')
apply from: gradleFile('artifacts.gradle')
}
if (!project.hasProperty('isPlugin')) {
version = rootProject.version
}
compileKotlin {
kotlinOptions {
jvmTarget = '1.8'
apiVersion = ktlin.majorV
languageVersion = ktlin.majorV
freeCompilerArgs += [
"-opt-in=kotlinx.coroutines.ObsoleteCoroutinesApi",
"-opt-in=kotlinx.coroutines.DelicateCoroutinesApi",
"-opt-in=kotlin.time.ExperimentalTime",
"-opt-in=kotlinx.coroutines.FlowPreview",
"-Xallow-result-return-type",
"-Xextended-compiler-checks"
]
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = '1.8'
apiVersion = ktlin.majorV
languageVersion = ktlin.majorV
freeCompilerArgs += [
"-opt-in=kotlinx.coroutines.ObsoleteCoroutinesApi",
"-opt-in=kotlinx.coroutines.DelicateCoroutinesApi",
"-opt-in=kotlin.time.ExperimentalTime",
"-opt-in=kotlinx.coroutines.FlowPreview",
"-Xallow-result-return-type",
"-Xextended-compiler-checks"
]
}
}
test {
useJUnitPlatform()
testLogging {
events 'failed'
}
systemProperties System.getProperties() + ['gameDex.env': 'dev']
}
task cleanOut(type: Delete) {
delete new File(project.projectDir, "out")
}
clean.finalizedBy cleanOut
}
project("gamedex-api") {
dependencies {
api ktlin.std
api ktlin.reflect
api coroutines.core
api slf4j.api
api guice
api typesafeConfig
api config4k
api guava
api jodaTime
api ktor.clientCore
implementation ktor.clientCio
implementation ktor.clientSerialization
implementation ktor.clientContentNegotiation
api ktor.clientJackson
api ktor.clientLogging
api jackson.core
implementation jackson.kotlin
implementation jackson.joda
testFixturesApi koTest.junit
testFixturesApi koTest.assertions
testFixturesApi mockK
testFixturesApi coroutines.debug
testFixturesApi coroutines.test
testFixturesApi wiremock
testFixturesApi ktor.serverCore
testFixturesApi ktor.serverStatusPages
testFixturesApi ktor.serverNetty
testFixturesApi logback
}
publishing {
publications {
main(MavenPublication) {
from components.java
artifact sourcesJar
}
}
}
}
project("app:gamedex-app-api") {
dependencies {
fullDependency ":gamedex-api"
api diff
}
}
project("core:gamedex-core-common") {
task createVersionJsonFile() {
def destFile = new File(generatedResources, "version.json")
outputs.dir(generatedResources)
outputs.file(destFile)
inputs.properties([
version : version,
commitHash: commitHash,
commitDate: commitDate
])
doLast {
println("Generating $destFile")
destFile.write(JsonOutput.prettyPrint(JsonOutput.toJson([
version : version,
buildDate : buildDate,
commitHash: commitHash,
commitDate: commitDate
])))
}
}
compileKotlin.dependsOn createVersionJsonFile
licenseFormatMain.dependsOn createVersionJsonFile
licenseMain.dependsOn createVersionJsonFile
processResources.dependsOn(licenseFormatMain, licenseMain)
dependencies {
fullDependency ":app:gamedex-app-api"
api jackson.kotlin
api jackson.joda
}
}
project("core:gamedex-core-file") {
dependencies {
fullDependency ":core:gamedex-core-common"
}
}
project("core:gamedex-core-game") {
dependencies {
fullDependency ":core:gamedex-core-common"
implementation project(":core:gamedex-core-persistence")
implementation completely
}
}
project("core:gamedex-core-maintenance") {
dependencies {
fullDependency ":core:gamedex-core-common"
implementation project(":core:gamedex-core-persistence")
implementation stringSimilarity
}
}
project("core:gamedex-core-image") {
dependencies {
fullDependency ":core:gamedex-core-common"
}
}
project("core:gamedex-core-library") {
dependencies {
fullDependency ":core:gamedex-core-common"
implementation project(":core:gamedex-core-persistence")
}
}
project("core:gamedex-core-log") {
dependencies {
fullDependency ":core:gamedex-core-common"
implementation logback
implementation slf4j.julBridge
}
}
project("core:gamedex-core-persistence") {
dependencies {
fullDependency ":gamedex-api"
implementation h2
implementation exposed.core
implementation exposed.dao
implementation exposed.jdbc
implementation exposed.jodaTime
}
}
project("core:gamedex-core-provider") {
dependencies {
fullDependency ":core:gamedex-core-common"
}
}
project("core:gamedex-core-filter") {
dependencies {
fullDependency ":core:gamedex-core-common"
}
}
project("core:gamedex-core") {
dependencies {
fullDependency ":core:gamedex-core-common"
implementation project(":core:gamedex-core-file")
implementation project(":core:gamedex-core-image")
implementation project(":core:gamedex-core-game")
implementation project(":core:gamedex-core-maintenance")
implementation project(":core:gamedex-core-library")
implementation project(":core:gamedex-core-log")
implementation project(":core:gamedex-core-persistence")
implementation project(":core:gamedex-core-provider")
implementation project(":core:gamedex-core-filter")
implementation classGraph
}
}
project("app:javafx:ikonli-material-design-pack") {
dependencies {
implementation ktlin.std
implementation coroutines.core
api ikonli.javaFx
}
}
project("app:javafx:gamedex-javafx-common") {
dependencies {
fullDependency ":app:gamedex-app-api"
api project(":app:javafx:ikonli-material-design-pack")
api tornadoFx
api jFoenix
api controlsFx
api richTextFx
api coroutines.javaFx
}
}
project("app:javafx:gamedex-javafx-view") {
dependencies {
fullDependency ":app:javafx:gamedex-javafx-common"
}
}
def gradleFile(String fileName) { file("gradle/$fileName") }
def pluginProjects() { rootProject.allprojects.findAll { it.hasProperty('isPlugin') } }