Skip to content

Commit

Permalink
[RBP-22] 아키텍쳐 레이어 단위로 모듈 분리 (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgpathos authored May 1, 2024
1 parent 465cb52 commit 71dd50e
Show file tree
Hide file tree
Showing 96 changed files with 821 additions and 204 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/cleanup-merged-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 자동으로 되서 주석처리
#name: cleanup-merged-branch
#
#on:
# pull_request:
# types: [ closed ]
# branches:
# - 'feat/**'
#
#jobs:
# delete_branch:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
#
# - name: Delete merged branch
# if: github.event.pull_request.merged == true
# id: open-pr
# run: |
# git branch -d ${{ github.event.pull_request.head.ref }}
# git push origin --delete ${{ github.event.pull_request.head.ref }}
21 changes: 0 additions & 21 deletions .github/workflows/r2d_chk.yml

This file was deleted.

37 changes: 5 additions & 32 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.kotlinSerialization)
alias(libs.plugins.hiltAndroid)
alias(libs.plugins.ksp)
alias(libs.plugins.secrets)
}

android {
Expand Down Expand Up @@ -50,11 +48,12 @@ android {
}
}

secrets {
defaultPropertiesFileName = "local.defaults.properties"
}

dependencies {
implementation(project(":presentation"))
implementation(project(":entity"))
implementation(project(":domain"))
implementation(project(":data"))

// hilt
implementation(libs.dagger.hilt.android)
ksp(libs.dagger.hilt.compiler)
Expand All @@ -69,35 +68,9 @@ dependencies {

implementation(libs.core.ktx)

implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.activity.compose)

// api
implementation(libs.bundles.retrofit)
testImplementation(libs.mockwebserver)

// database
implementation(libs.androidx.room.runtime)
implementation(libs.androidx.room.ktx)
ksp(libs.androidx.room.compiler)
testImplementation(libs.androidx.room.testing)

implementation(libs.androidx.datastore)

// compose
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.compose)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.bundles.compose.android.test)
debugImplementation(libs.bundles.compose.ui.test)

// test
testImplementation(libs.junit)
testImplementation(libs.mockk.android)
testImplementation(libs.mockk.agent)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.mockk.android)
androidTestImplementation(libs.mockk.agent)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package today.pathos.android.portfolio.core.di

import android.content.Context
import coil.ImageLoader
import coil.disk.DiskCache
import coil.memory.MemoryCache
import coil.util.DebugLogger
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import okhttp3.OkHttpClient
import today.pathos.android.portfolio.BuildConfig
import javax.inject.Singleton

@InstallIn(SingletonComponent::class)
@Module
object ViewModule {
@Singleton
@Provides
fun providesImageLoader(
client: OkHttpClient,
@ApplicationContext context: Context,
): ImageLoader = ImageLoader.Builder(context)
.callFactory { client }
.crossfade(true)
.memoryCache {
MemoryCache.Builder(context)
.maxSizePercent(0.25)
.build()
}
.diskCache {
DiskCache.Builder()
.directory(context.cacheDir.resolve("image_cache"))
.maxSizePercent(0.02)
.build()
}
.apply {
if (BuildConfig.DEBUG) {
logger(DebugLogger())
}
}
.build()
}
7 changes: 0 additions & 7 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
<resources>
<string name="app_name">Android Portfolio 2024</string>

<string name="level">Lv.%,d</string>
<string name="fame">명성치 : %,d</string>
<string name="lbl_guild_name">&lt;%s&gt;</string>
<string name="lbl_server_character_name">[%1$s] %2$s</string>
<string name="lbl_level_job">Lv.%1$d %2$s</string>
<string name="lbl_reinforce">+%,d</string>
</resources>
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ plugins {
alias(libs.plugins.kotlinSerialization) apply false
alias(libs.plugins.hiltAndroid) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.androidxRoom) apply false
alias(libs.plugins.secrets) apply false
alias(libs.plugins.jetbrainsKotlinJvm) apply false
}
1 change: 1 addition & 0 deletions data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
88 changes: 88 additions & 0 deletions data/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
plugins {
alias(libs.plugins.androidLibrary)
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.kotlinSerialization)
alias(libs.plugins.hiltAndroid)
alias(libs.plugins.ksp)
alias(libs.plugins.androidxRoom)
alias(libs.plugins.secrets)
}

android {
namespace = "today.pathos.android.portfolio.data"
compileSdk = 34

defaultConfig {
minSdk = 24

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
buildConfig = true
}
room {
schemaDirectory("$projectDir/schemas")
}
packaging {
resources {
excludes += "/META-INF/{LICENSE*.md}"
}
}
}

secrets {
defaultPropertiesFileName = "local.defaults.properties"
}

dependencies {
implementation(project(":entity"))
implementation(project(":domain"))

// hilt
implementation(libs.dagger.hilt.android)
ksp(libs.dagger.hilt.compiler)
androidTestImplementation(libs.dagger.hilt.android.testing)
kspAndroidTest(libs.dagger.hilt.android.compiler)
testImplementation(libs.dagger.hilt.android.testing)
kspTest(libs.dagger.hilt.android.compiler)

// kotlin
implementation(libs.bundles.kotlin)
testImplementation(libs.bundles.kotlin.test)

// api
implementation(libs.bundles.retrofit)
testImplementation(libs.mockwebserver)

// database
implementation(libs.androidx.room.runtime)
implementation(libs.androidx.room.ktx)
ksp(libs.androidx.room.compiler)
testImplementation(libs.androidx.room.testing)

implementation(libs.androidx.datastore)

// test
testImplementation(libs.junit)
testImplementation(libs.mockk.android)
testImplementation(libs.mockk.agent)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.mockk.android)
androidTestImplementation(libs.mockk.agent)
}
Empty file added data/consumer-rules.pro
Empty file.
21 changes: 21 additions & 0 deletions data/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Loading

0 comments on commit 71dd50e

Please sign in to comment.