-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
148 lines (125 loc) · 4.54 KB
/
build.gradle
File metadata and controls
148 lines (125 loc) · 4.54 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
plugins {
id 'java'
id 'checkstyle'
id 'pmd'
id 'jacoco'
id 'com.github.johnrengelman.shadow' version '5.2.0'
id "org.owasp.dependencycheck" version "7.3.0"
}
group 'no.unit'
version '1.0-SNAPSHOT'
sourceCompatibility = JavaVersion.VERSION_17 // source-code version and must be <= targetCompatibility
targetCompatibility = JavaVersion.VERSION_17 // bytecode target version
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
gradleVersion = "7.3.1"
}
project.ext {
jaxbTargetDir = file("src/main/java")
}
configurations {
xsd2java
}
dependencies {
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.14'
implementation group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.1.1'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.14.0'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '4.0.3'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.14.2'
implementation group: 'com.github.bibsysdev', name: 'core', version: '1.36.7'
implementation group: 'com.github.bibsysdev', name: 'apigateway', version: '1.36.7'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.20.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.20.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j18-impl', version: '2.18.0'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.3'
implementation group: 'com.amazonaws', name: 'aws-lambda-java-log4j2', version: '1.5.1'
testImplementation group: 'com.github.bibsysdev', name: 'nvatestutils', version: '1.36.7'
testImplementation group: 'com.github.bibsysdev', name: 'logutils', version: '1.36.7'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.3.1'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.9.1'
xsd2java group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: '4.0.1'
xsd2java group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '4.0.1'
xsd2java group: 'javax.xml.bind', name: 'jaxb-api', version: '2.4.0-b180830.0359'
xsd2java group: 'javax.activation', name:'javax.activation-api', version: '1.2.0'
shadowJar {
archiveClassifier.set('')
zip64 true
}
}
task xsd2java() {
doLast {
jaxbTargetDir.mkdirs()
ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask', classpath: configurations.xsd2java.asPath)
ant.jaxbTargetDir = jaxbTargetDir
ant.xjc(
destdir: '${jaxbTargetDir}',
package: 'no.nb.basebibliotek.generated',
schema: 'src/main/xsd/basebibliotek.xsd'
)
}
}
compileJava.dependsOn xsd2java
test {
useJUnitPlatform()
failFast = true
finalizedBy jacocoTestReport
}
// We don't want a jar, just a fatJar
jar.enabled = false
project.tasks.build.dependsOn project.tasks.shadowJar
pmd {
ruleSetConfig = rootProject.resources.text.fromFile('config/pmd/ruleset.xml')
ruleSets = []
ignoreFailures = false
}
checkstyle {
configFile = rootProject.resources.text.fromFile('config/checkstyle/checkstyle.xml').asFile()
showViolations = true
}
tasks.withType(Checkstyle) {
exclude { 'no/nb/basebibliotek/generated/*' }
reports {
xml.enabled false
html.enabled true
html.stylesheet rootProject.resources.text.fromFile('config/checkstyle/checkstyle-simple.xsl')
}
}
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination file("${buildDir}/reports/jacoco")
}
}
check.dependsOn jacocoTestCoverageVerification
jacocoTestCoverageVerification.dependsOn(jacocoTestReport)
jacocoTestCoverageVerification {
afterEvaluate {
getClassDirectories().setFrom(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'no/nb/basebibliotek/generated/*'
])
})
}
violationRules {
rule {
limit {
counter = 'METHOD'
value = 'COVEREDRATIO'
minimum = 0.90
}
}
rule {
limit {
counter = 'CLASS'
value = 'COVEREDRATIO'
minimum = 1.00
}
}
}
}