Conversation
feature 모듈 분리를 위한 Gradle Convention Plugin 구조를 구축했습니다. - KMP, Android, Compose 설정을 중앙화하여 일관된 빌드 환경 제공 - 향후 feature 모듈 생성 시 반복적인 설정 작업 최소화 🤖 Generated with [Firebender](https://firebender.com) Co-Authored-By: Firebender <help@firebender.com>
DroidKnights 프로젝트 구조를 참조하여 build-logic을 개선했습니다. - primitive 패키지로 세분화된 플러그인 구조 구현 - Extension 유틸리티 함수로 깔끔한 코드 작성 - Feature 모듈용 통합 플러그인(droidmorning.feature) 추가 - Compose 의존성을 함수로 분리하여 재사용성 향상 🤖 Generated with [Firebender](https://firebender.com) Co-Authored-By: Firebender <help@firebender.com>
libs.versions.toml의 Gradle 플러그인 설정을 수정했습니다. - compose-gradle-plugin을 정확한 artifact로 변경 (org.jetbrains.compose:compose-gradle-plugin) - compose-compiler-gradle-plugin 별도 추가 - freeCompilerArgs를 compilerOptions DSL로 마이그레이션 🤖 Generated with [Firebender](https://firebender.com) Co-Authored-By: Firebender <help@firebender.com>
composeDependencies.uiTooling과 composeDependencies.preview가 deprecated되어 직접 모듈 참조로 변경했습니다. - org.jetbrains.compose.ui:ui-tooling 직접 사용 - preview는 ui-tooling에 포함되어 제거 🤖 Generated with [Firebender](https://firebender.com) Co-Authored-By: Firebender <help@firebender.com>
기존 프로젝트 모듈들을 분석하여 Feature 플러그인을 개선했습니다. **주요 변경사항:** - JVM 타겟을 17에서 11로 변경 (프로젝트 표준) - compileSdk 35 → 36, minSdk 26 → 24 통일 - kotlin-serialization 플러그인 추가 - Koin 의존성을 bundle로 변경 (core, compose, compose-viewmodel) - Kotlinx 핵심 라이브러리 추가 (coroutines, serialization, datetime) - lifecycle-viewmodel-compose 추가 - commonTest 의존성 설정 추가 (kotlin-test, koin-test, coroutines-test) 🤖 Generated with [Firebender](https://firebender.com) Co-Authored-By: Firebender <help@firebender.com>
- Convention Plugin 패키지 구조 평탄화 (app/ 디렉토리 제거) - Extension 함수들을 extentions 패키지로 분리 - VersionCatalogExtensions 추가하여 타입 안전성 개선 - ComposeExtensions를 ProjectExtensions에 통합 - README 문서 업데이트 (모듈화 가이드 개선) - Gradle 메모리 설정 최적화 🤖 Generated with [Firebender](https://firebender.com) Co-Authored-By: Firebender <help@firebender.com>
📝 WalkthroughWalkthroughbuild-logic 모듈이 새로 추가되어 Gradle Convention Plugin을 중앙화합니다. build-logic/convention/build.gradle.kts에서 Java/Kotlin 타겟을 정렬하고 compileOnly 종속성을 추가한 뒤, gradlePlugin 블록으로 7개의 공개 플러그인(droidmorning.kmp, droidmorning.kmp.android, droidmorning.kmp.ios, droidmorning.android.library, droidmorning.kotlin.multiplatform, droidmorning.compose.multiplatform, droidmorning.feature)을 등록합니다. 다수의 Kotlin 기반 Convention Plugin 클래스(KotlinMultiPlatformPlugin, KotlinMultiPlatformAndroidPlugin, KotlinMultiPlatformiOSPlugin, AndroidLibraryConventionPlugin, ComposeMultiplatformConventionPlugin, DroidMorningFeaturePlugin)와 유틸 확장(ProjectExtensions, VersionCatalogExtensions)이 추가되었습니다. settings.gradle.kts에 includeBuild("build-logic")가 추가되고 build-logic/settings.gradle.kts 및 gradle/libs.versions.toml이 갱신되며 gradle.properties의 JVM 옵션과 병렬 빌드 설정이 변경되었습니다. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 📋 상세 리뷰긍정적 요약
개선할 점 (왜 문제가 되는지 → 어떻게 개선할지)
확인/토론용 질문
제안(추가 안전장치)
전반적으로 중앙화된 빌드 로직과 유틸성 확장은 좋은 출발입니다. 위 개선사항을 반영하면 안정성과 유지보수성이 더 향상될 것입니다. 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Fix all issues with AI agents
In
`@build-logic/convention/src/main/kotlin/com/peto/droidmorning/extentions/ProjectExtensions.kt`:
- Around line 33-46: composeMultiplatformDependencies 함수에서 순수 KMP 모듈에는
"debugImplementation" 구성이 없을 수 있어 빌드가 깨집니다; dependencies 블록을 호출하기 전에
Project.configurations.findByName("debugImplementation")로 해당 구성이 존재하는지 검사하고 존재할
때만 "debugImplementation"(libs.library("compose-ui-tooling"))를 추가하도록 변경하세요; 위치는
Project.composeMultiplatformDependencies 내 dependencies 추가 부분이며
KotlinMultiplatformExtension 설정은 그대로 유지하면 됩니다.
In
`@build-logic/convention/src/main/kotlin/com/peto/droidmorning/KotlinMultiPlatformPlugin.kt`:
- Around line 18-21: Remove the direct application of the "kotlin-multiplatform"
plugin from KotlinMultiPlatformPlugin so it becomes configuration-only: delete
the apply(libs.plugin("kotlin-multiplatform").pluginId) call inside
KotlinMultiPlatformPlugin and keep only the
extensions.configure<KotlinMultiplatformExtension> { ... } setup logic; in
contrast, ensure KotlinMultiplatformConventionPlugin is the single place that
applies the plugin and then applies the configuration plugin (use
apply(libs.plugin("kotlin-multiplatform").pluginId) in
KotlinMultiplatformConventionPlugin followed by
apply<KotlinMultiPlatformPlugin>() so convention applies the plugin and
KotlinMultiPlatformPlugin only provides settings), and update any references
like DroidMorningFeaturePlugin to rely on the convention plugin for plugin
application.
In `@build-logic/README.md`:
- Around line 95-99: The README's Android Library settings are out of sync with
the implementation; update the documentation to match the actual values declared
in AndroidLibraryConventionPlugin.kt (e.g., compileSdk = 36, minSdk = 24, Java
compatibility = Java 11 / JavaVersion.VERSION_11, BuildConfig enabled) or
alternately change the implementation in AndroidLibraryConventionPlugin (the
class and its compileSdk/minSdk/Java compatibility assignments) to match the
README—pick one approach and make both sources consistent.
- Around line 64-66: The README claims "Android target (JVM 17)" but the
implementation in KotlinMultiPlatformAndroidPlugin.kt and
KotlinMultiPlatformPlugin.kt sets JvmTarget.JVM_11; fix by making doc and code
consistent: either update the README to state JVM 11 or change the JvmTarget
usage in the KotlinMultiPlatformAndroidPlugin and KotlinMultiPlatformPlugin
classes from JvmTarget.JVM_11 to JvmTarget.JVM_17 (and adjust any related
compilation settings), ensuring the JvmTarget symbol and any target
compatibility settings are updated together.
- Around line 283-301: Update the README directory tree to reflect the actual
package layout after the "package flattening" change: replace occurrences of
com/peto/droidmorning/app/ with com/peto/droidmorning/, remove or relocate the
primitive/ subsection (or list its files at the top-level) so entries like
KotlinMultiPlatformPlugin.kt, KotlinMultiPlatformAndroidPlugin.kt, and
KotlinMultiPlatformiOSPlugin.kt match their real locations, and ensure the
example file list (AndroidLibraryConventionPlugin.kt,
KotlinMultiplatformConventionPlugin.kt, ComposeMultiplatformConventionPlugin.kt,
DroidMorningFeaturePlugin.kt) reflects the current package structure exactly.
In `@gradle/libs.versions.toml`:
- Around line 67-68: Remove the obsolete compose-compiler-gradle-plugin entry
from libs.versions.toml (the entry named compose-compiler-gradle-plugin) because
Kotlin 2.3.0 uses org.jetbrains.kotlin.plugin.compose (the kotlin-compose entry
already defined) instead; leave compose-gradle-plugin in place and, if you
prefer not to delete, replace the entry with a short “deprecated/unused” comment
to make the intent explicit and avoid confusion about compatibility with Kotlin
2.3.0 and Compose Multiplatform 1.10.0.
🧹 Nitpick comments (8)
gradle.properties (1)
6-9: 병렬 빌드 + Xmx 8g 조합의 메모리 여유 확인을 권장합니다.왜: 병렬 빌드와 큰 힙 설정이 겹치면 CI/로컬 환경에서 OOM로 불안정해질 수 있습니다.
어떻게: CI에 맞춰org.gradle.workers.max로 상한을 두거나, 환경별~/.gradle/gradle.properties오버라이드를 안내하는 방식이 안정적입니다. 필요하면 팀 문서에 최소 메모리 요구사항도 적어두는 게 좋겠습니다.build-logic/convention/src/main/kotlin/com/peto/droidmorning/AndroidLibraryConventionPlugin.kt (1)
16-25: SDK 버전과 플러그인 ID를 버전 카탈로그로 통일하면 중복을 줄일 수 있습니다.왜: 다른 플러그인에서는
libs.version("compileSdk")/minSdk를 쓰고 있어 한 곳만 하드코딩하면 추후 버전 변경 시 불일치가 생기기 쉽습니다.
어떻게: 아래처럼 버전 카탈로그를 사용해 단일 소스로 맞추는 것을 권장합니다. 코딩 가이드 기준입니다.♻️ 제안 변경
- with(pluginManager) { - apply("com.android.library") - } + with(pluginManager) { + apply(libs.plugin("android-library").pluginId) + } extensions.configure<LibraryExtension> { - compileSdk = 36 + compileSdk = libs.version("compileSdk").toInt() defaultConfig { - minSdk = 24 + minSdk = libs.version("minSdk").toInt() }build-logic/convention/src/main/kotlin/com/peto/droidmorning/KotlinMultiplatformConventionPlugin.kt (1)
15-21:kotlin-multiplatform적용이 중복됩니다.왜: 여기서 한 번 적용하고,
KotlinMultiPlatformPlugin에서도 다시 적용하면 책임 경계가 흐려져 추후 설정 순서/중복 판단이 어려워집니다.
어떻게: 둘 중 한 곳만 적용하도록 정리하면 더 명확합니다(권장:KotlinMultiPlatformPlugin내부에만 두고 여기서는 제거). 코딩 가이드 기준입니다.♻️ 제안 변경
- with(pluginManager) { - apply(libs.plugin("kotlin-multiplatform").pluginId) - } - apply<KotlinMultiPlatformPlugin>() apply<KotlinMultiPlatformAndroidPlugin>() apply<KotlinMultiPlatformiOSPlugin>()build-logic/convention/src/main/kotlin/com/peto/droidmorning/KotlinMultiPlatformAndroidPlugin.kt (1)
19-29: Version Catalog 접근 방식이 일관되지 않습니다.
compileSdk는libs.version("compileSdk")를 사용하지만,minSdk는libs.findVersion("minSdk").get().requiredVersion을 직접 호출하고 있습니다.VersionCatalogExtensions.kt에 정의된version()확장 함수를 일관되게 사용하면 코드가 더 깔끔해집니다.♻️ 일관된 API 사용 제안
defaultConfig { - minSdk = libs.findVersion("minSdk").get().requiredVersion.toInt() + minSdk = libs.version("minSdk").toInt() }build-logic/convention/src/main/kotlin/com/peto/droidmorning/DroidMorningFeaturePlugin.kt (1)
21-33:ComposeMultiplatformConventionPlugin과 설정이 중복됩니다.현재
DroidMorningFeaturePlugin에서 직접compose-multiplatform,kotlin-compose플러그인을 적용하고composeMultiplatformDependencies()를 호출하고 있습니다. 이는ComposeMultiplatformConventionPlugin이 수행하는 작업과 동일합니다.중복을 제거하고 재사용성을 높이려면
ComposeMultiplatformConventionPlugin을 적용하는 방식을 고려해 보세요:♻️ 컨벤션 플러그인 재사용 제안
with(pluginManager) { apply(libs.plugin("android-library").pluginId) apply(libs.plugin("kotlin-multiplatform").pluginId) - apply(libs.plugin("compose-multiplatform").pluginId) - apply(libs.plugin("kotlin-compose").pluginId) apply(libs.plugin("kotlin-serialization").pluginId) } apply<KotlinMultiPlatformPlugin>() apply<KotlinMultiPlatformAndroidPlugin>() apply<KotlinMultiPlatformiOSPlugin>() +apply<ComposeMultiplatformConventionPlugin>() -composeMultiplatformDependencies()build-logic/convention/src/main/kotlin/com/peto/droidmorning/extentions/VersionCatalogExtensions.kt (1)
1-1: 패키지 이름에 오타가 있습니다.
extentions→extensions로 수정하는 것이 좋습니다. 이 오타는ProjectExtensions.kt와 README.md의 디렉토리 구조에서도 동일하게 나타납니다. 나중에 수정하려면 여러 파일을 변경해야 하므로, 지금 수정하는 것이 좋을 수 있습니다.build-logic/README.md (1)
112-128: 코드 블록에 언어를 지정하면 linting 경고를 해결할 수 있습니다.정적 분석 도구(markdownlint)가 언어가 지정되지 않은 코드 블록을 감지했습니다. 디렉토리 구조를 표시하는 블록에는
text또는plaintext를 사용할 수 있습니다.📝 수정 예시
-``` +```text 📁 build-logic // Convention Plugin 📁 app // Application 진입점 ...build-logic/convention/src/main/kotlin/com/peto/droidmorning/extentions/ProjectExtensions.kt (1)
23-27: 예외 기반 흐름 제어/println 대신findByType+ 명확한 오류를 권장합니다.
runCatching+println은 구성 단계에서 불필요한 예외/표준출력을 유발할 수 있습니다.findByType로 분기하고 명확한 오류를 내는 편이 더 읽기 쉽고 로그 품질도 좋아집니다.♻️ 제안 수정안
internal val Project.androidExtension: CommonExtension<*, *, *, *, *, *> - get() = runCatching { libraryExtension } - .recoverCatching { applicationExtension } - .onFailure { println("Could not find Library or Application extension from this project") } - .getOrThrow() + get() = extensions.findByType<LibraryExtension>() + ?: extensions.findByType<ApplicationExtension>() + ?: error("Could not find Library or Application extension from this project")
build-logic/convention/src/main/kotlin/com/peto/droidmorning/extentions/ProjectExtensions.kt
Show resolved
Hide resolved
build-logic/convention/src/main/kotlin/com/peto/droidmorning/KotlinMultiPlatformPlugin.kt
Outdated
Show resolved
Hide resolved
🤖 Generated with [Firebender](https://firebender.com) Co-Authored-By: Firebender <help@firebender.com>
🤖 Generated with [Firebender](https://firebender.com) Co-Authored-By: Firebender <help@firebender.com>
🤖 Generated with [Firebender](https://firebender.com) Co-Authored-By: Firebender <help@firebender.com>
이슈 번호
#38
작업내용
settings.gradle.kts에includeBuild("build-logic")연결debugImplementation가드 추가gradle.properties빌드 성능/메모리 옵션 정비gradle/libs.versions.toml에 droidmorning 플러그인 ID 등록