From 19bfd511a6d0882062fefcfee947aba57d5a85c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A3=BC=EC=9B=90?= Date: Sun, 11 May 2025 18:07:02 +0900 Subject: [PATCH 01/14] =?UTF-8?q?feat=20(=20#11=20)=20:=20test=20=ED=81=B4?= =?UTF-8?q?=EB=9E=98=EC=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/kotlin/io/casper/build/TestClass.kt | 5 ++--- .../kr/casper/entrydsm/application/TestClass2.kt | 15 +++++++++++++++ .../kr/casper/entrydsm/application/TestClass3.kt | 8 ++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 casper-application-domain/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass2.kt create mode 100644 casper-application-infrastructure/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass3.kt diff --git a/build-logic/src/main/kotlin/io/casper/build/TestClass.kt b/build-logic/src/main/kotlin/io/casper/build/TestClass.kt index db077d48..6a5992dc 100644 --- a/build-logic/src/main/kotlin/io/casper/build/TestClass.kt +++ b/build-logic/src/main/kotlin/io/casper/build/TestClass.kt @@ -5,10 +5,9 @@ package io.casper.build * 이제 올바른 KDoc 주석 형식을 사용합니다. */ class TestClass { + /** - * 이 함수는 KDoc 주석 검사 테스트를 위한 용도입니다. - * - * @return 항상 Unit을 반환합니다. + * 이 함수는 빌드 로직에서 사용하는 테스트 함수입니다. */ fun testFunction() { println("이 함수는 문서화 검사를 테스트하기 위한 용도입니다.") diff --git a/casper-application-domain/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass2.kt b/casper-application-domain/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass2.kt new file mode 100644 index 00000000..fb6e2d2d --- /dev/null +++ b/casper-application-domain/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass2.kt @@ -0,0 +1,15 @@ +package hs.kr.casper.entrydsm.application + +/** + * 이 클래스는 KDoc 주석 검사 테스트를 위한 용도입니다. + * 이제 올바른 KDoc 주석 형식을 사용합니다. + */ +class TestClass2 { + + /** + * 이 함수는 문서화 검사를 테스트하기 위한 용도입니다. + */ + fun testFunction() { + println("이 함수는 문서화 검사를 테스트하기 위한 용도입니다.") + } +} \ No newline at end of file diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass3.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass3.kt new file mode 100644 index 00000000..261b2457 --- /dev/null +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass3.kt @@ -0,0 +1,8 @@ +package hs.kr.casper.entrydsm.application + +/** + * test + */ +class TestClass3 { + +} \ No newline at end of file From d2041c295b77fac78861f4dcb0124f95a43e20f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A3=BC=EC=9B=90?= Date: Sun, 11 May 2025 18:21:13 +0900 Subject: [PATCH 02/14] =?UTF-8?q?chore=20(=20#11=20)=20:=20=EB=A3=A8?= =?UTF-8?q?=ED=8A=B8=20src=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/DocumentationExampleService.kt | 110 ------------------ .../example/UndocumentedExamples.kt | 73 ------------ src/main/resources/application.properties | 1 - .../application/CasperApplicationTests.kt | 15 --- 4 files changed, 199 deletions(-) delete mode 100644 src/main/kotlin/hs/kr/entrydsm/application/example/DocumentationExampleService.kt delete mode 100644 src/main/kotlin/hs/kr/entrydsm/application/example/UndocumentedExamples.kt delete mode 100644 src/main/resources/application.properties delete mode 100644 src/test/kotlin/hs/kr/entrydsm/application/CasperApplicationTests.kt diff --git a/src/main/kotlin/hs/kr/entrydsm/application/example/DocumentationExampleService.kt b/src/main/kotlin/hs/kr/entrydsm/application/example/DocumentationExampleService.kt deleted file mode 100644 index ba51a97a..00000000 --- a/src/main/kotlin/hs/kr/entrydsm/application/example/DocumentationExampleService.kt +++ /dev/null @@ -1,110 +0,0 @@ -package hs.kr.entrydsm.application.example - -import org.springframework.stereotype.Service - -/** - * KDoc 주석 검사를 테스트하기 위한 예제 서비스 클래스입니다. - * 이 클래스는 다양한 함수 타입과 주석 패턴을 보여주기 위한 목적으로 작성되었습니다. - * - * @author EntryDSM - * @since 1.0.0 - */ -@Service -class DocumentationExampleService { - /** - * 매개변수 없는 공개 함수의 예제입니다. - * 간단한 문자열을 반환합니다. - * - * @return 표준 인사말 문자열 - */ - fun publicFunction(): String { - return "Hello from public function" - } - - /** - * 매개변수가 있는 공개 함수 예제입니다. - * 입력받은 이름으로 개인화된 인사말을 생성하여 반환합니다. - * - * @param name 인사할 대상의 이름 - * @return 이름을 포함한 개인화된 인사말 - * @throws IllegalArgumentException 이름이 빈 문자열인 경우 - */ - fun publicFunctionWithParam(name: String): String { - return "Hello, $name!" - } - - /** - * 문자열을 대문자로 변환하는 비공개 헬퍼 함수입니다. - * 내부적으로만 사용되며 주로 [publicFunctionWithParam]에서 호출됩니다. - * - * @param text 대문자로 변환할 문자열 - * @return 대문자로 변환된 문자열 - * @see publicFunctionWithParam - */ - private fun privateFunction(text: String): String { - return text.uppercase() - } - - /** - * 주어진 문자열을 지정된 횟수만큼 중복시키는 내부 유틸리티 함수입니다. - * 텍스트 패턴을 반복해야 할 때 사용합니다. - * - * @param text 중복할 문자열 - * @param times 중복 횟수 (음수인 경우 빈 문자열 반환) - * @return 지정된 횟수만큼 중복된 문자열 - * @sample - * duplicateText("Hello", 3) // 결과: "HelloHelloHello" - */ - private fun duplicateText( - text: String, - times: Int, - ): String { - return text.repeat(times) - } -} - -/** - * 사용자 정보를 저장하기 위한 데이터 클래스입니다. - * API 응답 및 서비스 간 데이터 전송에 사용됩니다. - * - * @property id 사용자의 고유 식별자 - * @property name 사용자의 실명 또는 닉네임 - * @property email 사용자의 이메일 주소 (통신 용도) - * @constructor 모든 필수 속성을 가진 사용자 DTO 인스턴스를 생성합니다 - */ -data class UserDto( - val id: Long, - val name: String, - val email: String, -) - -/** - * 문자열 조작을 위한 유틸리티 함수를 제공하는 오브젝트입니다. - * 애플리케이션 전반에서 사용되는 문자열 관련 공통 기능을 중앙화합니다. - * - * @since 1.0.0 - */ -object StringUtils { - /** - * 문자열이 비어 있거나 null인지 확인합니다. - * 유효성 검사에 유용하게 사용됩니다. - * - * @param text 확인할 문자열 (null 가능) - * @return 문자열이 null이거나 빈 문자열이면 true, 그렇지 않으면 false - */ - fun isEmpty(text: String?): Boolean { - return text.isNullOrEmpty() - } - - /** - * 문자열의 좌우 공백을 제거합니다. - * 사용자 입력 정제에 유용합니다. - * - * @param text 처리할 문자열 - * @return 좌우 공백이 제거된 문자열 - * @throws NullPointerException text가 null인 경우 - */ - fun trim(text: String): String { - return text.trim() - } -} diff --git a/src/main/kotlin/hs/kr/entrydsm/application/example/UndocumentedExamples.kt b/src/main/kotlin/hs/kr/entrydsm/application/example/UndocumentedExamples.kt deleted file mode 100644 index b45f499e..00000000 --- a/src/main/kotlin/hs/kr/entrydsm/application/example/UndocumentedExamples.kt +++ /dev/null @@ -1,73 +0,0 @@ -package hs.kr.entrydsm.application.example - -/** - * 문서화되지 않은 요소들을 보여주는 예제 클래스입니다. - * 이 클래스는 KDoc 주석 검사 시스템을 테스트하기 위해 사용됩니다. - */ -class UndocumentedExamples { - /** - * 이전에 문서화되지 않았던 함수의 예시입니다. - * 간단한 문자열을 반환합니다. - * - * @return "This function has no KDoc" 문자열 - */ - fun undocumentedFunction(): String { - return "This function has no KDoc" - } - - /** - * 매개변수가 있는 함수 예시입니다. - * 문자열의 길이를 반환합니다. - * - * @param param 길이를 계산할 문자열 - * @return 문자열의 길이 - */ - fun anotherUndocumentedFunction(param: String): Int { - return param.length - } - - /** - * 비공개 헬퍼 함수입니다. - * 콘솔에 메시지를 출력합니다. - */ - private fun privateUndocumentedFunction() { - println("Private function without KDoc") - } -} - -/** - * 유틸리티 기능을 제공하는 싱글톤 객체입니다. - * 이 객체는 정적 메소드와 속성을 그룹화합니다. - */ -object UndocumentedObject { - /** - * 객체의 예시 속성입니다. - */ - val someProperty = "No KDoc here" - - /** - * 객체 내의 유틸리티 함수입니다. - * 간단한 메시지를 콘솔에 출력합니다. - */ - fun objectFunction() { - println("Function in undocumented object") - } -} - -/** - * 문서화 검사 예제를 위한 인터페이스입니다. - * 이 인터페이스는 구현 클래스가 따라야 할 계약을 정의합니다. - */ -interface UndocumentedInterface { - /** - * 인터페이스에서 정의된 메소드입니다. - * 구현 클래스에서 이 메소드를 구현해야 합니다. - */ - fun interfaceMethod() - - /** - * 인터페이스에서 정의된 속성입니다. - * 구현 클래스에서 이 속성에 대한 접근자를 제공해야 합니다. - */ - val interfaceProperty: String -} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties deleted file mode 100644 index 245f33c7..00000000 --- a/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -spring.application.name=Casper-Application diff --git a/src/test/kotlin/hs/kr/entrydsm/application/CasperApplicationTests.kt b/src/test/kotlin/hs/kr/entrydsm/application/CasperApplicationTests.kt deleted file mode 100644 index d540c305..00000000 --- a/src/test/kotlin/hs/kr/entrydsm/application/CasperApplicationTests.kt +++ /dev/null @@ -1,15 +0,0 @@ -package hs.kr.entrydsm.application - -import org.junit.jupiter.api.Test -import org.springframework.boot.test.context.SpringBootTest - -/** - * asdf - * - */ -@SpringBootTest -class CasperApplicationTests { - @Test - fun contextLoads() { - } -} From e910cc2af75a7cc3ab51031db9dfb1fe603c4e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A3=BC=EC=9B=90?= Date: Sun, 11 May 2025 18:22:13 +0900 Subject: [PATCH 03/14] =?UTF-8?q?feat=20(=20#11=20)=20:=20gradle.kts=20?= =?UTF-8?q?=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- casper-application-domain/build.gradle.kts | 22 ++++++++++ .../build.gradle.kts | 42 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 casper-application-domain/build.gradle.kts create mode 100644 casper-application-infrastructure/build.gradle.kts diff --git a/casper-application-domain/build.gradle.kts b/casper-application-domain/build.gradle.kts new file mode 100644 index 00000000..3c454cce --- /dev/null +++ b/casper-application-domain/build.gradle.kts @@ -0,0 +1,22 @@ +plugins { + kotlin("jvm") + id("casper.documentation-convention") // 명시적으로 플러그인 적용 +} + +group = "hs.kr.casper.entrydsm" +version = "0.0.1-SNAPSHOT" + +repositories { + mavenCentral() +} + +dependencies { + testImplementation(kotlin("test")) +} + +tasks.test { + useJUnitPlatform() +} +kotlin { + jvmToolchain(17) +} \ No newline at end of file diff --git a/casper-application-infrastructure/build.gradle.kts b/casper-application-infrastructure/build.gradle.kts new file mode 100644 index 00000000..d07faf3d --- /dev/null +++ b/casper-application-infrastructure/build.gradle.kts @@ -0,0 +1,42 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + kotlin("jvm") + kotlin("plugin.spring") version "1.9.23" + id("org.springframework.boot") version "3.4.4" + id("io.spring.dependency-management") version "1.1.7" + id("casper.documentation-convention") +} + +group = "hs.kr.entrydsm" +version = "0.0.1-SNAPSHOT" + +repositories { + mavenCentral() +} + +dependencies { + // impl project + implementation(project(":casper-application-domain")) + + implementation("org.springframework.boot:spring-boot-starter") + implementation("org.jetbrains.kotlin:kotlin-reflect") + + testImplementation("org.springframework.boot:spring-boot-starter-test") + testImplementation(kotlin("test")) +} + +tasks.withType { + kotlinOptions { + freeCompilerArgs += "-Xjsr305=strict" + jvmTarget = "17" + } +} + +tasks.withType { + useJUnitPlatform() +} + +kotlin { + jvmToolchain(17) +} From cb4ec05367eb4d1b2dd59d23cb093743d1cfce6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A3=BC=EC=9B=90?= Date: Sun, 11 May 2025 18:22:54 +0900 Subject: [PATCH 04/14] =?UTF-8?q?feat=20(=20#11=20)=20:=20spring=20Applica?= =?UTF-8?q?tion=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hs/kr/casper}/entrydsm/application/CasperApplication.kt | 2 +- .../src/main/resources/application.yml | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {src/main/kotlin/hs/kr => casper-application-infrastructure/src/main/kotlin/hs/kr/casper}/entrydsm/application/CasperApplication.kt (91%) create mode 100644 casper-application-infrastructure/src/main/resources/application.yml diff --git a/src/main/kotlin/hs/kr/entrydsm/application/CasperApplication.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/casper/entrydsm/application/CasperApplication.kt similarity index 91% rename from src/main/kotlin/hs/kr/entrydsm/application/CasperApplication.kt rename to casper-application-infrastructure/src/main/kotlin/hs/kr/casper/entrydsm/application/CasperApplication.kt index 581cae03..d380433d 100644 --- a/src/main/kotlin/hs/kr/entrydsm/application/CasperApplication.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/casper/entrydsm/application/CasperApplication.kt @@ -1,4 +1,4 @@ -package hs.kr.entrydsm.application +package hs.kr.casper.entrydsm.application import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication diff --git a/casper-application-infrastructure/src/main/resources/application.yml b/casper-application-infrastructure/src/main/resources/application.yml new file mode 100644 index 00000000..e69de29b From 2f9c14018ff0a8456f8f4a0bc0c6aeea61125911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A3=BC=EC=9B=90?= Date: Sun, 11 May 2025 18:23:16 +0900 Subject: [PATCH 05/14] =?UTF-8?q?refactor=20(=20#11=20)=20:=20=EB=A3=A8?= =?UTF-8?q?=ED=8A=B8=20gradle.kts=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 30 +++++++++++++++--------------- settings.gradle.kts | 4 ++++ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 6ed31064..9ca67816 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,20 +1,24 @@ plugins { + // 플러그인 순서 최적화: 기본 플러그인이 먼저 적용되도록 함 + id("java") // 먼저 java 플러그인 적용 kotlin("jvm") version "1.9.23" - kotlin("plugin.spring") version "1.9.23" - id("org.springframework.boot") version "3.4.4" - id("io.spring.dependency-management") version "1.1.7" id("org.jlleitschuh.gradle.ktlint").version("12.1.1") id("io.gitlab.arturbosch.detekt") version "1.23.6" + // 마지막에 커스텀 플러그인 적용 id("casper.documentation-convention") } -// 모든 프로젝트(루트 및 서브프로젝트)에 공통 설정 적용 -allprojects { +// 서브프로젝트 설정 +subprojects { + // 서브프로젝트에 공통 설정 적용 repositories { mavenCentral() } - // 모든 프로젝트에 플러그인 적용 + // 서브프로젝트 경로 출력 (디버깅용) + println("서브프로젝트 경로: ${this.path}, 이름: ${this.name}") + + // 모든 서브프로젝트에 문서화 플러그인 적용 apply(plugin = "casper.documentation-convention") } @@ -25,6 +29,11 @@ tasks.register("checkAll") { // 루트 프로젝트의 check 태스크에 의존 dependsOn(tasks.named("check")) + // 모든 서브프로젝트의 check 태스크에 의존 + subprojects.forEach { subproject -> + dependsOn(subproject.tasks.matching { it.name.startsWith("check") }) + } + // build-logic, convention 등 includeBuild 모듈의 check 태스크에 의존 dependsOn(gradle.includedBuilds.map { it.task(":check") }) } @@ -39,19 +48,10 @@ java { } dependencies { - implementation("org.springframework.boot:spring-boot-starter") - implementation("org.jetbrains.kotlin:kotlin-reflect") - testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") testRuntimeOnly("org.junit.platform:junit-platform-launcher") } -kotlin { - compilerOptions { - freeCompilerArgs.addAll("-Xjsr305=strict") - } -} - tasks.withType { useJUnitPlatform() } diff --git a/settings.gradle.kts b/settings.gradle.kts index 998fa7c2..d3b24e25 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -14,3 +14,7 @@ dependencyResolutionManagement { mavenCentral() } } + +include(":casper-application-domain") + +include("casper-application-infrastructure") From 1c8b053b36bd003e4ff58bc414eddc2974dce7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A3=BC=EC=9B=90?= Date: Sun, 11 May 2025 18:25:20 +0900 Subject: [PATCH 06/14] =?UTF-8?q?refactor=20(=20#11=20)=20:=20=EC=A4=91?= =?UTF-8?q?=EB=B3=B5=20task=20=EA=B2=80=EC=A6=9D=20=EB=B0=8F=20=EB=AA=A8?= =?UTF-8?q?=EB=93=A0=20=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8=EC=97=90=20?= =?UTF-8?q?=ED=83=9C=EC=8A=A4=ED=81=AC=20=EB=93=B1=EB=A1=9D=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/DocumentationConventionPlugin.kt | 60 ++++++++++--------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/casper-convention/src/main/kotlin/io/casper/convention/plugins/DocumentationConventionPlugin.kt b/casper-convention/src/main/kotlin/io/casper/convention/plugins/DocumentationConventionPlugin.kt index 237739be..4d05ecfe 100644 --- a/casper-convention/src/main/kotlin/io/casper/convention/plugins/DocumentationConventionPlugin.kt +++ b/casper-convention/src/main/kotlin/io/casper/convention/plugins/DocumentationConventionPlugin.kt @@ -14,44 +14,50 @@ import org.gradle.kotlin.dsl.register */ class DocumentationConventionPlugin : Plugin { override fun apply(project: Project) { - with(project) { - // 현재 프로젝트에 태스크 등록 - registerDocTasks(this) - - // 모든 서브프로젝트에도 태스크 등록 - subprojects { - registerDocTasks(this) - } - } + project.logger.lifecycle("문서화 규칙 플러그인을 적용합니다: ${project.name}") + registerDocTasks(project) } - private fun Project.registerDocTasks(project: Project) { - with(project) { - val registeredTasks = mutableListOf>() + private fun registerDocTasks(project: Project) { + val registeredTasks = mutableListOf>() - DocCheckTaskType.values().forEach { taskType -> - val task = tasks.register(taskType.taskName) { + DocCheckTaskType.values().forEach { taskType -> + val taskName = taskType.taskName + + // 이미 같은 이름의 태스크가 있는지 확인 + if (project.tasks.findByName(taskName) == null) { + val task = project.tasks.register(taskName) { group = DocConstants.DOC_GROUP description = taskType.description codeElement.set(taskType.codeElement) } registeredTasks.add(task) + project.logger.lifecycle("${project.name}에 ${taskName} 태스크를 등록했습니다.") + } else { + project.logger.lifecycle("${project.name}에 이미 ${taskName} 태스크가 있습니다.") + registeredTasks.add(project.tasks.named(taskName)) } + } - // 모든 문서화 검사를 한 번에 실행하는 태스크 - tasks.register("checkAllDocs") { - group = DocConstants.CHECK_GROUP - description = "모든 코드 요소의 KDoc 주석 여부를 확인합니다" - - // 등록된 모든 검사 태스크에 의존 - dependsOn(registeredTasks) - } + // 모든 문서화 검사를 한 번에 실행하는 태스크 + val checkAllDocsTaskName = "checkAllDocs" + if (project.tasks.findByName(checkAllDocsTaskName) == null) { + project.tasks.register(checkAllDocsTaskName) { + group = DocConstants.CHECK_GROUP + description = "모든 코드 요소의 KDoc 주석 여부를 확인합니다" + + // 등록된 모든 검사 태스크에 의존 + dependsOn(registeredTasks) + } + project.logger.lifecycle("${project.name}에 ${checkAllDocsTaskName} 태스크를 등록했습니다.") + } + + // 프로젝트 평가 후에 check 태스크가 있으면 checkAllDocs를 의존성으로 추가 + project.afterEvaluate { + project.tasks.findByName("check")?.dependsOn(checkAllDocsTaskName) + project.logger.lifecycle("${project.name}의 check 태스크에 ${checkAllDocsTaskName} 의존성을 추가했습니다.") + } - // 빌드 검증 과정에 문서화 검사 포함 - tasks.named("check") { - dependsOn("checkAllDocs") } } -} -} \ No newline at end of file From 8972fc7584574ec08793f4702f43b42697380021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A3=BC=EC=9B=90?= Date: Sun, 11 May 2025 18:41:09 +0900 Subject: [PATCH 07/14] =?UTF-8?q?refactor=20(=20#11=20)=20:=20println?= =?UTF-8?q?=EB=8C=80=EC=8B=A0=20logger=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9ca67816..8da22895 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,7 +16,7 @@ subprojects { } // 서브프로젝트 경로 출력 (디버깅용) - println("서브프로젝트 경로: ${this.path}, 이름: ${this.name}") + logger.lifecycle("서브프로젝트 경로: ${this.path}, 이름: ${this.name}") // 모든 서브프로젝트에 문서화 플러그인 적용 apply(plugin = "casper.documentation-convention") From a54c507f137e3130f9efa48638086b7442f09487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A3=BC=EC=9B=90?= Date: Sun, 11 May 2025 18:44:02 +0900 Subject: [PATCH 08/14] =?UTF-8?q?refactor=20(=20#11=20)=20:=20KotlinCompil?= =?UTF-8?q?e=20=EC=84=A4=EC=A0=95=20=EC=A4=91=EB=B3=B5=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- casper-application-infrastructure/build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/casper-application-infrastructure/build.gradle.kts b/casper-application-infrastructure/build.gradle.kts index d07faf3d..15da2ae5 100644 --- a/casper-application-infrastructure/build.gradle.kts +++ b/casper-application-infrastructure/build.gradle.kts @@ -29,7 +29,6 @@ dependencies { tasks.withType { kotlinOptions { freeCompilerArgs += "-Xjsr305=strict" - jvmTarget = "17" } } From 98b448ab21786d716d9f3062b40935947a202b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A3=BC=EC=9B=90?= Date: Sun, 11 May 2025 18:48:20 +0900 Subject: [PATCH 09/14] =?UTF-8?q?chore=20(=20#11=20)=20:=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hs/kr/{casper => }/entrydsm/application/TestClass2.kt | 2 +- .../hs/kr/casper/entrydsm/application/TestClass3.kt | 8 -------- .../entrydsm/application/CasperApplication.kt | 2 +- .../main/kotlin/hs/kr/entrydsm/application/TestClass3.kt | 8 ++++++++ 4 files changed, 10 insertions(+), 10 deletions(-) rename casper-application-domain/src/main/kotlin/hs/kr/{casper => }/entrydsm/application/TestClass2.kt (90%) delete mode 100644 casper-application-infrastructure/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass3.kt rename casper-application-infrastructure/src/main/kotlin/hs/kr/{casper => }/entrydsm/application/CasperApplication.kt (91%) create mode 100644 casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/TestClass3.kt diff --git a/casper-application-domain/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass2.kt b/casper-application-domain/src/main/kotlin/hs/kr/entrydsm/application/TestClass2.kt similarity index 90% rename from casper-application-domain/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass2.kt rename to casper-application-domain/src/main/kotlin/hs/kr/entrydsm/application/TestClass2.kt index fb6e2d2d..117dfbdb 100644 --- a/casper-application-domain/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass2.kt +++ b/casper-application-domain/src/main/kotlin/hs/kr/entrydsm/application/TestClass2.kt @@ -1,4 +1,4 @@ -package hs.kr.casper.entrydsm.application +package hs.kr.entrydsm.application /** * 이 클래스는 KDoc 주석 검사 테스트를 위한 용도입니다. diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass3.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass3.kt deleted file mode 100644 index 261b2457..00000000 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/casper/entrydsm/application/TestClass3.kt +++ /dev/null @@ -1,8 +0,0 @@ -package hs.kr.casper.entrydsm.application - -/** - * test - */ -class TestClass3 { - -} \ No newline at end of file diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/casper/entrydsm/application/CasperApplication.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/CasperApplication.kt similarity index 91% rename from casper-application-infrastructure/src/main/kotlin/hs/kr/casper/entrydsm/application/CasperApplication.kt rename to casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/CasperApplication.kt index d380433d..581cae03 100644 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/casper/entrydsm/application/CasperApplication.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/CasperApplication.kt @@ -1,4 +1,4 @@ -package hs.kr.casper.entrydsm.application +package hs.kr.entrydsm.application import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/TestClass3.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/TestClass3.kt new file mode 100644 index 00000000..d421121f --- /dev/null +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/TestClass3.kt @@ -0,0 +1,8 @@ +package hs.kr.entrydsm.application + +/** + * test + */ +class TestClass3 { + +} \ No newline at end of file From 2a5942f7b508223484f0f253f64144df3420197d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A3=BC=EC=9B=90?= Date: Sun, 11 May 2025 18:53:28 +0900 Subject: [PATCH 10/14] =?UTF-8?q?refactor=20(=20#11=20)=20:=20=ED=95=98?= =?UTF-8?q?=EB=93=9C=20=EC=BD=94=EB=94=A9=20=EC=A0=9C=EA=B1=B0=20=EB=B0=8F?= =?UTF-8?q?=20=ED=95=A8=EC=88=98=EB=AA=85=20=EB=AA=85=ED=99=95=ED=95=98?= =?UTF-8?q?=EA=B2=8C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/DocumentationConventionPlugin.kt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/casper-convention/src/main/kotlin/io/casper/convention/plugins/DocumentationConventionPlugin.kt b/casper-convention/src/main/kotlin/io/casper/convention/plugins/DocumentationConventionPlugin.kt index 4d05ecfe..816bb088 100644 --- a/casper-convention/src/main/kotlin/io/casper/convention/plugins/DocumentationConventionPlugin.kt +++ b/casper-convention/src/main/kotlin/io/casper/convention/plugins/DocumentationConventionPlugin.kt @@ -15,11 +15,11 @@ import org.gradle.kotlin.dsl.register class DocumentationConventionPlugin : Plugin { override fun apply(project: Project) { project.logger.lifecycle("문서화 규칙 플러그인을 적용합니다: ${project.name}") - registerDocTasks(project) + registerDocCheckTasks(project) } - private fun registerDocTasks(project: Project) { + private fun registerDocCheckTasks(project: Project) { val registeredTasks = mutableListOf>() DocCheckTaskType.values().forEach { taskType -> @@ -41,23 +41,25 @@ class DocumentationConventionPlugin : Plugin { } // 모든 문서화 검사를 한 번에 실행하는 태스크 - val checkAllDocsTaskName = "checkAllDocs" - if (project.tasks.findByName(checkAllDocsTaskName) == null) { - project.tasks.register(checkAllDocsTaskName) { + if (project.tasks.findByName(CHECK_ALL_DOCS_TASK) == null) { + project.tasks.register(CHECK_ALL_DOCS_TASK) { group = DocConstants.CHECK_GROUP description = "모든 코드 요소의 KDoc 주석 여부를 확인합니다" // 등록된 모든 검사 태스크에 의존 dependsOn(registeredTasks) } - project.logger.lifecycle("${project.name}에 ${checkAllDocsTaskName} 태스크를 등록했습니다.") + project.logger.lifecycle("${project.name}에 ${CHECK_ALL_DOCS_TASK} 태스크를 등록했습니다.") } // 프로젝트 평가 후에 check 태스크가 있으면 checkAllDocs를 의존성으로 추가 project.afterEvaluate { - project.tasks.findByName("check")?.dependsOn(checkAllDocsTaskName) - project.logger.lifecycle("${project.name}의 check 태스크에 ${checkAllDocsTaskName} 의존성을 추가했습니다.") + project.tasks.findByName("check")?.dependsOn(CHECK_ALL_DOCS_TASK) + project.logger.lifecycle("${project.name}의 check 태스크에 ${CHECK_ALL_DOCS_TASK} 의존성을 추가했습니다.") } } + companion object { + const val CHECK_ALL_DOCS_TASK = "checkAllDocs" + } } From 81c3a1e1bf4b96841723a5a8aa829729474ae8cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A3=BC=EC=9B=90?= Date: Sun, 11 May 2025 19:03:05 +0900 Subject: [PATCH 11/14] =?UTF-8?q?refactor=20(=20#11=20)=20:=20Convention?= =?UTF-8?q?=20Plugin=EC=9D=B4=20=EC=9D=B4=EB=AF=B8=20=EC=B2=98=EB=A6=AC?= =?UTF-8?q?=ED=95=98=EB=AF=80=EB=A1=9C=20=EC=A4=91=EB=B3=B5=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8da22895..9c523ddf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,7 @@ plugins { - // 플러그인 순서 최적화: 기본 플러그인이 먼저 적용되도록 함 - id("java") // 먼저 java 플러그인 적용 kotlin("jvm") version "1.9.23" id("org.jlleitschuh.gradle.ktlint").version("12.1.1") id("io.gitlab.arturbosch.detekt") version "1.23.6" - // 마지막에 커스텀 플러그인 적용 id("casper.documentation-convention") } @@ -14,12 +11,6 @@ subprojects { repositories { mavenCentral() } - - // 서브프로젝트 경로 출력 (디버깅용) - logger.lifecycle("서브프로젝트 경로: ${this.path}, 이름: ${this.name}") - - // 모든 서브프로젝트에 문서화 플러그인 적용 - apply(plugin = "casper.documentation-convention") } tasks.register("checkAll") { From 043a49203ded7e5611bac424643a81e740a759f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A3=BC=EC=9B=90?= Date: Sun, 11 May 2025 20:15:02 +0900 Subject: [PATCH 12/14] =?UTF-8?q?refactor=20(=20#11=20)=20:=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=20=EB=B6=84=EB=A6=AC=EB=A1=9C=20=EB=AA=A9?= =?UTF-8?q?=EC=A0=81=20=EC=97=AD=ED=95=A0=20=EB=AA=85=ED=99=95=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/DocumentationConventionPlugin.kt | 57 ++++++++++++++++--- 1 file changed, 48 insertions(+), 9 deletions(-) diff --git a/casper-convention/src/main/kotlin/io/casper/convention/plugins/DocumentationConventionPlugin.kt b/casper-convention/src/main/kotlin/io/casper/convention/plugins/DocumentationConventionPlugin.kt index 816bb088..731f96ff 100644 --- a/casper-convention/src/main/kotlin/io/casper/convention/plugins/DocumentationConventionPlugin.kt +++ b/casper-convention/src/main/kotlin/io/casper/convention/plugins/DocumentationConventionPlugin.kt @@ -11,20 +11,35 @@ import org.gradle.kotlin.dsl.register /** * Casper 프로젝트의 KDoc 문서화 규칙을 정의하는 Gradle 플러그인입니다. + * 코드 요소(클래스, 함수, 프로퍼티 등)에 KDoc 주석이 있는지 확인하는 태스크를 제공합니다. */ class DocumentationConventionPlugin : Plugin { + /** + * 플러그인을 프로젝트에 적용합니다. + * 각 코드 요소별 문서화 확인 태스크와 통합 태스크를 등록하고, 빌드 라이프사이클에 연결합니다. + * + * @param project 플러그인이 적용될 프로젝트 + */ override fun apply(project: Project) { project.logger.lifecycle("문서화 규칙 플러그인을 적용합니다: ${project.name}") - registerDocCheckTasks(project) + val registeredTasks = registerIndividualDocCheckTasks(project) + registerAggregateTask(project, registeredTasks) + connectToCheckLifecycle(project) } - - private fun registerDocCheckTasks(project: Project) { + /** + * 각 코드 요소(클래스, 함수, 프로퍼티 등)별로 개별 문서화 확인 태스크를 등록합니다. + * DocCheckTaskType에 정의된 각 유형에 대해 DocCheckTask를 생성합니다. + * + * @param project 태스크가 등록될 프로젝트 + * @return 등록된 태스크 프로바이더 목록 + */ + private fun registerIndividualDocCheckTasks(project: Project): List> { val registeredTasks = mutableListOf>() DocCheckTaskType.values().forEach { taskType -> val taskName = taskType.taskName - + // 이미 같은 이름의 태스크가 있는지 확인 if (project.tasks.findByName(taskName) == null) { val task = project.tasks.register(taskName) { @@ -39,27 +54,51 @@ class DocumentationConventionPlugin : Plugin { registeredTasks.add(project.tasks.named(taskName)) } } + return registeredTasks + } + /** + * 모든 개별 문서화 확인 태스크를 한 번에 실행하는 통합 태스크를 등록합니다. + * 이 태스크는 모든 개별 태스크에 의존하므로, 하나의 명령으로 모든 확인을 실행할 수 있습니다. + * + * @param project 태스크가 등록될 프로젝트 + * @param individualTasks 의존할 개별 태스크 목록 + */ + private fun registerAggregateTask(project: Project, individualTasks: List>) { // 모든 문서화 검사를 한 번에 실행하는 태스크 if (project.tasks.findByName(CHECK_ALL_DOCS_TASK) == null) { project.tasks.register(CHECK_ALL_DOCS_TASK) { group = DocConstants.CHECK_GROUP description = "모든 코드 요소의 KDoc 주석 여부를 확인합니다" - + // 등록된 모든 검사 태스크에 의존 - dependsOn(registeredTasks) + dependsOn(individualTasks) } project.logger.lifecycle("${project.name}에 ${CHECK_ALL_DOCS_TASK} 태스크를 등록했습니다.") } - + } + + /** + * 문서화 확인 태스크를 프로젝트의 기본 check 태스크에 연결합니다. + * 이를 통해 일반적인 빌드 라이프사이클에 문서화 확인이 포함됩니다. + * + * @param project 연결될 프로젝트 + */ + private fun connectToCheckLifecycle(project: Project) { // 프로젝트 평가 후에 check 태스크가 있으면 checkAllDocs를 의존성으로 추가 project.afterEvaluate { project.tasks.findByName("check")?.dependsOn(CHECK_ALL_DOCS_TASK) project.logger.lifecycle("${project.name}의 check 태스크에 ${CHECK_ALL_DOCS_TASK} 의존성을 추가했습니다.") } - } + + /** + * 플러그인 내에서 사용되는 상수 값들을 정의합니다. + */ companion object { + /** + * 모든 문서화 확인 태스크를 실행하는 통합 태스크의 이름입니다. + */ const val CHECK_ALL_DOCS_TASK = "checkAllDocs" } -} +} \ No newline at end of file From ea05fc2c56f58ec32fbc4e1e4937578a17981ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A3=BC=EC=9B=90?= Date: Sun, 11 May 2025 20:19:51 +0900 Subject: [PATCH 13/14] =?UTF-8?q?refactor=20(=20#11=20)=20:=20=EB=B6=88?= =?UTF-8?q?=ED=95=84=EC=9A=94=ED=95=9C=20=EB=A3=A8=ED=8A=B8=20gradle.kts?= =?UTF-8?q?=20dependencies=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9c523ddf..c66d9e0d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -38,11 +38,6 @@ java { } } -dependencies { - testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") - testRuntimeOnly("org.junit.platform:junit-platform-launcher") -} - tasks.withType { useJUnitPlatform() } From e15cea938d158565c48dca2a91803982ee17aef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A3=BC=EC=9B=90?= Date: Sun, 11 May 2025 20:36:14 +0900 Subject: [PATCH 14/14] =?UTF-8?q?feat=20(=20#11=20)=20:=20TestClass=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entrydsm/application/CasperApplicationTests.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 casper-application-infrastructure/src/test/kotlin/hs/kr/entrydsm/application/CasperApplicationTests.kt diff --git a/casper-application-infrastructure/src/test/kotlin/hs/kr/entrydsm/application/CasperApplicationTests.kt b/casper-application-infrastructure/src/test/kotlin/hs/kr/entrydsm/application/CasperApplicationTests.kt new file mode 100644 index 00000000..10aafbd2 --- /dev/null +++ b/casper-application-infrastructure/src/test/kotlin/hs/kr/entrydsm/application/CasperApplicationTests.kt @@ -0,0 +1,12 @@ +package hs.kr.entrydsm.application + +import org.junit.jupiter.api.Test +import org.springframework.boot.test.context.SpringBootTest + +@SpringBootTest +class CasperApplicationTests { + + @Test + fun contextLoads() { + } +} \ No newline at end of file