-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
115 lines (99 loc) ยท 4.02 KB
/
build.gradle.kts
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val kotestVersion = "5.5.4"
plugins {
id("org.springframework.boot") version "2.7.11" apply false
id("io.spring.dependency-management") version "1.0.15.RELEASE" apply false
kotlin("jvm") version "1.6.21"
kotlin("plugin.spring") version "1.6.21" apply false
kotlin("plugin.jpa") version "1.6.21" apply false
id("org.jlleitschuh.gradle.ktlint") version "11.3.2"
kotlin("kapt") version "1.6.21" apply false
id("org.sonarqube") version "4.2.1.3168"
id("jacoco")
}
java.sourceCompatibility = JavaVersion.VERSION_11
sonarqube {
properties {
property("sonar.projectKey", "YAPP-Github_mukpat-server")
property("sonar.organization", "yapp-github")
property("sonar.host.url", "https://sonarcloud.io")
// sonar additional settings
property("sonar.sources", "src")
property("sonar.language", "Kotlin")
property("sonar.sourceEncoding", "UTF-8")
property("sonar.test.inclusions", "**/*Test.java")
property("sonar.exclusions", "**/test/**, **/Q*.kt, **/*Doc*.kt, **/resources/** ,**/*Application*.kt , **/*Config*.kt, **/*Dto*.kt, **/*Request*.kt, **/*Response*.kt ,**/*Exception*.kt ,**/*ErrorCode*.kt")
property("sonar.java.coveragePlugin", "jacoco")
}
}
allprojects {
group = "com.yapp"
version = "0.0.1-SNAPSHOT"
repositories {
mavenCentral()
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
}
subprojects {
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlin.plugin.spring")
apply(plugin = "org.springframework.boot")
apply(plugin = "io.spring.dependency-management")
apply(plugin = "org.jlleitschuh.gradle.ktlint")
apply(plugin = "jacoco")
dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("io.github.microutils:kotlin-logging-jvm:3.0.5")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
testImplementation("io.kotest:kotest-framework-datatest:$kotestVersion")
testImplementation("io.kotest.extensions:kotest-extensions-spring:1.1.2")
testImplementation("io.mockk:mockk:1.12.4")
testImplementation("com.ninja-squad:springmockk:3.1.2")
}
tasks.test {
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
}
tasks.jacocoTestReport {
dependsOn(tasks.test) // tests are required to run before generating the report
reports {
xml.required.set(true)
xml.outputLocation.set(File("$buildDir/reports/jacoco.xml"))
}
classDirectories.setFrom(
files(
classDirectories.files.map {
fileTree(it) { // ํ
์คํธ ์ปค๋ฒ๋ฆฌ์ง ์ธก์ ์ ์ธ ๋ชฉ๋ก
exclude(
"**/*Application*",
"**/*Config*",
"**/*Dto*",
"**/*Request*",
"**/*Response*",
"**/*Interceptor*",
"**/*Exception*",
"**/Q*"
) // QueryDsl ์ฉ์ด๋ Q๋ก ์์ํ๋ ํด๋์ค ๋บ ์ํ ์กด์ฌ
}
}
)
)
}
sonarqube {
properties {
property("sonar.java.binaries", "$buildDir/classes")
property("sonar.coverage.jacoco.xmlReportPaths", "$buildDir/reports/jacoco.xml")
}
}
}