/
build.gradle
111 lines (83 loc) · 2.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
plugins {
id "java-library"
id "base-information"
id "checkstyle"
id "jacoco"
id "maven-publish"
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
id "publishing-config"
id "signing-config"
id "release-process"
}
dependencies {
implementation libs.jandex
implementation libs.logging
compileOnly libs.loggingAnnotations
annotationProcessor libs.loggingProcessor
annotationProcessor libs.logging
annotationProcessor libs.loggingAnnotations
testImplementation jakartaLibs.jpa
testImplementation testLibs.junit5Api
testImplementation testLibs.assertjCore
testRuntimeOnly testLibs.junit5Engine
testRuntimeOnly testLibs.log4j
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Java handling
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
java {
sourceCompatibility = jdks.versions.baseline.get() as int
targetCompatibility = jdks.versions.baseline.get() as int
withJavadocJar()
withSourcesJar()
}
test {
useJUnitPlatform()
}
// create a single "compile" task
tasks.register( "compile" ).configure {
dependsOn tasks.withType( JavaCompile )
}
tasks.withType( JavaCompile ).configureEach {javaCompile->
options.encoding = "UTF-8"
options.warnings false
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Javadoc
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tasks.named( "javadoc", Javadoc ) {
configure( options ) {
use = true
encoding = "UTF-8"
addStringOption( "Xdoclint:none", "-quiet" )
tags(
"todo:X",
"apiNote:a:API Note:",
"implSpec:a:Implementation Specification:",
"implNote:a:Implementation Note:"
)
}
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Checkstyle
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
checkstyle {
sourceSets = [ project.sourceSets.main ]
showViolations = false
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// JaCoCo
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def jacocoReportTask = tasks.named( "jacocoTestReport" ) {
dependsOn tasks.named( "test" )
}
jacocoTestReport {
reports {
xml.required = false
csv.required = false
html.outputLocation = layout.buildDirectory.dir( "jacocoHtml" )
}
}
tasks.named( "check" ) {
dependsOn jacocoReportTask
}