This repository has been archived by the owner on Feb 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.gradle
100 lines (91 loc) · 2.7 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
plugins {
id "com.diffplug.spotless" version "5.12.4"
}
apply from: file("${rootDir}/build-resources.gradle")
allprojects {
apply plugin: 'com.diffplug.spotless'
group = 'com.amazon'
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
spotless {
format 'markdown', {
target '*.md'
// TODO: enrich format rules
endWithNewline()
}
format 'misc', {
target '.gitignore', '*.yml', '*.yaml'
// TODO: enrich format rules
trimTrailingWhitespace()
endWithNewline()
}
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
sourceCompatibility = '1.8'
spotless {
java {
// TODO: enrich format rules
removeUnusedImports()
}
}
dependencies {
implementation "com.google.guava:guava:31.0.1-jre"
implementation "org.apache.logging.log4j:log4j-core:2.14.1"
implementation "org.slf4j:slf4j-api:1.7.30"
implementation "org.apache.logging.log4j:log4j-slf4j-impl:2.14.1"
testImplementation("junit:junit:4.13") {
exclude group: 'org.hamcrest' // workaround for jarHell
}
constraints {
implementation('org.apache.httpcomponents:httpclient') {
version {
require '4.5.13'
}
because 'We want the newest version of httpclient.'
}
}
}
configurations.all {
resolutionStrategy.eachDependency { def details ->
if (details.requested.group == 'io.netty' && !details.requested.name.startsWith('netty-tcnative')) {
details.useVersion '4.1.61.Final'
details.because 'includes CVE fix'
}
}
}
build.dependsOn test
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
}
task allDeps(type: DependencyReportTask) {}
}
configure(coreProjects) {
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.enabled false
csv.enabled false
html.destination file("${buildDir}/reports/jacocoHtml")
}
}
test {
useJUnit()
finalizedBy jacocoTestReport // report is always generated after tests run
}
jacocoTestCoverageVerification {
dependsOn jacocoTestReport
violationRules {
rule {
limit {
minimum = 0.65 //TODO increase this to 0.75
}
}
}
}
check.dependsOn jacocoTestCoverageVerification
}