-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
88 lines (76 loc) · 1.64 KB
/
build.gradle
File metadata and controls
88 lines (76 loc) · 1.64 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
// =====================
// Plugins
// =====================
plugins {
id 'java'
id 'jacoco'
id 'com.github.hierynomus.license' version '0.16.1'
id 'com.diffplug.spotless' version '6.25.0'
}
// =====================
// Project Metadata
// =====================
group = 'org.dcp'
version = '1.0'
sourceCompatibility = 1.8
// =====================
// Repositories
// =====================
repositories {
mavenCentral()
}
// =====================
// Dependencies
// =====================
dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.12'
}
// =====================
// Formatting & License
// =====================
spotless {
java {
googleJavaFormat('1.17.0')
}
}
license {
def headerFile = rootProject.file('code/License.tmpl')
header headerFile
strictCheck false
}
tasks.register('format') {
group = 'Formatting'
description = 'Formats source code and adds license headers.'
dependsOn 'licenseFormat', 'spotlessApply'
}
tasks.register('lint') {
group = 'Linting'
description = 'Runs spotless check and license check.'
dependsOn 'license', 'spotlessCheck'
}
// =====================
// Build & Compile
// =====================
tasks.named('compileJava') {
dependsOn 'format'
}
tasks.named('compileTestJava') {
dependsOn 'format'
}
// =====================
// Testing & Coverage
// =====================
jacoco {
toolVersion = "0.8.13"
}
test {
finalizedBy jacocoTestReport // Generate report after tests
}
jacocoTestReport {
dependsOn test
reports {
html.required = true
xml.required = true
csv.required = false
}
}