From 85136c944c3e214d4bda5e11518087f45e11b81a Mon Sep 17 00:00:00 2001 From: belljun3395 <195850@jnu.ac.kr> Date: Sun, 21 Jul 2024 20:40:59 +0900 Subject: [PATCH] =?UTF-8?q?[#214/refactor]=20gradle=20=EB=94=94=ED=8E=9C?= =?UTF-8?q?=EB=8D=98=EC=8B=9C=20=EC=A0=90=EA=B2=80=20(#220)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 사용하지 않는 의존성 정리 및 테스크 추가 * refactor: 테스크 연결 방식 수정 --- api-repo/build.gradle.kts | 7 ++++++ api/build.gradle.kts | 8 ++++++ build.gradle.kts | 25 ++++++++----------- email/build.gradle.kts | 1 + storage/build.gradle.kts | 8 +++--- .../image/client/util/ImageArgsGenerator.kt | 3 +-- 6 files changed, 30 insertions(+), 22 deletions(-) diff --git a/api-repo/build.gradle.kts b/api-repo/build.gradle.kts index a29bcaf5c..e8fd7bc26 100644 --- a/api-repo/build.gradle.kts +++ b/api-repo/build.gradle.kts @@ -14,6 +14,13 @@ dependencies { api("org.springframework.boot:spring-boot-starter-data-jdbc") implementation("com.mysql:mysql-connector-j") + /** jooq */ + implementation("org.springframework.boot:spring-boot-starter-jooq") + implementation("org.jooq:jooq:${DependencyVersion.JOOQ}") + implementation("org.jooq:jooq-meta:${DependencyVersion.JOOQ}") + implementation("org.jooq:jooq-codegen:${DependencyVersion.JOOQ}") + jooqCodegen("org.jooq:jooq-meta-extensions:${DependencyVersion.JOOQ}") + /** flyway */ implementation("org.flywaydb:flyway-core:${DependencyVersion.FLYWAY}") implementation("org.flywaydb:flyway-mysql") diff --git a/api/build.gradle.kts b/api/build.gradle.kts index 865397cf9..250eff627 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -12,11 +12,19 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-actuator") + /** jooq */ + implementation("org.springframework.boot:spring-boot-starter-jooq") + implementation("org.jooq:jooq:${DependencyVersion.JOOQ}") + implementation("org.jooq:jooq-meta:${DependencyVersion.JOOQ}") + implementation("org.jooq:jooq-codegen:${DependencyVersion.JOOQ}") + jooqCodegen("org.jooq:jooq-meta-extensions:${DependencyVersion.JOOQ}") + /** swagger & restdocs */ implementation("org.springdoc:springdoc-openapi-ui:${DependencyVersion.SPRINGDOC}") implementation("org.springframework.restdocs:spring-restdocs-webtestclient") implementation("org.springframework.restdocs:spring-restdocs-mockmvc") implementation("com.epages:restdocs-api-spec-mockmvc:${DependencyVersion.EPAGES_REST_DOCS_API_SPEC}") + swaggerUI("org.webjars:swagger-ui:${DependencyVersion.SWAGGER_UI}") /** test container */ implementation(platform("org.testcontainers:testcontainers-bom:${DependencyVersion.TEST_CONTAINER}")) diff --git a/build.gradle.kts b/build.gradle.kts index 6a47e61a2..b7295dd02 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -94,13 +94,6 @@ subprojects { implementation("io.projectreactor.kotlin:reactor-kotlin-extensions") implementation("com.fasterxml.jackson.module:jackson-module-kotlin") - /** jooq */ - implementation("org.springframework.boot:spring-boot-starter-jooq") - implementation("org.jooq:jooq:${DependencyVersion.JOOQ}") - implementation("org.jooq:jooq-meta:${DependencyVersion.JOOQ}") - implementation("org.jooq:jooq-codegen:${DependencyVersion.JOOQ}") - jooqCodegen("org.jooq:jooq-meta-extensions:${DependencyVersion.JOOQ}") - /** test **/ testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("io.mockk:mockk:${DependencyVersion.MOCKK}") @@ -111,9 +104,6 @@ subprojects { testImplementation("io.kotest.extensions:kotest-extensions-spring:${DependencyVersion.KOTEST_EXTENSION}") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${DependencyVersion.COROUTINE_TEST}") - /** swagger */ - swaggerUI("org.webjars:swagger-ui:${DependencyVersion.SWAGGER_UI}") - /** Kotlin Logger **/ implementation("io.github.oshai:kotlin-logging-jvm:${DependencyVersion.KOTLIN_LOGGING}") } @@ -135,14 +125,20 @@ subprojects { } } + /** do all copy data migration */ + tasks.register("copyDataMigrationAll") { + dependsOn(":api-repo:copyDataMigration") + dependsOn(":batch:copyDataMigration") + } + /** copy data migration before compile kotlin */ - tasks.getByName("compileKotlin") { - dependsOn("copyDataMigration") + tasks.compileKotlin { + dependsOn("copyDataMigrationAll") } /** jooq codegen after copy data migration */ - tasks.getByName("jooqCodegen") { - dependsOn("copyDataMigration") + tasks.jooqCodegen { + dependsOn("copyDataMigrationAll") } jooq { @@ -219,7 +215,6 @@ subprojects { /** do all jooq codegen */ tasks.register("jooqCodegenAll") { - dependsOn(":api:jooqCodegen") dependsOn(":api-repo:jooqCodegen") dependsOn(":batch:jooqCodegen") } diff --git a/email/build.gradle.kts b/email/build.gradle.kts index 6c3545a63..bdceb425a 100644 --- a/email/build.gradle.kts +++ b/email/build.gradle.kts @@ -7,6 +7,7 @@ tasks.getByName("jar") { } dependencies { + /** starter */ implementation("org.springframework.boot:spring-boot-starter-mail") implementation("org.springframework.boot:spring-boot-starter-thymeleaf") } \ No newline at end of file diff --git a/storage/build.gradle.kts b/storage/build.gradle.kts index cb12d999c..d49471f3a 100644 --- a/storage/build.gradle.kts +++ b/storage/build.gradle.kts @@ -7,14 +7,12 @@ tasks.getByName("jar") { } dependencies { - // minio - local - implementation("io.minio:minio:${DependencyVersion.MINIO}") - // s3 + /** aws - s3 */ implementation("com.amazonaws:aws-java-sdk-s3:${DependencyVersion.AWS_SDK}") - // commonmark - markdown to html + /** commonmark - markdown to html */ implementation("org.commonmark:commonmark:${DependencyVersion.COMMONMARK}") - // jsoup + /** jsoup - html parser */ implementation("org.jsoup:jsoup:1.15.3") } \ No newline at end of file diff --git a/storage/src/main/kotlin/com/few/storage/image/client/util/ImageArgsGenerator.kt b/storage/src/main/kotlin/com/few/storage/image/client/util/ImageArgsGenerator.kt index 27e98d72c..cd55b43d0 100644 --- a/storage/src/main/kotlin/com/few/storage/image/client/util/ImageArgsGenerator.kt +++ b/storage/src/main/kotlin/com/few/storage/image/client/util/ImageArgsGenerator.kt @@ -3,7 +3,6 @@ package com.few.storage.image.client.util import com.few.storage.image.client.dto.ImageGetPreSignedObjectUrlArgs import com.few.storage.image.client.dto.ImagePutObjectArgs import com.few.storage.image.client.dto.ImageRemoveObjectArgs -import io.minio.http.Method import org.apache.http.entity.ContentType import java.io.BufferedInputStream import java.io.File @@ -12,7 +11,7 @@ import java.io.FileInputStream class ImageArgsGenerator { companion object { fun preSignedUrl(bucket: String, image: String): ImageGetPreSignedObjectUrlArgs { - return ImageGetPreSignedObjectUrlArgs(bucket, image, Method.GET.toString()) + return ImageGetPreSignedObjectUrlArgs(bucket, image, "GET") } fun putImage(bucket: String, name: String, image: File): ImagePutObjectArgs {