|
| 1 | +import org.gradle.kotlin.dsl.withType |
| 2 | +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
| 3 | + |
| 4 | +plugins { |
| 5 | + id(Plugin.KOTLIN_JVM) version PluginVersion.KOTLIN_VERSION |
| 6 | + id(Plugin.KOTLIN_SPRING) version PluginVersion.KOTLIN_VERSION |
| 7 | + id(Plugin.KOTLIN_KAPT) |
| 8 | + id(Plugin.SPRING_BOOT) version PluginVersion.SPRING_BOOT_VERSION |
| 9 | + id(Plugin.SPRING_DEPENDENCY_MANAGEMENT) version PluginVersion.SPRING_DEPENDENCY_MANAGEMENT_VERSION |
| 10 | + id(Plugin.CASPER_DOCUMENTATION) |
| 11 | + id(Plugin.PROTOBUF) version PluginVersion.PROTOBUF_VERSION |
| 12 | +} |
| 13 | + |
| 14 | +dependencies { |
| 15 | + // 스프링 부트 기본 기능 |
| 16 | + implementation(Dependencies.SPRING_BOOT_STARTER) |
| 17 | + |
| 18 | + // 코틀린 리플렉션 |
| 19 | + implementation(Dependencies.KOTLIN_REFLECT) |
| 20 | + |
| 21 | + // 스프링 부트 테스트 도구 |
| 22 | + testImplementation(Dependencies.SPRING_BOOT_STARTER_TEST) |
| 23 | + |
| 24 | + // 코틀린 + JUnit5 테스트 |
| 25 | + testImplementation(Dependencies.KOTLIN_TEST_JUNIT5) |
| 26 | + |
| 27 | + // JUnit5 실행 런처 |
| 28 | + testRuntimeOnly(Dependencies.JUNIT_PLATFORM_LAUNCHER) |
| 29 | + |
| 30 | + // 웹 관련 |
| 31 | + implementation(Dependencies.SPRING_BOOT_STARTER_WEB) |
| 32 | + |
| 33 | + // 데이터베이스 |
| 34 | + implementation(Dependencies.SPRING_BOOT_STARTER_DATA_JPA) |
| 35 | + implementation(Dependencies.SPRING_BOOT_STARTER_DATA_REDIS) |
| 36 | + runtimeOnly(Dependencies.MYSQL_CONNECTOR) |
| 37 | + |
| 38 | + // 보안 |
| 39 | + implementation(Dependencies.SPRING_BOOT_STARTER_SECURITY) |
| 40 | + |
| 41 | + // 검증 |
| 42 | + implementation(Dependencies.SPRING_BOOT_STARTER_VALIDATION) |
| 43 | + |
| 44 | + // JSON 처리 |
| 45 | + implementation(Dependencies.JACKSON_MODULE_KOTLIN) |
| 46 | + implementation(Dependencies.ORG_JSON) |
| 47 | + |
| 48 | + // JWT |
| 49 | + implementation(Dependencies.JWT_API) |
| 50 | + implementation(Dependencies.JWT_IMPL) |
| 51 | + runtimeOnly(Dependencies.JWT_JACKSON) |
| 52 | + |
| 53 | + implementation(Dependencies.MAPSTRUCT) |
| 54 | + kapt(Dependencies.MAPSTRUCT_PROCESSOR) |
| 55 | + |
| 56 | + // grpc |
| 57 | + implementation(Dependencies.GRPC_NETTY_SHADED) |
| 58 | + implementation(Dependencies.GRPC_PROTOBUF) |
| 59 | + implementation(Dependencies.GRPC_STUB) |
| 60 | + implementation(Dependencies.GRPC_KOTLIN_STUB) |
| 61 | + implementation(Dependencies.PROTOBUF_KOTLIN) |
| 62 | + implementation(Dependencies.GRPC_SERVER_SPRING_BOOT_STARTER) |
| 63 | + testImplementation(Dependencies.GRPC_TESTING) |
| 64 | + |
| 65 | + // OkCert |
| 66 | + implementation(files("$projectDir/${Dependencies.OKCERT_PATH}")) |
| 67 | + |
| 68 | + // swagger |
| 69 | + implementation(Dependencies.SWAGGER) |
| 70 | + |
| 71 | + // Sentry |
| 72 | + implementation(Dependencies.SENTRY_SPRING_BOOT_STARTER) |
| 73 | +} |
| 74 | + |
| 75 | +protobuf { |
| 76 | + protoc { |
| 77 | + artifact = "com.google.protobuf:protoc:${DependencyVersion.PROTOBUF}" |
| 78 | + } |
| 79 | + plugins { |
| 80 | + create("grpc") { |
| 81 | + artifact = "io.grpc:protoc-gen-grpc-java:${DependencyVersion.GRPC}" |
| 82 | + } |
| 83 | + create("grpckt") { |
| 84 | + artifact = "io.grpc:protoc-gen-grpc-kotlin:${DependencyVersion.GRPC_KOTLIN}:jdk8@jar" |
| 85 | + } |
| 86 | + } |
| 87 | + generateProtoTasks { |
| 88 | + all().forEach { |
| 89 | + it.plugins { |
| 90 | + create("grpc") |
| 91 | + create("grpckt") |
| 92 | + } |
| 93 | + } |
| 94 | + } |
| 95 | +} |
| 96 | + |
| 97 | +repositories { |
| 98 | + mavenCentral() |
| 99 | +} |
| 100 | + |
| 101 | +kotlin { |
| 102 | + jvmToolchain(17) |
| 103 | +} |
| 104 | + |
| 105 | +tasks.withType<KotlinCompile> { |
| 106 | + kotlinOptions { |
| 107 | + freeCompilerArgs += "-Xjsr305=strict" |
| 108 | + } |
| 109 | +} |
| 110 | + |
| 111 | +tasks.withType<Test> { |
| 112 | + useJUnitPlatform() |
| 113 | +} |
0 commit comments