@@ -9,7 +9,9 @@ dependencies {
99 implementation(project(" :core:api" ))
1010 implementation(project(" :core:impl" ))
1111 implementation(" com.github.ajalt.clikt:clikt:4.2.2" )
12- implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3" )
12+ implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3" ) {
13+ exclude(group = " org.jetbrains.kotlin" ) // Kotlin 의존성 중복 제거
14+ }
1315
1416 testImplementation(kotlin(" test" ))
1517 testImplementation(" org.junit.jupiter:junit-jupiter:5.9.2" )
@@ -23,6 +25,37 @@ tasks {
2325 manifest {
2426 attributes[" Main-Class" ] = " com.commitchronicle.cli.MainKt"
2527 }
28+
29+ // JAR 최적화 설정
30+ minimize() // 사용하지 않는 클래스 제거
31+ mergeServiceFiles() // 서비스 파일 병합
32+
33+ // 중복 의존성 제거
34+ exclude(" META-INF/*.SF" , " META-INF/*.DSA" , " META-INF/*.RSA" )
35+
36+ // 프로퍼티 파일 통합
37+ relocate(" META-INF/services" , " services" )
38+ relocate(" META-INF/spring.*" , " spring" )
39+
40+ // 트랜지티브 의존성 최적화
41+ dependencies {
42+ exclude(dependency(" org.jetbrains.kotlin:kotlin-stdlib" ))
43+ exclude(dependency(" org.jetbrains.kotlin:kotlin-stdlib-common" ))
44+ }
45+ }
46+
47+ // 버전 정보 자동 업데이트 태스크
48+ register(" updateVersion" ) {
49+ doLast {
50+ val versionFile = file(" ${project.buildDir} /version.txt" )
51+ versionFile.parentFile.mkdirs()
52+ versionFile.writeText(project.version.toString())
53+ }
54+ }
55+
56+ // 빌드 시 버전 정보 자동 업데이트
57+ build {
58+ dependsOn(" updateVersion" )
2659 }
2760}
2861
0 commit comments