refactor(di): replace Tangle with Whetstone

This commit is contained in:
Harsh Shandilya 2022-11-14 02:35:00 +05:30
parent 4a87682b68
commit 0232a4179a
No known key found for this signature in database
23 changed files with 36 additions and 188 deletions

View file

@ -21,7 +21,6 @@ android { namespace = "dev.msfjarvis.claw.core" }
dependencies {
api(libs.kotlinx.serialization.json)
api(libs.okhttp.loggingInterceptor)
implementation(projects.diScopes)
implementation(libs.dagger)
implementation(libs.javax.inject)
implementation(libs.napier)

View file

@ -1,20 +0,0 @@
/*
* Copyright © 2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.core.injection
import android.app.Application
import android.content.Context
import com.squareup.anvil.annotations.ContributesTo
import dagger.Binds
import dagger.Module
import dev.msfjarvis.claw.injection.scopes.AppScope
@Module
@ContributesTo(AppScope::class)
interface ContextModule {
@get:Binds val Application.bindContext: Context
}

View file

@ -8,6 +8,7 @@ package dev.msfjarvis.claw.core.injection
import android.content.Context
import android.net.TrafficStats
import com.deliveryhero.whetstone.ForScope
import com.deliveryhero.whetstone.app.ApplicationScope
import com.squareup.anvil.annotations.ContributesTo
import dagger.Binds
@ -37,7 +38,7 @@ interface OkHttpModule {
private const val THREAD_STATS_TAG = 0x000090000
@Provides
fun provideCache(context: Context): Cache {
fun provideCache(@ForScope(ApplicationScope::class) context: Context): Cache {
return Cache(context.cacheDir, CACHE_SIZE_MB)
}