Skip to content

빌드/배포

Gradle 구성

SDK 버전

항목
compileSdk36
minSdk29
targetSdk36
Java/JVM Target21

기본 설정 (gradle.properties)

항목설명
JVM 메모리-Xmx16g최대 힙 크기 16GB
MaxMetaspaceSize1gMetaspace 최대 1GB
GC 정책UseParallelGCParallel Garbage Collector
Workersorg.gradle.workers.max=8최대 8개 병렬 워커
Configuration Cacheorg.gradle.configuration-cache=trueGradle Configuration Cache 활성화
Build Cacheorg.gradle.caching=trueGradle Build Cache 활성화
Parallel Buildorg.gradle.parallel=true병렬 빌드 활성화
properties
compileSdk=36
minSdk=29
targetSdk=36

android.useAndroidX=true
android.nonTransitiveRClass=true

# JVM Options
org.gradle.jvmargs=-Xmx16g -XX:MaxMetaspaceSize=1g -XX:+UseParallelGC \
  -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError

# Cache, Parallel Build
org.gradle.configuration-cache=true
org.gradle.unsafe.configuration-cache-problems=warn
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.workers.max=8

# Kotlin
kotlin.code.style=official

정보

Configuration Cache가 활성화되어 있어 반복 빌드 시 크게 빠른 성능을 제공합니다. unsafe.configuration-cache-problems=warn으로 설정하여 호환성 문제를 경고만 표시합니다.

Version Catalog (gradle/libs.versions.toml)

모든 의존성 버전은 Version Catalog를 통해 중앙 관리됩니다.

구조

toml
kotlin = "2.3.0"
hilt = "2.59"
retrofit = "3.0.0"
okhttp = "5.2.1"
composeBom = "2025.10.01"
room = "2.8.3"
coil = "3.3.0"
# ...

Build Flavors

FlavorsConventionPlugin을 통해 두 가지 Build Flavor를 정의합니다:

FlavorDimensionApplication ID Suffix용도
devcontentType.dev개발/Sandbox 환경
prodcontentType(없음)프로덕션 환경
kotlin
enum class AppFlavor(val dimension: FlavorDimension, val applicationIdSuffix: String? = null) {
    dev(FlavorDimension.contentType, applicationIdSuffix = ".dev"),
    prod(FlavorDimension.contentType)
}

Build Types

Build TypeminifySigning특징
debugfalsedebug.jksapplicationIdSuffix = ".debug"
releasetrue (R8)release keystore (환경 변수)ProGuard + ndk debugSymbolLevel

Build Variant 조합:

VariantApplication ID설명
devDebugco.butbeautiful.truloop.dev.debug개발 + 디버그
devReleaseco.butbeautiful.truloop.dev개발 + 릴리즈
prodDebugco.butbeautiful.truloop.debug프로덕션 + 디버그
prodReleaseco.butbeautiful.truloop프로덕션 + 릴리즈

버전 관리

version.properties

프로젝트 루트의 version.properties 파일에서 버전을 관리합니다:

properties
VERSION_MAJOR=1
VERSION_MINOR=16
VERSION_PATCH=1
VERSION_BUILD=0

VersionManager

Convention Plugin의 VersionManager가 빌드 시 버전을 계산합니다:

kotlin
object VersionManager {
    fun getVersionName(project: Project): String {
        // "MAJOR.MINOR.PATCH" 형식
        return "$major.$minor.$patch"
    }

    fun getVersionCode(project: Project): Int {
        // MAJOR * 1000000 + MINOR * 10000 + PATCH * 100 + BUILD
        // 예: 1.16.1 -> 1160100
        return major * 1000000 + minor * 10000 + patch * 100 + build
    }
}

Signing 구성

Debug

프로젝트에 포함된 app/signature/debug.jks를 사용합니다.

Release

환경 변수를 통해 Keystore를 지정합니다:

환경 변수설명
TRULOOP_KEYSTORE_PATHKeystore 파일 경로
TRULOOP_KEYSTORE_PASSWORDKeystore 비밀번호
TRULOOP_KEY_ALIAS키 별칭
TRULOOP_KEY_PASSWORD키 비밀번호

주의

Release Signing 환경 변수가 설정되지 않은 경우, Qodana 등 CI 코드 분석을 위해 Debug Keystore로 자동 폴백됩니다.

Secrets 관리

com.google.android.libraries.mapsplatform.secrets-gradle-plugin을 사용하여 secrets.properties 파일에서 API 키 등을 관리합니다:

kotlin
secrets {
    propertiesFileName = "secrets.properties"
}

Debug 도구

Debug Build 전용

도구위치용도
Chuckercore:networkHTTP 요청/응답 인스펙터 (노티피케이션에서 확인 가능)
Beagleapp + core:network디버그 드로어 (네트워크 로그, 크래시 로그, 커스텀 디버그 메뉴)
Timberapp + 각 모듈구조화된 로깅
kotlin
// app/build.gradle.kts - Beagle UI는 app 모듈에서만 포함
debugImplementation(libs.bundles.beagle)

// core/network/build.gradle.kts - Chucker, Beagle OkHttp 로거
debugImplementation(libs.chucker)
releaseImplementation(libs.chucker.no.op)
debugImplementation(libs.beagle.log.okhttp)
releaseImplementation(libs.beagle.log.okhttp.no.op)

테스트

테스트 프레임워크

프레임워크용도
JUnit 5 (via Kotest Runner)테스트 실행
MockKMocking 라이브러리
TurbineFlow 테스트
Kotest AssertionsAssertion 라이브러리
Kotlinx Coroutines TestCoroutine 테스트
kotlin
tasks.withType<Test> {
    useJUnitPlatform()  // JUnit 5 사용
}

Compose 성능 모니터링

Compose Compiler의 Metrics/Reports를 생성할 수 있습니다:

bash
# Compose Compiler Metrics 생성
./gradlew assembleRelease -PenableComposeCompilerMetrics=true

# Compose Compiler Reports 생성
./gradlew assembleRelease -PenableComposeCompilerReports=true

결과 파일은 {rootProject}/build/{modulePath}/compose-metrics/compose-reports/에 생성됩니다.

CI (Continuous Integration)

Qodana 코드 품질 분석

GitHub Actions를 통해 Qodana 정적 분석을 실행합니다.

항목설정
Linterjetbrains/qodana-android:2025.3
Profileqodana.recommended
실행 주기매주 월요일 00:00 UTC + 수동 실행
JDK21 (Temurin)
yaml
# .github/workflows/qodana_code_quality.yml
on:
  workflow_dispatch:
  schedule:
    - cron: '0 0 * * 1'

정보

현재 Firebase App Distribution이나 Play Store 자동 배포 CI/CD 파이프라인은 구성되어 있지 않습니다. 빌드 및 배포는 로컬에서 수동으로 진행합니다.

변경 이력

날짜변경 내용
2026-03-10SDK 버전(compileSdk 36, minSdk 29, targetSdk 36) 추가, gradle.properties 전체 속성 반영, Version Catalog bundles 정확한 내용으로 수정, Debug 도구 모듈 위치 명시, CI (Qodana) 섹션 추가