-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
223 lines (194 loc) · 5.82 KB
/
Copy pathbuild.gradle
File metadata and controls
223 lines (194 loc) · 5.82 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
buildscript {
ext {
kotlinVersion = '2.0.21'
springBootVersion = '3.2.0'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
classpath("org.jetbrains.kotlin:kotlin-noarg:${kotlinVersion}")
classpath("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.8")
}
}
plugins {
id 'org.jlleitschuh.gradle.ktlint' version '12.1.2'
}
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: 'kotlin-jpa'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
apply plugin: 'io.gitlab.arturbosch.detekt'
group = 'info.nukoneko.kidspos'
version = '1.0.0'
// Java toolchain configuration
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
// Thymeleaf version managed by Spring Boot 3.x
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-configuration-processor'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "org.jetbrains.kotlin:kotlin-reflect"
implementation "org.hibernate.orm:hibernate-community-dialects:6.3.1.Final"
implementation 'org.xerial:sqlite-jdbc'
implementation 'org.flywaydb:flyway-core'
implementation 'org.webjars:jquery:3.6.0'
implementation 'org.webjars:jquery-ui:1.13.2'
implementation 'com.itextpdf:itext7-core:7.2.5'
implementation 'com.google.zxing:core:3.5.1'
implementation 'com.google.zxing:javase:3.5.1'
// Apache POI for Excel generation
implementation 'org.apache.poi:poi:5.2.4'
implementation 'org.apache.poi:poi-ooxml:5.2.4'
// OpenAPI/Swagger dependencies for API documentation
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.mockito.kotlin:mockito-kotlin:5.1.0'
}
compileKotlin {
kotlinOptions {
freeCompilerArgs = ['-Xjsr305=strict']
jvmTarget = '21'
}
}
compileTestKotlin {
kotlinOptions {
freeCompilerArgs = ['-Xjsr305=strict']
jvmTarget = '21'
}
}
bootJar {
manifest {
attributes 'Start-Class': 'info.nukoneko.kidspos.server.ServerApplicationKt'
}
}
task stage(type: Copy, dependsOn: [clean, build]) {
from tasks.jar.archiveFile
into project.rootDir
rename {
'app.jar'
}
}
stage.mustRunAfter(clean)
task cleanJar {
doLast {
project.file('app.jar').delete()
}
}
// JaCoCo configuration
jacoco {
toolVersion = "0.8.11"
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.80
}
}
rule {
element = 'CLASS'
includes = ['info.nukoneko.kidspos.server.service.*']
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.85
}
}
}
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
testLogging {
events "passed", "skipped", "failed"
showStandardStreams = false
}
systemProperty 'spring.profiles.active', 'test'
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(21)
}
}
jacocoTestReport {
reports {
xml.required = false
csv.required = false
html.outputLocation = file("${buildDir}/jacocoHtml")
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'**/ServerApplicationKt*',
'**/config/**',
'**/dto/**',
'**/entity/**',
'**/exception/**'
])
}))
}
}
// Detekt configuration for static code analysis
detekt {
buildUponDefaultConfig = true
allRules = false
config = files("$projectDir/config/detekt/detekt.yml")
baseline = file("$projectDir/config/detekt/baseline.xml")
parallel = true
reports {
html.required = true
xml.required = false
txt.required = false
}
}
tasks.withType(io.gitlab.arturbosch.detekt.Detekt).configureEach {
jvmTarget = "21"
exclude("**/test/**")
exclude("**/build/**")
exclude("**/*.kts")
}
// Ktlint configuration
ktlint {
version = "1.5.0"
debug = false
verbose = false
android = false
outputToConsole = true
outputColorName = "RED"
ignoreFailures = false
enableExperimentalRules = false
filter {
exclude("**/build/**")
exclude("**/generated/**")
}
}
// Temporarily disabled - coverage requirements
// check.dependsOn jacocoTestCoverageVerification
// カスタムタスク: ポートをクリアしてからアプリケーションを起動
task runWithPortClean(type: Exec) {
group = 'application'
description = 'Kill existing process on port 8080 and run the application'
commandLine 'bash', '-c', '''
PORT_PID=$(lsof -ti:8080)
if [ ! -z "$PORT_PID" ]; then
echo "Killing process on port 8080 (PID: $PORT_PID)"
kill -9 $PORT_PID
sleep 2
fi
./gradlew bootRun
'''
}