This repository was archived by the owner on Mar 20, 2025. It is now read-only.
forked from hmcts/java-logging
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
129 lines (111 loc) · 3.71 KB
/
build.gradle
File metadata and controls
129 lines (111 loc) · 3.71 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
plugins {
id 'org.owasp.dependencycheck' version '8.2.1'
}
allprojects {
group 'app.quickcase.logging'
version '7.0.0'
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
apply plugin: 'pmd'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
checkstyle {
toolVersion = '8.39'
maxWarnings = 0
getConfigDirectory().set(new File(rootDir, "config/checkstyle"))
}
pmd {
toolVersion = "6.42.0"
ignoreFailures = true
incrementalAnalysis = true
sourceSets = [sourceSets.main, sourceSets.test]
reportsDir = file("$rootProject.buildDir/reports/pmd/$project.name")
ruleSetFiles = files("$rootProject.projectDir/config/pmd/ruleset.xml")
}
jacoco {
toolVersion = "0.8.10"
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation group: 'net.logstash.logback', name: 'logstash-logback-encoder', version: '7.4'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.7'
implementation group: 'org.slf4j', name: 'jul-to-slf4j', version: '2.0.7'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.7'
implementation group: 'ch.qos.logback.contrib', name: 'logback-jackson', version: '0.1.5'
implementation group: 'ch.qos.logback.contrib', name: 'logback-json-classic', version: '0.1.5'
api group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: '6.0.0'
testImplementation group: 'junit', name: 'junit', version: '4.13.1'
}
dependencyCheck {
// Specifies if the build should be failed if a CVSS score above a specified level is identified.
// range of 0-10 fails the build, anything greater and it doesn't fail the build
failBuildOnCVSS = 0
suppressionFile = "$rootDir/config/owasp/suppressions.xml"
analyzers {
// Disable scanning of .NET related binaries
assemblyEnabled = false
}
skipConfigurations = [
"checkstyle",
"jacocoAgent",
"jacocoAnt",
"pmd",
]
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
url.set("https://github.com/quickcase/spring-logging.git")
}
}
}
repositories {
maven {
name = "Github"
url = uri("https://maven.pkg.github.com/quickcase/spring-logging")
credentials {
username = System.getenv("GH_USERNAME")
password = System.getenv("GH_TOKEN")
}
}
}
}
}
task codeCoverageReport(type: JacocoReport, dependsOn: allprojects*.test) {
// Gather execution data from all subprojects
// (change this if you e.g. want to calculate unit test/integration test coverage separately)
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
// Add all relevant sourcesets from the subprojects
allprojects.each {
sourceSets it.sourceSets.main
}
reports {
csv.required = false
html.required = true
html.outputLocation = file("${buildDir}/reports/jacoco/html")
xml.required = true
xml.outputLocation = file("${buildDir}/reports/jacoco/jacocoTestReport.xml")
}
}
java {
withJavadocJar()
withSourcesJar()
}
dependencies {
testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.6.28'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.18.1'
testImplementation group: 'com.github.stefanbirkner', name: 'system-rules', version: '1.19.0'
testImplementation group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: '6.0.0'
testImplementation group: 'com.google.code.tempus-fugit', name: 'tempus-fugit', version: '1.1'
}