Skip to content

Commit

Permalink
[feature/separate-soptamp-modules] SOPTAMP 멀티모듈화 (#398)
Browse files Browse the repository at this point in the history
* change buildDir to layout.buildDirectory

* soptamp 모듈에서 data, domain 모듈 분리

* feature-soptamp에서 필요없는 의존성 지우기
  • Loading branch information
l2hyunwoo committed Oct 15, 2023
1 parent 943a34b commit f6fd2c0
Show file tree
Hide file tree
Showing 100 changed files with 357 additions and 274 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ android {
}

dependencies {
implementation(projects.domain.soptamp)
implementation(projects.feature.soptamp)
implementation(projects.data.soptamp)
implementation(projects.core.common)
implementation(projects.core.analytics)
implementation(projects.feature.auth)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class HomeActivity : AppCompatActivity() {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(args?.remoteMessageEventLink))
startActivity(intent)
}
// RemoteMessageLinkType.DEEP_LINK -> {} TODO: 딥링크 정의된 후 구현 예정
// RemoteMessageLinkType.DEEP_LINK -> {} TODO: 딥링크 정의된 후 구현 예정
else -> {
val intent = Intent(this, NotificationHistoryActivity::class.java)
startActivity(intent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import io.reactivex.rxjava3.subjects.PublishSubject
import kotlinx.coroutines.launch
import kotlinx.coroutines.tasks.await
import org.sopt.official.domain.repository.AuthRepository
import org.sopt.official.domain.soptamp.repository.StampRepository
import org.sopt.official.feature.mypage.model.MyPageUiState
import org.sopt.official.stamp.domain.repository.StampRepository
import timber.log.Timber
import javax.inject.Inject

Expand Down Expand Up @@ -45,4 +45,4 @@ class MyPageViewModel @Inject constructor(
.onFailure { Timber.e(it) }
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.processors.BehaviorProcessor
import io.reactivex.rxjava3.subjects.PublishSubject
import kotlinx.coroutines.launch
import org.sopt.official.stamp.domain.repository.UserRepository
import org.sopt.official.domain.soptamp.repository.UserRepository
import org.sopt.official.util.rx.subscribeBy
import org.sopt.official.util.rx.subscribeOnIo
import timber.log.Timber
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import androidx.lifecycle.viewModelScope
import dagger.hilt.android.lifecycle.HiltViewModel
import io.reactivex.rxjava3.subjects.PublishSubject
import kotlinx.coroutines.launch
import org.sopt.official.stamp.domain.repository.UserRepository
import org.sopt.official.domain.soptamp.repository.UserRepository
import timber.log.Timber
import javax.inject.Inject

Expand All @@ -25,4 +25,4 @@ class AdjustSentenceViewModel @Inject constructor(
}
}
}
}
}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ plugins {
}

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
delete(rootProject.layout.buildDirectory)
}
1 change: 1 addition & 0 deletions data/soptamp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
20 changes: 20 additions & 0 deletions data/soptamp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
id("org.sopt.official.feature")
}

android {
namespace = "org.sopt.official.data.soptamp"
}

dependencies {
implementation(projects.domain.soptamp)
implementation(projects.core.common)
implementation(libs.security)
implementation(libs.timber)
implementation(platform(libs.okhttp.bom))
implementation(libs.bundles.okhttp)
implementation(libs.retrofit)
implementation(libs.retrofit.kotlin.serialization.converter)
implementation(libs.process.phoenix)
}
Empty file added data/soptamp/consumer-rules.pro
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.sopt.official.data.soptamp

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("org.sopt.official.data.soptamp.test", appContext.packageName)
}
}
4 changes: 4 additions & 0 deletions data/soptamp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sopt.official.stamp.util
package org.sopt.official.data.soptamp

