Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6차 세미나/xml] : 도전 과제 & [7차 세미나/xml] : 필수 과제 #19

Open
wants to merge 57 commits into
base: develop-xml
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
9d3da36
[MOD] : liveData -> flow 적용
Eonji-sw May 27, 2024
d5ef589
[DEL] : multi module 적용
Eonji-sw May 28, 2024
2ff1259
[FEAT] : module 구현(DI-Hilt)
Eonji-sw May 28, 2024
c84148a
[DEL] : multi module 적용
Eonji-sw May 28, 2024
ef7811f
[FEAT] : mainApplication 구현(이동)
Eonji-sw May 28, 2024
6e4088e
[FEAT] : app 모듈 manifest 구현(이동)
Eonji-sw May 28, 2024
bebba8a
[FEAT] : app 모듈 build gradle 구현
Eonji-sw May 28, 2024
dd497cc
[FEAT] : app 모듈 proguard-rules 생성
Eonji-sw May 28, 2024
e9c9584
[FEAT] : core-ui 모듈 gitignore 생성
Eonji-sw May 28, 2024
9421311
[FEAT] : core-ui 모듈 build gradle 구현
Eonji-sw May 28, 2024
405e86e
[FEAT] : core-ui 모듈 test file 생성
Eonji-sw May 28, 2024
2b0bbb0
[FEAT] : core-ui 모듈 base 구현(이동)
Eonji-sw May 28, 2024
c50519a
[FEAT] : core-ui 모듈 util 구현(이동)
Eonji-sw May 28, 2024
38cd2a3
[FEAT] : core-ui 모듈 view 구현(이동)
Eonji-sw May 28, 2024
a17c755
[FEAT] : data 모듈 gitignore 생성
Eonji-sw May 28, 2024
ab72c22
[FEAT] : data 모듈 build gradle 구현
Eonji-sw May 28, 2024
d84796d
[FEAT] : data 모듈 test file 생성
Eonji-sw May 28, 2024
909cb75
[FEAT] : data-local 모듈 test file 생성
Eonji-sw May 28, 2024
24b9830
[FEAT] : data-remote 모듈 test file 생성
Eonji-sw May 28, 2024
7e00649
[FEAT] : domain 모듈 test file 생성
Eonji-sw May 28, 2024
9ccb4af
[FEAT] : feature 모듈 test file 생성
Eonji-sw May 28, 2024
aee8c04
[FEAT] : data-local 모듈 gitignore 생성
Eonji-sw May 28, 2024
3323c09
[FEAT] : data-remote 모듈 gitignore 생성
Eonji-sw May 28, 2024
9b170c5
[FEAT] : domain 모듈 gitignore 생성
Eonji-sw May 28, 2024
c0f1d87
[FEAT] : feature 모듈 gitignore 생성
Eonji-sw May 28, 2024
254db4f
[FEAT] : data-local 모듈 build gradle 구현
Eonji-sw May 28, 2024
4b4f423
[FEAT] : data-remote 모듈 build gradle 구현
Eonji-sw May 28, 2024
caec6c7
[FEAT] : domain 모듈 build gradle 구현
Eonji-sw May 28, 2024
798167e
[FEAT] : feature 모듈 build gradle 구현
Eonji-sw May 28, 2024
9849aec
[FEAT] : feature 모듈 proguard-rules 생성
Eonji-sw May 28, 2024
a272c6d
[ADD] : project build gradle 수정
Eonji-sw May 28, 2024
85f8269
[ADD] : project settings gradle 수정
Eonji-sw May 28, 2024
465d3d4
[FEAT] : version catalog 구현
Eonji-sw May 28, 2024
163a8ef
[FEAT] : data 모듈 datasource 구현
Eonji-sw May 28, 2024
b6a501d
[FEAT] : data 모듈 dto 구현(이동)
Eonji-sw May 28, 2024
26305c8
[FEAT] : data 모듈 repository impl 구현
Eonji-sw May 28, 2024
ff61756
[FEAT] : data-local 모듈 data source impl 구현
Eonji-sw May 28, 2024
514a08b
[FEAT] : data-remote 모듈 api service 구현(이동)
Eonji-sw May 28, 2024
e761fe5
[FEAT] : data-remote 모듈 data source impl 구현
Eonji-sw May 28, 2024
c48823c
[RENAME] : keyStorage -> apiKeyStorage 파일명 변경
Eonji-sw May 28, 2024
a1bed6c
[FEAT] : domain 모듈 entity 구현
Eonji-sw May 28, 2024
ab9a6c4
[FEAT] : domain 모듈 repository 구현
Eonji-sw May 28, 2024
901cb71
[FEAT] : domain 모듈 manifest 구현
Eonji-sw May 28, 2024
5872398
[FEAT] : feature 모듈 manifest 구현
Eonji-sw May 28, 2024
68c49e0
[UI] : feature 모듈 res 구현(이동)
Eonji-sw May 28, 2024
8ab38de
[MOD] : import 변경
Eonji-sw May 28, 2024
51e58d3
[DEL] : 필요없는 코드 제거
Eonji-sw May 28, 2024
8a350c4
[FEAT] : feature 모듈 클아 + 모듈화 적용
Eonji-sw May 28, 2024
9042550
[ADD] : build gradle 추가 및 정리
Eonji-sw May 28, 2024
26e2594
[MOD] : 코드 정리
Eonji-sw May 28, 2024
3fd68ea
[MOD] : 코드 정리
Eonji-sw May 28, 2024
9c3268e
[MOD] : 코드 정리
Eonji-sw May 28, 2024
0e7f649
[MOD] : 코드 정리
Eonji-sw May 28, 2024
87fcd62
[MOD] : 코드 정리
Eonji-sw May 28, 2024
25a3f29
[MOD] : User -> UserEntity 호출 변경
Eonji-sw May 28, 2024
2aadaf5
[MOD] : User -> UserEntity 호출 변경
Eonji-sw May 28, 2024
22cae42
[MOD] : 코드 정리
Eonji-sw May 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 0 additions & 83 deletions app/build.gradle

