-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
100 lines (84 loc) · 2.94 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
subprojects {
/*
Applies core Gradle plugins, which are ones built into Gradle itself.
*/
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
apply plugin: 'java'
// JaCoCo for coverage metrics and reports of Java source files. Read more at:
// https://docs.gradle.org/current/userguide/jacoco_plugin.html
apply plugin: 'jacoco'
// Checkstyle for style checks and reports on Java source files. Read more at:
// https://docs.gradle.org/current/userguide/checkstyle_plugin.html
apply plugin: 'checkstyle'
// Shared C3R version
ext.c3r_version = rootProject.file('version.txt').text.trim()
// Shared dependency versions
ext.freefair_version = '8.11'
ext.junit_version = '5.11.3'
ext.log4j_version = '2.24.1'
ext.mockito_version = '5.2.0'
ext.spark_version = '3.5.0'
ext.spotbugs_version = '5.1.4'
dependencies {
// Logging
implementation "org.apache.logging.log4j:log4j-api:$log4j_version"
implementation "org.apache.logging.log4j:log4j-core:$log4j_version"
implementation "org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version"
// Test infrastructure
testImplementation "org.junit.jupiter:junit-jupiter:$junit_version"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version"
// Test mocking
testImplementation "org.mockito:mockito-core:$mockito_version"
testImplementation "org.mockito:mockito-inline:$mockito_version"
}
check.dependsOn jacocoTestCoverageVerification
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.85
}
}
}
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
csv.required = true
html.required = true
}
}
/*
Configures the Checkstyle "checkstyle" plugin. Remove this and the plugin if
you want to skip these checks and report generation.
*/
checkstyle {
sourceSets = [sourceSets.main, sourceSets.test]
configFile = file('../config/checkstyle/checkstyle.xml')
configProperties.put('checkstyle.suppression.filter', '../config/checkstyle/suppressions.xml')
configDirectory.set(file('../config/checkstyle'))
ignoreFailures = false
}
tasks.withType(JavaCompile).configureEach {
options.release = 11
}
tasks.withType(Javadoc).configureEach {
options.addBooleanOption("Xdoclint:-missing", true)
}
jar {
manifest {
attributes('Multi-Release': true)
}
}
}