-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
83 changed files
with
1,457 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties | ||
|
||
plugins { | ||
id("com.android.application") | ||
kotlin("android") | ||
kotlin("kapt") | ||
id("kotlin-parcelize") | ||
id("dagger.hilt.android.plugin") | ||
id("com.google.android.gms.oss-licenses-plugin") | ||
} | ||
|
||
android { | ||
namespace = Constants.packageName | ||
compileSdk = Constants.compileSdk | ||
|
||
defaultConfig { | ||
applicationId = Constants.packageName | ||
minSdk = Constants.minSdk | ||
targetSdk = Constants.targetSdk | ||
versionCode = Constants.versionCode | ||
versionName = Constants.versionName | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
|
||
buildConfigField( | ||
"String", | ||
"BASE_URL", | ||
gradleLocalProperties(rootDir).getProperty("base.url"), | ||
) | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro", | ||
) | ||
} | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = Versions.javaVersion | ||
targetCompatibility = Versions.javaVersion | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = Versions.jvmVersion | ||
} | ||
|
||
buildFeatures { | ||
buildConfig = true | ||
dataBinding = true | ||
viewBinding = true | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(project(":core-ui")) | ||
implementation(project(":data")) | ||
implementation(project(":domain")) | ||
implementation(project(":presentation")) | ||
|
||
KotlinDependencies.run { | ||
implementation(kotlin) | ||
implementation(coroutines) | ||
implementation(jsonSerialization) | ||
} | ||
|
||
AndroidXDependencies.run { | ||
implementation(coreKtx) | ||
implementation(appCompat) | ||
implementation(hilt) | ||
implementation(workManager) | ||
implementation(hiltWorkManager) | ||
} | ||
|
||
KaptDependencies.run { | ||
kapt(hiltCompiler) | ||
kapt(hiltWorkManagerCompiler) | ||
} | ||
|
||
TestDependencies.run { | ||
testImplementation(jUnit) | ||
androidTestImplementation(androidTest) | ||
androidTestImplementation(espresso) | ||
} | ||
|
||
ThirdPartyDependencies.run { | ||
implementation(platform(okHttpBom)) | ||
implementation(okHttp) | ||
implementation(okHttpLoggingInterceptor) | ||
implementation(retrofit) | ||
implementation(retrofitJsonConverter) | ||
implementation(timber) | ||
implementation(ossLicense) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.going.going | ||
|
||
import android.app.Application | ||
import androidx.appcompat.app.AppCompatDelegate | ||
import dagger.hilt.android.HiltAndroidApp | ||
import timber.log.Timber | ||
|
||
@HiltAndroidApp | ||
class MyApp : Application() { | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
|
||
initTimber() | ||
setDayMode() | ||
} | ||
|
||
private fun initTimber() { | ||
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree()) | ||
} | ||
|
||
private fun setDayMode() { | ||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.going.going.di | ||
|
||
import com.going.data.datasource.MockDataSource | ||
import com.going.data.datasourceImpl.MockDataSourceImpl | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object DataSourceModule { | ||
|
||
@Provides | ||
@Singleton | ||
fun provideMockDataSource(mockDataSourceImpl: MockDataSourceImpl): MockDataSource = | ||
mockDataSourceImpl | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.going.going.di | ||
|
||
import com.going.data.repositoryImpl.MockRepositoryImpl | ||
import com.going.domain.repository.MockRepository | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object RepositoryModule { | ||
|
||
@Provides | ||
@Singleton | ||
fun provideMockRepository(mockRepositoryImpl: MockRepositoryImpl): MockRepository = | ||
mockRepositoryImpl | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.going.going.di | ||
|
||
import com.going.going.BuildConfig.BASE_URL | ||
import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import kotlinx.serialization.json.Json | ||
import okhttp3.Interceptor | ||
import okhttp3.MediaType.Companion.toMediaType | ||
import okhttp3.OkHttpClient | ||
import okhttp3.logging.HttpLoggingInterceptor | ||
import retrofit2.Converter | ||
import retrofit2.Retrofit | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object RetrofitModule { | ||
private const val APPLICATION_JSON = "application/json" | ||
|
||
@Provides | ||
@Singleton | ||
fun provideJson(): Json = Json { | ||
ignoreUnknownKeys = true | ||
prettyPrint = true | ||
} | ||
|
||
@Provides | ||
@Singleton | ||
fun provideJsonConverter(json: Json): Converter.Factory = | ||
json.asConverterFactory(APPLICATION_JSON.toMediaType()) | ||
|
||
@Provides | ||
@Singleton | ||
fun provideHttpLoggingInterceptor(): Interceptor = HttpLoggingInterceptor().apply { | ||
level = HttpLoggingInterceptor.Level.BODY | ||
} | ||
|
||
@Provides | ||
@Singleton | ||
fun provideOkHttpClient( | ||
loggingInterceptor: Interceptor | ||
): OkHttpClient = OkHttpClient.Builder() | ||
.addInterceptor(loggingInterceptor) | ||
.build() | ||
|
||
@Provides | ||
@Singleton | ||
fun provideRetrofit( | ||
client: OkHttpClient, | ||
factory: Converter.Factory, | ||
): Retrofit = Retrofit.Builder() | ||
.baseUrl(BASE_URL) | ||
.client(client) | ||
.addConverterFactory(factory) | ||
.build() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.going.going.di | ||
|
||
import com.going.data.service.MockService | ||
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 ServiceModule { | ||
|
||
@Provides | ||
@Singleton | ||
fun provideMockService(retrofit: Retrofit): MockService = | ||
retrofit.create(MockService::class.java) | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.