-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
113 lines (95 loc) · 2.25 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
plugins {
id 'java'
id 'checkstyle'
id 'jacoco'
id 'com.github.spotbugs' version "6.0.0-beta.3"
id "org.owasp.dependencycheck" version "8.4.0"
}
group = 'per.duyd.training'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
flatDir {
dirs 'libs' // For local JARs in a 'libs' directory
}
}
java {
sourceCompatibility = '17'
targetCompatibility = '17'
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
checkstyle {
toolVersion = '10.12.3'
}
jacoco {
toolVersion = "0.8.9"
}
spotbugs {
toolVersion = '4.7.3'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) // For local JARs
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
test {
useJUnitPlatform()
}
build {
finalizedBy(jacocoTestReport)
}
def excludeCoverage = [
"per/duyd/training/dsaa/collinearpoints/LineSegment**",
"per/duyd/training/dsaa/collinearpoints/Point**",
"per/duyd/training/dsaa/boggle/BoggleBoard**"
]
jacocoTestReport {
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: excludeCoverage)
}))
}
// finalizedBy(jacocoTestCoverageVerification)
}
jacocoTestCoverageVerification {
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: excludeCoverage)
}))
}
violationRules {
rule {
limit {
counter = "INSTRUCTION"
value = "COVEREDRATIO"
minimum = 0.95
}
}
rule {
limit {
counter = "BRANCH"
value = "COVEREDRATIO"
minimum = 0.95
}
}
}
}
spotbugs {
excludeFilter = file("$projectDir/config/spotbugs/excludeFilter.xml")
spotbugsTest {
enabled = false
}
spotbugsMain {
reports {
html {
required = true
outputLocation = file("$buildDir/reports/spotbugs/main/spotbugs.html")
stylesheet = 'fancy-hist.xsl'
}
}
}
}