import android.content.Context
import android.net.Uri
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
/*
* Copyright 2023 SOPT - Shout Our Passion Together
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sopt.official.stamp.di
package org.sopt.official.data.soptamp.di

import android.content.Context
import android.content.SharedPreferences
Expand All @@ -24,10 +9,10 @@ import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import org.sopt.official.stamp.BuildConfig
import org.sopt.official.stamp.di.constant.Soptamp
import org.sopt.official.stamp.di.constant.Constant
import org.sopt.official.stamp.di.constant.Strings
import org.sopt.official.data.soptamp.BuildConfig
import org.sopt.official.domain.soptamp.constant.Constant
import org.sopt.official.domain.soptamp.constant.Soptamp
import org.sopt.official.domain.soptamp.constant.Strings
import timber.log.Timber
import java.security.KeyStore
import javax.inject.Singleton
Expand Down Expand Up @@ -82,6 +67,6 @@ object ConfigModule {
}

private fun deleteEncryptedPreference(context: Context) {
context.deleteSharedPreferences(BuildConfig.persistenceStoreName)
context.deleteSharedPreferences("sampleKey")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sopt.official.stamp.di
package org.sopt.official.data.soptamp.di

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import org.sopt.official.stamp.BuildConfig
import org.sopt.official.stamp.di.constant.Constant
import org.sopt.official.stamp.di.constant.Strings
import org.sopt.official.data.soptamp.BuildConfig
import org.sopt.official.domain.soptamp.constant.Constant
import org.sopt.official.domain.soptamp.constant.Strings
import javax.inject.Singleton

@Module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sopt.official.stamp.di
package org.sopt.official.data.soptamp.di

import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import org.sopt.official.stamp.data.repository.RemoteMissionsRepository
import org.sopt.official.stamp.data.repository.RemoteRankingRepository
import org.sopt.official.stamp.data.repository.UserRepositoryImpl
import org.sopt.official.stamp.data.repository.StampRepositoryImpl
import org.sopt.official.stamp.domain.repository.MissionsRepository
import org.sopt.official.stamp.domain.repository.RankingRepository
import org.sopt.official.stamp.domain.repository.StampRepository
import org.sopt.official.stamp.domain.repository.UserRepository
import org.sopt.official.data.soptamp.repository.RemoteMissionsRepository
import org.sopt.official.data.soptamp.repository.RemoteRankingRepository
import org.sopt.official.data.soptamp.repository.UserRepositoryImpl
import org.sopt.official.data.soptamp.repository.StampRepositoryImpl
import org.sopt.official.domain.soptamp.repository.MissionsRepository
import org.sopt.official.domain.soptamp.repository.RankingRepository
import org.sopt.official.domain.soptamp.repository.StampRepository
import org.sopt.official.domain.soptamp.repository.UserRepository
import javax.inject.Singleton

@Module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sopt.official.stamp.di
package org.sopt.official.data.soptamp.di

import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import org.sopt.official.stamp.data.remote.source.RemoteMissionsDataSource
import org.sopt.official.stamp.data.remote.source.RemoteRankingDataSource
import org.sopt.official.stamp.data.remote.source.RemoteUserDataSource
import org.sopt.official.stamp.data.source.MissionsDataSource
import org.sopt.official.stamp.data.source.RankingDataSource
import org.sopt.official.stamp.data.source.UserDataSource
import org.sopt.official.data.soptamp.remote.source.RemoteMissionsDataSource
import org.sopt.official.data.soptamp.remote.source.RemoteRankingDataSource
import org.sopt.official.data.soptamp.remote.source.RemoteUserDataSource
import org.sopt.official.data.soptamp.source.MissionsDataSource
import org.sopt.official.data.soptamp.source.RankingDataSource
import org.sopt.official.data.soptamp.source.UserDataSource
import javax.inject.Singleton

@Module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sopt.official.stamp.di
package org.sopt.official.data.soptamp.di

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import org.sopt.official.common.di.AppRetrofit
import org.sopt.official.stamp.data.remote.api.RankService
import org.sopt.official.stamp.data.remote.api.SoptampService
import org.sopt.official.stamp.data.remote.api.StampService
import org.sopt.official.stamp.data.remote.api.SoptampUserService
import org.sopt.official.data.soptamp.remote.api.RankService
import org.sopt.official.data.soptamp.remote.api.SoptampService
import org.sopt.official.data.soptamp.remote.api.StampService
import org.sopt.official.data.soptamp.remote.api.SoptampUserService
import retrofit2.Retrofit
import javax.inject.Singleton

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sopt.official.stamp.data.error
package org.sopt.official.data.soptamp.error

sealed class ErrorData(
override val message: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sopt.official.stamp.data.local
package org.sopt.official.data.soptamp.local

import android.content.SharedPreferences
import androidx.core.content.edit
import org.sopt.official.stamp.di.constant.Soptamp
import org.sopt.official.domain.soptamp.constant.Soptamp
import javax.inject.Inject

class SoptampDataStore @Inject constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sopt.official.stamp.data.mapper // ktlint-disable filename
package org.sopt.official.data.soptamp.mapper // ktlint-disable filename

import org.sopt.official.stamp.data.error.ErrorData
import org.sopt.official.stamp.domain.error.Error
import org.sopt.official.data.soptamp.error.ErrorData
import org.sopt.official.domain.soptamp.error.Error

internal fun ErrorData.toDomain(): Error = when (this) {
ErrorData.NetworkUnavailable -> Error.NetworkUnavailable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sopt.official.stamp.data.mapper // ktlint-disable filename
package org.sopt.official.data.soptamp.mapper // ktlint-disable filename

import org.sopt.official.stamp.data.remote.model.MissionData
import org.sopt.official.stamp.domain.model.Mission
import org.sopt.official.data.soptamp.remote.model.MissionData
import org.sopt.official.domain.soptamp.model.Mission

internal fun List<MissionData>.toDomain(): List<Mission> = this.map { it.toDomain() }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sopt.official.stamp.data.mapper // ktlint-disable filename
package org.sopt.official.data.soptamp.mapper // ktlint-disable filename

import org.sopt.official.stamp.data.remote.model.RankData
import org.sopt.official.stamp.domain.model.Rank
import org.sopt.official.data.soptamp.remote.model.RankData
import org.sopt.official.domain.soptamp.model.Rank

internal fun List<RankData>.toDomain(): List<Rank> = this.map {
it.toDomain()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sopt.official.stamp.data.remote.api
package org.sopt.official.data.soptamp.remote.api

import org.sopt.official.stamp.data.remote.model.response.RankDetailResponse
import org.sopt.official.stamp.data.remote.model.response.RankResponse
import org.sopt.official.data.soptamp.remote.model.response.RankDetailResponse
import org.sopt.official.data.soptamp.remote.model.response.RankResponse
import retrofit2.http.GET
import retrofit2.http.Query

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sopt.official.stamp.data.remote.api
package org.sopt.official.data.soptamp.remote.api

import org.sopt.official.stamp.data.remote.model.response.MissionResponse
import org.sopt.official.data.soptamp.remote.model.response.MissionResponse
import retrofit2.http.GET

internal interface SoptampService {
Expand Down
Loading

0 comments on commit f6fd2c0

Please sign in to comment.