[Refactor/#200] Gradle 설정 최신화 및 앱 버전 관리 아키텍처 개선#202
Conversation
- compileSdk/targetSdk 35 → 36 - AGP 8.10.1 → 9.1.0 - Kotlin 2.1.20 → 2.3.0, KSP 2.3.6 - Hilt 2.56.2 → 2.59.2 - Compose BOM 2025.06.00 → 2026.03.00 - 기타 AndroidX, Coroutines, Serialization 등 최신화
- ApplicationId.kt 삭제, Extensions.kt 추가하여 namespace 자동 계산 로직 통합 - KotlinSerializationPlugin, KotlinParcelizePlugin 신규 추가 - AppVersion: ApplicationExtension 파라미터 직접 전달 방식으로 변경, LibraryExtension의 불필요한 버전 BuildConfig 필드 제거 - ktlint를 allprojects 대신 각 convention plugin에서 적용하도록 이전 - 각 모듈 build.gradle.kts에서 namespace 명시 제거 (자동 계산으로 대체)
- AndroidApplicationVersionNameProvider 삭제 (BuildConfig 직접 참조 제거) - PackageManagerVersionNameProvider 추가: PackageManager로 런타임에 버전명 조회 - AppVersionModule 추가: app BuildConfig의 버전 정수를 @nAmed로 제공 - VersionDataSourceImpl: BuildConfig 직접 참조 → @nAmed 주입 방식으로 변경 - PlayStoreUtils: BuildConfig.APPLICATION_ID → activity.packageName으로 변경 - data, presentation 모듈의 불필요한 buildConfig 블록 제거
androidx.hilt.navigation.compose.hiltViewModel → androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
Walkthrough앱 설치 위치를 Changes
Sequence Diagram(s)sequenceDiagram
participant AppModule as 앱 모듈 (BuildConfig)
participant HiltModule as AppVersionModule (Hilt)
participant DataSource as VersionDataSourceImpl
participant VersionSvc as VersionService
AppModule->>HiltModule: BuildConfig.VERSION_MAJOR/MINOR/PATCH 읽음
HiltModule->>DataSource: `@Named` 주입 (versionMajor/minor/patch)
DataSource->>VersionSvc: checkVersion(major, minor, patch)
VersionSvc-->>DataSource: 결과 반환
sequenceDiagram
participant Activity as Activity
participant PlayStoreUtils as PlayStoreUtils
participant IntentMgr as Intent/PackageManager
Activity->>PlayStoreUtils: openAppInPlayStore()
PlayStoreUtils->>Activity: activity.packageName 조회
PlayStoreUtils->>IntentMgr: createPlayStoreIntent(packageName) / createWebIntent(packageName)
IntentMgr->>Activity: Play Store 또는 웹으로 인텐트 실행 시도
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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: 5
🧹 Nitpick comments (1)
build-logic/convention/src/main/java/com/threegap/bitnagil/convention/extension/Extensions.kt (1)
14-15: namespace 계산은 전체 Gradle path를 반영하는 편이 더 안전합니다.지금 식이면
:core:datastore가com.threegap.bitnagil.datastore로 평탄화되어 중간 경로 정보가 사라집니다. 현재settings.gradle.kts에 이미:core:*구조가 있으니, 전체 path를 점 표기 형태로 바꿔 계산하면 namespace drift와 향후 충돌 가능성을 줄일 수 있습니다.♻️ 제안 수정
internal val Project.namespace: String - get() = if (path == ":app") basePackage else "$basePackage.${name.replace("-", "_")}" + get() = if (path == ":app") { + basePackage + } else { + "$basePackage.${path.removePrefix(":").replace(":", ".").replace("-", "_")}" + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@build-logic/convention/src/main/java/com/threegap/bitnagil/convention/extension/Extensions.kt` around lines 14 - 15, The current Project.namespace getter flattens multi-module paths by using name and loses intermediate path segments; change it to compute namespace from the full Gradle path (Project.path) by removing the leading ":" and replacing ":" with "." and hyphens with underscores, then prefix with basePackage (while preserving the special-case for ":app" to return basePackage); update the getter for the Project.namespace property (refer to path, basePackage, name) to build namespace = "$basePackage.${sanitizedFullPath}" where sanitizedFullPath is path without leading ":" with ":"→"." and "-"→"_" transformations.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/src/main/java/com/threegap/bitnagil/MainNavHost.kt`:
- Line 5: The new import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
is from the separate artifact (androidx.hilt:hilt-lifecycle-viewmodel-compose)
which isn't declared in gradle/libs.versions.toml and so causes compile errors
in files using hiltViewModel (e.g., MainNavHost.kt and the listed presentation
screens); add the artifact entry to gradle/libs.versions.toml and then add the
dependency to modules that use hiltViewModel (or update
build-logic/HiltPlugin.kt or AndroidComposePlugin.kt to inject it) so each
affected module's build.gradle.kts includes
implementation(libs.compose.hilt.lifecycle.viewmodel) to satisfy the import.
In
`@build-logic/convention/src/main/java/com/threegap/bitnagil/convention/AndroidApplicationPlugin.kt`:
- Around line 15-19: The build fails because the Kotlin Android plugin is not
applied: update the plugin application block in AndroidApplicationPlugin (and
mirror the same change in AndroidLibraryPlugin) to also apply
"org.jetbrains.kotlin.android" so that configureKotlinAndroid() can locate the
KotlinAndroidProjectExtension; ensure the apply sequence includes
"org.jetbrains.kotlin.android" alongside "com.android.application" and
"org.jetbrains.kotlin.plugin.compose" before calling configureKotlinAndroid().
In
`@build-logic/convention/src/main/java/com/threegap/bitnagil/convention/AndroidLibraryPlugin.kt`:
- Around line 12-15: The convention plugin applies the external ktlint plugin
but doesn't add it to the convention classpath; update the convention module's
dependencies block to include ktlint as a compileOnly dependency (e.g., add
libs.ktlint) so the external plugin is available at runtime, and make the same
change for the other convention plugin modules that apply ktlint:
KotlinJvmPlugin and AndroidApplicationPlugin; locate the pluginManager.apply {
apply("org.jlleitschuh.gradle.ktlint") } usage inside AndroidLibraryPlugin,
KotlinJvmPlugin, and AndroidApplicationPlugin and ensure each corresponding
build-logic convention build.gradle.kts adds compileOnly(libs.ktlint) in its
dependencies.
In
`@presentation/src/main/java/com/threegap/bitnagil/presentation/screen/terms/TermsAgreementScreen.kt`:
- Line 16: The import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel is
unresolved because the artifact
androidx.hilt:hilt-lifecycle-viewmodel-compose:1.3.0 is not declared; add the
artifact entry to your dependency catalog (gradle/libs.versions.toml) with
version 1.3.0, then add a dependency on that catalog coordinate in the
presentation module's build.gradle.kts so TermsAgreementScreen.kt (and the other
16 files) can resolve hiltViewModel; note this is the Hilt-specific artifact
(not androidx.lifecycle:lifecycle-viewmodel-compose).
In
`@presentation/src/main/java/com/threegap/bitnagil/presentation/util/playstore/PlayStoreUtils.kt`:
- Around line 51-57: The current tryOpenWebBrowser function swallows all
Exceptions which hides real issues; change its error handling to only catch
ActivityNotFoundException (so fallback returns false when no browser/activity
exists) and let other exceptions (e.g., SecurityException, malformed Intent from
createWebIntent) surface or be logged; specifically update
tryOpenWebBrowser(ComponentActivity, packageName) to catch
ActivityNotFoundException and return false, and for any other thrown exception
either rethrow or log it via the existing logging mechanism so failures are
visible for debugging.
---
Nitpick comments:
In
`@build-logic/convention/src/main/java/com/threegap/bitnagil/convention/extension/Extensions.kt`:
- Around line 14-15: The current Project.namespace getter flattens multi-module
paths by using name and loses intermediate path segments; change it to compute
namespace from the full Gradle path (Project.path) by removing the leading ":"
and replacing ":" with "." and hyphens with underscores, then prefix with
basePackage (while preserving the special-case for ":app" to return
basePackage); update the getter for the Project.namespace property (refer to
path, basePackage, name) to build namespace =
"$basePackage.${sanitizedFullPath}" where sanitizedFullPath is path without
leading ":" with ":"→"." and "-"→"_" transformations.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6038c818-d680-4639-a523-8217d5361684
📒 Files selected for processing (47)
app/src/main/AndroidManifest.xmlapp/src/main/java/com/threegap/bitnagil/MainNavHost.ktapp/src/main/java/com/threegap/bitnagil/di/data/AppVersionModule.ktapp/src/main/java/com/threegap/bitnagil/di/presentation/VersionNameProviderModule.ktapp/src/main/java/com/threegap/bitnagil/util/version/PackageManagerVersionNameProvider.ktbuild-logic/convention/build.gradle.ktsbuild-logic/convention/src/main/java/com/threegap/bitnagil/convention/AndroidApplicationPlugin.ktbuild-logic/convention/src/main/java/com/threegap/bitnagil/convention/AndroidComposePlugin.ktbuild-logic/convention/src/main/java/com/threegap/bitnagil/convention/AndroidLibraryPlugin.ktbuild-logic/convention/src/main/java/com/threegap/bitnagil/convention/HiltPlugin.ktbuild-logic/convention/src/main/java/com/threegap/bitnagil/convention/KotlinJvmPlugin.ktbuild-logic/convention/src/main/java/com/threegap/bitnagil/convention/KotlinParcelizePlugin.ktbuild-logic/convention/src/main/java/com/threegap/bitnagil/convention/KotlinSerializationPlugin.ktbuild-logic/convention/src/main/java/com/threegap/bitnagil/convention/extension/AppVersion.ktbuild-logic/convention/src/main/java/com/threegap/bitnagil/convention/extension/ApplicationId.ktbuild-logic/convention/src/main/java/com/threegap/bitnagil/convention/extension/ComposeAndroid.ktbuild-logic/convention/src/main/java/com/threegap/bitnagil/convention/extension/Extensions.ktbuild-logic/convention/src/main/java/com/threegap/bitnagil/convention/extension/KotlinAndroid.ktbuild-logic/convention/src/main/java/com/threegap/bitnagil/convention/extension/KotlinCoroutine.ktbuild.gradle.ktscore/datastore/build.gradle.ktscore/designsystem/build.gradle.ktscore/network/build.gradle.ktscore/security/build.gradle.ktsdata/build.gradle.ktsdata/src/main/java/com/threegap/bitnagil/data/version/datasourceImpl/VersionDataSourceImpl.ktdomain/build.gradle.ktsgradle/libs.versions.tomlgradle/wrapper/gradle-wrapper.propertiespresentation/build.gradle.ktspresentation/src/main/java/com/threegap/bitnagil/presentation/screen/emotion/EmotionScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/screen/guide/GuideScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/screen/home/HomeScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/screen/login/LoginScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/screen/mypage/MyPageScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/screen/onboarding/OnBoardingScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/screen/recommendroutine/RecommendRoutineScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/screen/reporthistory/ReportHistoryScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/screen/reportwrite/ReportWriteScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/screen/routinelist/RoutineListScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/screen/routinewrite/RoutineWriteScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/screen/setting/SettingScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/screen/splash/SplashScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/screen/terms/TermsAgreementScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/screen/withdrawal/WithdrawalScreen.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/util/playstore/PlayStoreUtils.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/util/version/AndroidApplicationVersionNameProvider.kt
💤 Files with no reviewable changes (6)
- core/datastore/build.gradle.kts
- build.gradle.kts
- core/network/build.gradle.kts
- core/security/build.gradle.kts
- presentation/src/main/java/com/threegap/bitnagil/presentation/util/version/AndroidApplicationVersionNameProvider.kt
- build-logic/convention/src/main/java/com/threegap/bitnagil/convention/extension/ApplicationId.kt
[ PR Content ]
Gradle 설정 최신화(8.10.1 → 9.1.0), Convention Plugin 구조 개선, 앱 버전 관리 아키텍처 개선을 진행했습니다..!
Related issue
Screenshot 📸
Work Description
Gradle 설정 최신화
Convention Plugin 구조 개선
ApplicationId.kt삭제 →Extensions.kt로 통합, namespace 자동 계산KotlinSerializationPlugin,KotlinParcelizePlugin분리allprojects의 ktlint 적용 → 각 Plugin 내 명시적 적용으로 이전 (Configuration Cache 호환성 확보)AppVersion:LibraryExtension버전 BuildConfig 제거,ApplicationExtension직접 전달앱 버전 관리 아키텍처 개선
VersionNameProvider구현체를PackageManager기반으로 교체 (app 모듈로 이동)buildConfig = true블록 제거To Reviewers 📢
Summary by CodeRabbit
릴리스 노트