-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
605 lines (478 loc) · 22.4 KB
/
build.gradle.kts
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
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
// Run with --info or --debug option to get more log output.
// https://docs.gradle.org/current/userguide/logging.html
// Gradle DSL plugins
// https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_block
// https://plugins.gradle.org/
plugins {
val kotlinVersion = "1.4.10"
// Kotlin JVM plugin
// https://kotlinlang.org/docs/reference/using-gradle.html
kotlin("jvm") version kotlinVersion
// Kotlin Spring compiler plugin to make classes open by default (wraps the all-open plugin)
// https://kotlinlang.org/docs/reference/compiler-plugins.html
kotlin("plugin.spring") version kotlinVersion
// Kotlin JPA compiler plugin to generate zero-argument constructors (wraps the no-arg plugin)
// https://kotlinlang.org/docs/reference/compiler-plugins.html
kotlin("plugin.jpa") version kotlinVersion
// Kapt: Kotlin annotation processor
// https://kotlinlang.org/docs/reference/kapt.html
kotlin("kapt") version kotlinVersion
// Java plugin
// https://docs.gradle.org/current/userguide/java_plugin.html
java
// Idea plugin
// https://docs.gradle.org/current/userguide/idea_plugin.html
idea
// JaCoCo plugin for test coverage
// https://docs.gradle.org/current/userguide/jacoco_plugin.html
jacoco
// Dokka: Kotlin documentation engine
// https://github.com/Kotlin/dokka
// https://kotlinlang.org/docs/reference/kotlin-doc.html
id("org.jetbrains.dokka") version "1.4.0"
// Spring Boot plugin to run and package the application
// https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/html/
id("org.springframework.boot") version "2.3.3.RELEASE"
// gradle-git-properties plugin to generate git.properties (generateGitProperties task)
// https://docs.spring.io/spring-boot/docs/current/reference/html/howto-build.html#howto-git-info
// https://github.com/n0mer/gradle-git-properties
id("com.gorylenko.gradle-git-properties") version "2.2.0"
// grgit plugin to obtain version from git
// http://ajoberstar.org/grgit/index.html
// https://github.com/ajoberstar/grgit
id("org.ajoberstar.grgit") version "4.0.1"
// gradle-docker-compose plugin to run docker-compose with Gradle
// https://github.com/avast/gradle-docker-compose-plugin
id("com.avast.gradle.docker-compose") version "0.13.4"
// gradle-versions-plugin to check for dependency updates (./gradlew dependencyUpdates -Drevision=release)
// https://github.com/ben-manes/gradle-versions-plugin
id("com.github.ben-manes.versions") version "0.27.0"
// OWASP Dependency Check gradle plugin
// https://github.com/jeremylong/dependency-check-gradle
id("org.owasp.dependencycheck") version "5.3.0"
// Liquibase plugin to run Liquibase tasks
// https://github.com/liquibase/liquibase-gradle-plugin
id("org.liquibase.gradle") version "2.0.4"
// Asciidoctor plugin
// https://asciidoctor.org/docs/asciidoctor-gradle-plugin/
// https://github.com/asciidoctor/asciidoctor-gradle-plugin
id("org.asciidoctor.jvm.convert") version "2.3.0"
}
// Apply the Spring dependency management plugin
// https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/html/#managing-dependencies
// https://github.com/spring-gradle-plugins/dependency-management-plugin
apply(plugin = "io.spring.dependency-management")
repositories {
// Maven Central repository
// https://central.sonatype.org/
mavenCentral()
// Local Maven repository (only used for testing locally published libraries; default location: USER_HOME/.m2/repository)
// https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:maven_local
//mavenLocal()
}
// Dependencies
// https://docs.gradle.org/current/userguide/java_plugin.html#tab:configurations
dependencies {
// Kotlin standard library
// https://kotlinlang.org/api/latest/jvm/stdlib/
implementation(kotlin("stdlib-jdk8"))
// Kotlin reflection
// https://kotlinlang.org/docs/reference/reflection.html
implementation(kotlin("reflect"))
// Kotlin logging library for easy logger declaration
// https://github.com/MicroUtils/kotlin-logging
implementation("io.github.microutils:kotlin-logging:1.7.8")
// Spring Boot starter dependencies
// https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-gradle
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-aop")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-data-rest")
implementation("org.springframework.boot:spring-boot-starter-json")
implementation("org.springframework.boot:spring-boot-starter-mail")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-web")
// Spring Security Spring Data integration (SecurityEvaluationContextExtension)
// https://docs.spring.io/spring-security/site/docs/current/reference/html5/#data
implementation("org.springframework.security:spring-security-data")
// HAL Browser
// https://docs.spring.io/spring-data/rest/docs/current/reference/html/#_the_hal_browser
implementation("org.springframework.data:spring-data-rest-hal-browser")
// Aspect-oriented profiling
// https://github.com/rechnerherz/aoprofiling-spring-boot-starter
implementation("at.rechnerherz:aoprofiling-spring-boot-starter:1.0.0")
// JSR-354/JavaMoney/Moneta money and currency implementation
// http://javamoney.github.io/api.html
// http://javamoney.github.io/ri.html
implementation("org.javamoney:moneta:1.3")
// Jadira Hibernate UserTypes for money and currency
// http://jadira.sourceforge.net/usertype-userguide.html
implementation("org.jadira.usertype:usertype.core:7.0.0.CR1")
// Hibernate Types for JSON column mappings
// https://github.com/vladmihalcea/hibernate-types
implementation("com.vladmihalcea:hibernate-types-52:2.9.2")
// Liquibase for database migrations
// http://www.liquibase.org/
// https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto-execute-liquibase-database-migrations-on-startup
implementation("org.liquibase:liquibase-core:3.10.2")
// Jackson module to serialize/deserialize Kotlin classes
// https://github.com/FasterXML/jackson-module-kotlin
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
// Jackson module to serialize/deserialize Hibernate specific data types and lazy-loaded relations
// https://github.com/FasterXML/jackson-datatype-hibernate
implementation("com.fasterxml.jackson.datatype:jackson-datatype-hibernate5")
// Jackson module to serialize/deserialize of JavaMoney classes
// https://github.com/zalando/jackson-datatype-money
implementation("org.zalando:jackson-datatype-money:1.1.1")
// Jackson data format module for reading and writing CSV
// https://github.com/FasterXML/jackson-dataformats-text
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-csv")
// Jackson data format module for reading and writing XML
// https://github.com/FasterXML/jackson-dataformat-xml
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml")
// Problem-Spring-Web library to handle errors with application/problem+json
// https://github.com/zalando/problem-spring-web
implementation("org.zalando:problem-spring-web:0.25.2")
// Google Guava
// https://github.com/google/guava
implementation("com.google.guava:guava:28.2-jre")
// Janino for Logback conditionals
// https://logback.qos.ch/setup.html#janino
implementation("org.codehaus.janino:janino")
// Slack webhook
// https://github.com/gpedro/slack-webhook
implementation("net.gpedro.integrations.slack:slack-webhook:1.4.0")
// Jsoup HTML parser/cleaner
// https://github.com/jhy/jsoup/
implementation("org.jsoup:jsoup:1.12.1")
// Thumbnailator for image resizing
// https://github.com/coobird/thumbnailator
implementation("net.coobird:thumbnailator:0.4.8")
// Java Faker to generate test data
// https://github.com/DiUS/java-faker
implementation("com.github.javafaker:javafaker:1.0.1")
// Slugify to generate slugs
// https://github.com/slugify/slugify
implementation("com.github.slugify:slugify:2.4")
// JavaMelody Spring Boot starter
// https://github.com/javamelody/javamelody/wiki/SpringBootStarter
implementation("net.bull.javamelody:javamelody-spring-boot-starter:1.85.0")
// Flying Saucer HTML renderer (using OpenPDF)
// https://github.com/flyingsaucerproject/flyingsaucer
implementation("org.xhtmlrenderer:flying-saucer-pdf-openpdf:9.1.16")
// TwelveMonkeys ImageIO extensions
// https://github.com/haraldk/TwelveMonkeys
implementation("com.twelvemonkeys.servlet:servlet:3.5")
implementation("com.twelvemonkeys.imageio:imageio-jpeg:3.5")
// Spring Cloud AWS
// https://cloud.spring.io/spring-cloud-aws/spring-cloud-aws.html
implementation("org.springframework.cloud:spring-cloud-aws-context:2.2.1.RELEASE")
// AWS SDK
// https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/setup-project-gradle.html
implementation(platform("software.amazon.awssdk:bom:2.5.29"))
implementation("software.amazon.awssdk:ses")
// --- Annotation processors ---
// Spring Annotation Processor
// https://docs.spring.io/spring-boot/docs/current/reference/html/configuration-metadata.html#configuration-metadata-annotation-processor
kapt("org.springframework.boot:spring-boot-configuration-processor")
// --- Runtime dependencies ---
// MariaDB connector
// https://github.com/MariaDB/mariadb-connector-j
runtimeOnly("org.mariadb.jdbc:mariadb-java-client")
// Liquibase
liquibaseRuntime("org.liquibase:liquibase-core:3.10.2")
liquibaseRuntime("org.mariadb.jdbc:mariadb-java-client")
liquibaseRuntime("ch.qos.logback:logback-classic")
// --- Development dependencies ---
// Spring Boot Devtools
// https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-devtools.html
developmentOnly("org.springframework.boot:spring-boot-devtools")
// --- Test dependencies ---
// Spring Boot test starter
// https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-testing.html
// https://spring.io/guides/tutorials/spring-boot-kotlin/#_testing_with_junit_5
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
}
// JUnit 5 (Jupiter)
// https://junit.org/junit5/
testImplementation("org.junit.jupiter:junit-jupiter-api")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
// JUnit 5 Parameterized Tests
// https://junit.org/junit5/docs/current/user-guide/#writing-tests-parameterized-tests-setup
testImplementation("org.junit.jupiter:junit-jupiter-params")
// Spring Security testing support
// https://docs.spring.io/spring-security/site/docs/current/reference/html5/#test
testImplementation("org.springframework.security:spring-security-test")
// Kluent assertion library
// https://github.com/MarkusAmshove/Kluent
testImplementation("org.amshove.kluent:kluent:1.59")
// Apache HttpComponents HttpClient for TestRestTemplate tests over HTTPS
// https://hc.apache.org/httpcomponents-client-ga/
testImplementation("org.apache.httpcomponents:httpclient:4.5.11")
}
// --- Build ---
// Always download Gradle sources and documentation (distribution type all)
// https://docs.gradle.org/current/userguide/gradle_wrapper.html#customizing_wrapper
tasks.named<Wrapper>("wrapper") {
distributionType = Wrapper.DistributionType.ALL
}
fun gitDescribe(): String {
// Set currentDir to project.rootDir to locate .git directory
// https://github.com/ajoberstar/grgit/issues/269
val git = org.ajoberstar.grgit.Grgit.open(mapOf("currentDir" to project.rootDir))
val describe = org.ajoberstar.grgit.operation.DescribeOp(git.repository).apply {
always = true
tags = true
}.call()
val status = org.ajoberstar.grgit.operation.StatusOp(git.repository).call()
return describe + (if (status.isClean) "" else ".dirty")
}
// Set group identifier
group = "at.rechnerherz"
// Set the project version with grgit (unless exit-after-startup is set)
version = if (System.getProperties()["at.rechnerherz.example.base.exit-after-startup"] == "true") "" else gitDescribe()
// Generate build-info.properties metadata (bootBuildInfo task)
// https://docs.spring.io/spring-boot/docs/current/reference/html/howto-build.html#howto-build-info
// https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/html/#integrating-with-actuator-build-info
springBoot {
buildInfo()
}
// --- Compile Java ---
java {
// Java source/target compatibility
// https://docs.gradle.org/current/userguide/java_plugin.html#other_convention_properties
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType<JavaCompile> {
// Enable unchecked call/conversion warnings and deprecation warnings
// https://docs.oracle.com/javase/tutorial/java/generics/rawTypes.html
// https://docs.oracle.com/javase/10/core/enhanced-deprecation1.htm
// Note: -parameters is enabled by default by Spring Boot
options.compilerArgs.addAll(listOf("-Xlint:unchecked", "-Xlint:deprecation"))
}
// --- Compile Kotlin ---
allOpen {
// Make classes annotated with @Entity, @MappedSuperclass, and @Embeddable open by default
annotation("javax.persistence.Entity")
annotation("javax.persistence.MappedSuperclass")
annotation("javax.persistence.Embeddable")
}
kapt {
// Show correct error types instead of NonExistingClass when processing annotations with kapt
// https://kotlinlang.org/docs/reference/kapt.html#non-existent-type-correction
correctErrorTypes = true
}
tasks.compileKotlin {
// Run compileKotlin task to generate configuration metadata
// Must depend on processResources to pick up additional metadata files
// https://docs.spring.io/spring-boot/docs/current/reference/html/configuration-metadata.html#configuration-metadata-annotation-processor
dependsOn(tasks.processResources)
// Move the generated metadata file to src/main/resources/META-INF
doLast {
file("src/main/resources/META-INF").mkdirs()
file("build/tmp/kapt3/classes/main/META-INF/spring-configuration-metadata.json")
.renameTo(file("src/main/resources/META-INF/spring-configuration-metadata.json"))
}
}
// Set options for all Kotlin compilation tasks
// https://kotlinlang.org/docs/reference/using-gradle.html
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
// Enable strict null-safety for JSR-305 annotations
// https://blog.jetbrains.com/kotlin/2017/09/kotlin-1-1-50-is-out/
freeCompilerArgs = listOf("-Xjsr305=strict")
// Set target version for generate JVM bytecode
jvmTarget = "11"
// Generate metadata for Java reflection on method parameters
javaParameters = true
}
}
// --- Run ---
// Configure docker-compose tasks
dockerCompose {
// Create localComposeUp task to start local dependencies
createNested("local").apply {
projectName = "example-local"
useComposeFiles = listOf("./docker/local/docker-compose.yml")
// Don't stop containers, try to reconnect instead
stopContainers = false
// Start before running bootRun
isRequiredBy(tasks.bootRun.get())
}
// Create testingComposeUp task to start testing dependencies
createNested("testing").apply {
projectName = "example-testing"
useComposeFiles = listOf("./docker/testing/docker-compose.yml")
// Don't stop containers, try to reconnect instead
stopContainers = false
// Start before running test
isRequiredBy(tasks.test.get())
}
}
// Create a task to drop and re-create DB schemas (just the schemas, not the tables)
tasks.register<Exec>("dropCreateSchemas") {
commandLine(
"mysql",
"--protocol=TCP",
"--user=root",
"--password=root",
"--database=information_schema",
"--execute=;DROP SCHEMA IF EXISTS `example`;CREATE SCHEMA `example`;"
)
}
fun runProperties(systemProperties: MutableMap<String, Any>) {
// Pass properties from command line to bootRun task
// https://stackoverflow.com/questions/25079244/how-to-pass-jvm-options-from-bootrun
System.getProperties()
// Don't set "endorsed dirs", unsupported since JDK9
// https://docs.oracle.com/javase/9/migrate/#GUID-D867DCCC-CEB5-4AFA-9D11-9C62B7A3FAB1
.filter { it.key != "java.endorsed.dirs" }
.forEach { (key, value) -> systemProperties[key.toString()] = value }
// Completely disable the Spring Boot RestartClassLoader
// https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-devtools-restart-disable
systemProperties["spring.devtools.restart.enabled"] = "false"
// Enable flying-saucer logging over SLF4J bridge
// https://flyingsaucerproject.github.io/flyingsaucer/r8/guide/users-guide-R8.html#xil_49
// https://stackoverflow.com/questions/9729147/turning-on-flying-saucer-java-util-logging-output
systemProperties["xr.util-logging.loggingEnabled"] = "true"
systemProperties["xr.util-logging.handlers"] = "org.slf4j.bridge.SLF4JBridgeHandler"
// Disable the Hypersistence Optimizer banner
// https://github.com/vladmihalcea/hibernate-types
systemProperties["hibernate.types.print.banner"] = "false"
}
tasks.bootRun {
runProperties(systemProperties)
val jvmArguments = mutableListOf<String>()
// Listen to remote debugging on port 5005 if remote-debug is set to true
// https://docs.oracle.com/javase/8/docs/technotes/guides/jpda/conninv.html#Invocation
if (systemProperties["remote-debug"] == "true")
jvmArguments.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005")
// Uncomment to limit JVM memory to 1GB to debug memory issues
//jvmArguments.add("-Xmx1024m")
jvmArgs = jvmArguments
}
val liquibaseUsername: String by project
val liquibasePassword: String by project
val liquibaseUrl: String by project
val liquibaseChangeLogFile: String by project
val liquibaseDiffUrl: String by project
val liquibaseDiffChangeLogFile: String by project
// Liquibase plugin configuration
liquibase {
// main properties for tasks like "status" and "update"
activities.register("main") {
arguments = mapOf(
"changeLogFile" to liquibaseChangeLogFile,
"url" to liquibaseUrl,
"username" to liquibaseUsername,
"password" to liquibasePassword,
"logLevel" to "info"
)
}
// diff properties for tasks like "diff" and "diffChangeLog"
activities.register("diff") {
arguments = mapOf(
"changeLogFile" to liquibaseDiffChangeLogFile,
"url" to liquibaseDiffUrl,
"username" to liquibaseUsername,
"password" to liquibasePassword,
"referenceUrl" to liquibaseUrl,
"referenceUsername" to liquibaseUsername,
"referencePassword" to liquibasePassword
)
}
// default properties
runList = "main"
}
tasks.diffChangeLog {
doFirst {
// Use diff properties
liquibase.runList = "diff"
// Delete old Liquibase diff instead of appending to it
file(liquibaseDiffChangeLogFile).delete()
}
// After creating diff, replace VARCHAR(255 BYTE) with VARCHAR(255)
// Workaround for https://liquibase.jira.com/browse/CORE-2930
doLast {
file(liquibaseDiffChangeLogFile).apply {
if (exists())
writeText(
readText()
.replace("""VARCHAR\(([0-9]+) BYTE\)""".toRegex(), """VARCHAR($1)""")
)
}
}
}
// --- Package ---
// Create a fully executable jar
// https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html#deployment-install
tasks.bootJar {
launchScript()
}
// --- Test ---
tasks.test {
runProperties(systemProperties)
// Use JUnit5 when running tests with Gradle
// https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html
useJUnitPlatform()
}
// Add a task to run only unit tests
tasks.register<Test>("unitTest") {
useJUnitPlatform {
includeTags("unit")
}
}
// Add a task to run only integration tests
tasks.register<Test>("integrationTest") {
useJUnitPlatform {
includeTags("integration")
}
}
tasks.withType<Test> {
// Log test result events
testLogging {
events("PASSED", "FAILED", "SKIPPED")
}
// Print a test summary
addTestListener(object : TestListener {
override fun beforeTest(desc: TestDescriptor) {}
override fun beforeSuite(desc: TestDescriptor) {}
override fun afterTest(desc: TestDescriptor, result: TestResult) {}
override fun afterSuite(desc: TestDescriptor, result: TestResult) {
if (desc.parent != null) {
println(
"""
|Test result: ${result.resultType}
|Test summary:
|${result.testCount} tests
|${result.successfulTestCount} succeeded
|${result.failedTestCount} failed
|${result.skippedTestCount} skipped""".trimMargin()
)
}
}
})
}
jacoco {
toolVersion = "0.8.2"
}
tasks.jacocoTestReport {
reports.html.destination = file("$buildDir/reports/jacoco")
}
// --- Documentation ---
asciidoctorj {
// Don't show project version number on generated documentation
attributes(mapOf("revnumber" to ""))
// Set Diagram Version
// https://github.com/asciidoctor/asciidoctor-gradle-plugin#using-asciidoctorj-diagram
modules.diagram.setVersion("1.5.4.1")
}
tasks.asciidoctor {
// Set documentation source location
// https://github.com/asciidoctor/asciidoctor-gradle-plugin#the-new-asciidoctorj-plugin
setSourceDir(file("doc"))
}