This file was deleted.

89 changes: 89 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
id("kotlin-parcelize")
id("kotlin-kapt")
alias(libs.plugins.dagger.hilt)
alias(libs.plugins.kotlinx.serialization)
}

android {
namespace = "com.sopt.now"
compileSdk = 34

defaultConfig {
applicationId = "com.sopt.now"
minSdk= 28
targetSdk = 34
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

buildConfigField("String", "AUTH_BASE_URL", getApiKey("base.auth.url"))
buildConfigField("String", "USER_BASE_URL", getApiKey("base.user.url"))
}

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 {
viewBinding = true
dataBinding = true
buildConfig = true
}
}

dependencies {
implementation(project(":feature"))
implementation(project(":core-ui"))
implementation(project(":domain"))
implementation(project(":data"))
implementation(project(":data-local"))
implementation(project(":data-remote"))

// 기초 AndroidX 라이브러리 ("core-ktx", "constraintlayout", "appcompat", "activity")
implementation(libs.bundles.androidx)
implementation(libs.security.crypto)

// Json
implementation(libs.kotlinx.serialization.json)

// Third Party
implementation(libs.retrofit2)
implementation(libs.retrofit.kotlin.serialization.converter)
implementation(platform(libs.okhttp.bom))
implementation(libs.okhttp)
implementation(libs.okhttp.logging.interceptor)

implementation(libs.coil.core)
implementation(libs.timber)

// Dagger hilt
implementation(libs.dagger.hilt)
kapt(libs.dagger.hilt.compiler)

// Test
testImplementation(libs.junit)
androidTestImplementation(libs.bundles.androidx.android.test)
}

fun getApiKey(propertyKey: String): String {
return gradleLocalProperties(rootDir, providers).getProperty(propertyKey)
}
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
25 changes: 2 additions & 23 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".core.MainApplication"
android:name=".MainApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand All @@ -15,27 +15,6 @@
android:supportsRtl="true"
android:theme="@style/Theme.NOWSOPTAndroid"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".presentation.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".presentation.sign.SignActivity"
android:exported="false"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".presentation.home.HomeActivity"
android:exported="false" />
<activity
android:name=".presentation.login.LoginActivity"
android:exported="false"
android:windowSoftInputMode="adjustResize" />
</application>
tools:targetApi="31"/>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
package com.sopt.now.core
package com.sopt.now

import android.app.Application
import com.sopt.now.data.PreferenceUtil
import dagger.hilt.android.HiltAndroidApp
import timber.log.Timber

@HiltAndroidApp
class MainApplication : Application() {
companion object {
lateinit var prefs: PreferenceUtil
}

override fun onCreate() {
super.onCreate()
setTimber()
initPreference()
}

private fun initPreference() {
prefs = PreferenceUtil(applicationContext)
}

private fun setTimber() {
Expand Down
42 changes: 0 additions & 42 deletions app/src/main/java/com/sopt/now/data/ApiFactory.kt

This file was deleted.

20 changes: 0 additions & 20 deletions app/src/main/java/com/sopt/now/data/PreferenceUtil.kt

This file was deleted.

24 changes: 24 additions & 0 deletions app/src/main/java/com/sopt/now/di/ApiModule.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.sopt.now.di

import com.sopt.now.data_remote.api.AuthApiService
import com.sopt.now.data_remote.api.ReqresApiService
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import retrofit2.Retrofit
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object ApiModule {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

각각 기능별로 분리 하는거 맞나요...??????? ㅇ....이게..... 모듈분리 맞나???????

@Provides
@Singleton
fun provideSignApiService(@AuthRetrofit retrofit: Retrofit): AuthApiService =
retrofit.create(AuthApiService::class.java)

@Provides
@Singleton
fun provideReqresApiService(@ReqresRetrofit retrofit: Retrofit): ReqresApiService =
retrofit.create(ReqresApiService::class.java)
}
31 changes: 31 additions & 0 deletions app/src/main/java/com/sopt/now/di/AuthModule.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.sopt.now.di

import com.sopt.now.data.datasource.AuthDataSource
import com.sopt.now.data.repositoryimpl.AuthRepositoryImpl
import com.sopt.now.data_remote.datasourceimpl.AuthDataSourceImpl
import com.sopt.now.domain.repository.AuthRepository
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object AuthModule {
@Module
@InstallIn(SingletonComponent::class)
interface RepositoryModule {
@Binds
@Singleton
fun bindsAuthRepository(RepositoryImpl: AuthRepositoryImpl): AuthRepository
}

@Module
@InstallIn(SingletonComponent::class)
interface DataSourceModule {
@Singleton
@Binds
fun providesAuthDataSource(DataSourceImpl: AuthDataSourceImpl): AuthDataSource
}
}
Loading