-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
90 lines (76 loc) · 2.74 KB
/
Copy pathbuild.gradle
File metadata and controls
90 lines (76 loc) · 2.74 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
plugins {
id "io.spring.dependency-management" version "1.1.6" apply false
id "org.springframework.boot" version "3.3.2" apply false
id "jacoco"
}
allprojects {
group = "kr.spot"
version = "1"
repositories { mavenCentral() }
}
subprojects {
apply plugin: "java"
apply plugin: "io.spring.dependency-management"
apply plugin: "jacoco"
dependencyManagement {
imports { mavenBom "org.springframework.boot:spring-boot-dependencies:3.3.2" }
}
java { toolchain { languageVersion = JavaLanguageVersion.of(21) } }
tasks.withType(JavaCompile) {
options.compilerArgs += "-parameters"
}
tasks.test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
jacoco {
toolVersion = "0.8.12"
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
html.required = true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, includes: [
'**/domain/**',
'**/application/**'
], excludes: [
'**/infrastructure/**',
'**/presentation/**',
'**/config/**'
])
}))
}
}
dependencies {
compileOnly "org.projectlombok:lombok"
annotationProcessor "org.projectlombok:lombok"
testCompileOnly "org.projectlombok:lombok"
testAnnotationProcessor "org.projectlombok:lombok"
}
}
// 전체 프로젝트 통합 커버리지 리포트
tasks.register('jacocoRootReport', JacocoReport) {
dependsOn subprojects.findAll { it.plugins.hasPlugin('jacoco') }.collect { it.tasks.named('test') }
additionalSourceDirs.from(subprojects.findAll { it.plugins.hasPlugin('java') }.collect { it.sourceSets.main.allSource.srcDirs })
sourceDirectories.from(subprojects.findAll { it.plugins.hasPlugin('java') }.collect { it.sourceSets.main.allSource.srcDirs })
def allClassDirs = subprojects.findAll { it.plugins.hasPlugin('java') }.collect { it.sourceSets.main.output }
classDirectories.from(files(allClassDirs).asFileTree.matching {
include '**/domain/**'
include '**/application/**'
exclude '**/infrastructure/**'
exclude '**/presentation/**'
exclude '**/config/**'
})
executionData.from(subprojects.findAll { it.plugins.hasPlugin('jacoco') }.collect {
it.tasks.named('test').map { task -> task.extensions.getByType(JacocoTaskExtension).destinationFile }
})
reports {
xml.required = true
html.required = true
html.outputLocation = layout.buildDirectory.dir('reports/jacoco/aggregated')
}
}