-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.gradle
More file actions
132 lines (113 loc) · 4.31 KB
/
Copy pathmain.gradle
File metadata and controls
132 lines (113 loc) · 4.31 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
130
131
132
apply plugin: 'info.solidsoft.pitest.aggregator'
allprojects {
repositories {
mavenCentral()
maven { url = "https://repo.spring.io/snapshot" }
maven { url = "https://repo.spring.io/milestone" }
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'info.solidsoft.pitest'
compileJava.dependsOn validateStructure
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
//build.dependsOn 'pitest'
test {
useJUnitPlatform()
}
dependencies {
implementation 'io.projectreactor:reactor-core'
implementation 'io.projectreactor.addons:reactor-extra'
testImplementation 'io.projectreactor.tools:blockhound-junit-platform:1.0.13.RELEASE'
testImplementation 'io.projectreactor:reactor-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
compileOnly "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
testCompileOnly "org.projectlombok:lombok:${lombokVersion}"
testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}"
implementation platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")
}
tasks.withType(Test).configureEach {
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_13)) {
jvmArgs += [
"-XX:+AllowRedefinitionToAddDeleteMethods"
]
}
}
test.finalizedBy(project.tasks.jacocoTestReport)
pitest {
targetClasses = ['co.com.crediya.*']
excludedClasses = []
excludedTestClasses = []
pitestVersion = '1.20.1'
verbose = false
outputFormats = ['XML', 'HTML']
threads = 8
exportLineCoverage = true
useClasspathFile = true
timestampedReports = false
//mutators = ['STRONGER', 'DEFAULTS']
fileExtensionsToFilter.addAll('xml', 'orbit')
junit5PluginVersion = '1.2.2'
failWhenNoMutations = false
jvmArgs = ["-XX:+AllowRedefinitionToAddDeleteMethods"]
}
jacocoTestReport {
dependsOn test, 'pitest'
reports {
xml.setRequired true
xml.setOutputLocation layout.buildDirectory.file("reports/jacoco.xml")
csv.setRequired false
html.setOutputLocation layout.buildDirectory.dir("reports/jacocoHtml")
}
}
}
jacoco {
toolVersion = "${jacocoVersion}"
reportsDirectory.set(layout.buildDirectory.dir("reports"))
}
tasks.register('jacocoMergedReport', JacocoReport) {
dependsOn = [test, subprojects.jacocoTestReport, pitestReportAggregate]
additionalSourceDirs.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.setFrom files(subprojects.sourceSets.main.output)
executionData.setFrom project.fileTree(dir: '.', include: '**/build/jacoco/test.exec')
reports {
xml.setRequired true
csv.setRequired false
html.setRequired true
}
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs = [
'-Amapstruct.suppressGeneratorTimestamp=true'
]
}
pitestReportAggregate {
doLast {
def reportDir = layout.buildDirectory.dir("reports/pitest").get().asFile
def consolidatedReport = new File(reportDir, 'mutations.xml')
consolidatedReport.withWriter { writer ->
writer.write("<mutations>\n")
subprojects.each { subproject ->
def xmlReport = subproject.layout.buildDirectory.file("reports/pitest/mutations.xml").get().asFile
if (xmlReport.exists()) {
def xmlContent = xmlReport.text
xmlContent = xmlContent.replaceAll("<\\?xml[^>]*>", "")
xmlContent = xmlContent.replaceAll("</?mutations( partial=\"true\")?>", "")
writer.write(xmlContent.trim() + "\n")
}
}
writer.write("</mutations>")
}
}
}
tasks.named('wrapper') {
gradleVersion = '8.14.3'
}