Updated on 2026-08-14
This commit is contained in:
parent
a6e04a4344
commit
df818fa72a
11 changed files with 117 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ plugins {
|
||||||
kotlin("kapt")
|
kotlin("kapt")
|
||||||
id("com.google.gms.google-services")
|
id("com.google.gms.google-services")
|
||||||
id("com.google.firebase.crashlytics")
|
id("com.google.firebase.crashlytics")
|
||||||
|
id("com.google.dagger.hilt.android")
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
@ -95,6 +96,7 @@ android {
|
||||||
resources.excludes += "lib/x86_64/darwin/libscrypt.dylib"
|
resources.excludes += "lib/x86_64/darwin/libscrypt.dylib"
|
||||||
resources.excludes += "lib/x86_64/freebsd/libscrypt.so"
|
resources.excludes += "lib/x86_64/freebsd/libscrypt.so"
|
||||||
resources.excludes += "lib/x86_64/linux/libscrypt.so"
|
resources.excludes += "lib/x86_64/linux/libscrypt.so"
|
||||||
|
resources.excludes += "META-INF/gradle/incremental.annotation.processors"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -138,6 +140,10 @@ dependencies {
|
||||||
implementation(Tangem.cardCore)
|
implementation(Tangem.cardCore)
|
||||||
implementation(Tangem.cardAndroid)
|
implementation(Tangem.cardAndroid)
|
||||||
|
|
||||||
|
/** DI */
|
||||||
|
implementation(Library.hilt)
|
||||||
|
implementation(Library.hiltKapt)
|
||||||
|
|
||||||
/** Other libraries */
|
/** Other libraries */
|
||||||
implementation(Library.materialComponent)
|
implementation(Library.materialComponent)
|
||||||
implementation(Library.googlePlayCore)
|
implementation(Library.googlePlayCore)
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ import com.tangem.tap.network.NetworkConnectivity
|
||||||
import com.tangem.tap.persistence.PreferencesStorage
|
import com.tangem.tap.persistence.PreferencesStorage
|
||||||
import com.tangem.wallet.BuildConfig
|
import com.tangem.wallet.BuildConfig
|
||||||
import com.zendesk.logger.Logger
|
import com.zendesk.logger.Logger
|
||||||
|
import dagger.hilt.android.HiltAndroidApp
|
||||||
import org.rekotlin.Store
|
import org.rekotlin.Store
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import zendesk.chat.Chat
|
import zendesk.chat.Chat
|
||||||
|
|
@ -50,6 +51,7 @@ lateinit var shopService: TangemShopService
|
||||||
lateinit var assetReader: AssetReader
|
lateinit var assetReader: AssetReader
|
||||||
lateinit var userTokensRepository: UserTokensRepository
|
lateinit var userTokensRepository: UserTokensRepository
|
||||||
|
|
||||||
|
@HiltAndroidApp
|
||||||
class TapApplication : Application(), ImageLoaderFactory {
|
class TapApplication : Application(), ImageLoaderFactory {
|
||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,10 @@ buildscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("com.google.dagger.hilt.android") version "2.44" apply false
|
||||||
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ object Library {
|
||||||
const val googlePlayCoreKtx = "com.google.android.play:core-ktx:" + Versions.googlePlayCoreKtx
|
const val googlePlayCoreKtx = "com.google.android.play:core-ktx:" + Versions.googlePlayCoreKtx
|
||||||
const val googlePlayServicesWallet =
|
const val googlePlayServicesWallet =
|
||||||
"com.google.android.gms:play-services-wallet:" + Versions.googlePlayServicesWallet
|
"com.google.android.gms:play-services-wallet:" + Versions.googlePlayServicesWallet
|
||||||
|
const val hilt = "com.google.dagger:hilt-android:" + Versions.hilt
|
||||||
|
const val hiltKapt = "com.google.dagger:hilt-compiler:" + Versions.hilt
|
||||||
const val kotsonGsonExt = "com.github.salomonbrys.kotson:kotson:" + Versions.kotsonGsonExt
|
const val kotsonGsonExt = "com.github.salomonbrys.kotson:kotson:" + Versions.kotsonGsonExt
|
||||||
const val lottie = "com.airbnb.android:lottie:" + Versions.lottie
|
const val lottie = "com.airbnb.android:lottie:" + Versions.lottie
|
||||||
const val materialComponent = "com.google.android.material:material:" + Versions.googleMaterialComponent
|
const val materialComponent = "com.google.android.material:material:" + Versions.googleMaterialComponent
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ object Versions {
|
||||||
const val googlePlayCore = "1.10.3"
|
const val googlePlayCore = "1.10.3"
|
||||||
const val googlePlayCoreKtx = "1.8.1"
|
const val googlePlayCoreKtx = "1.8.1"
|
||||||
const val googlePlayServicesWallet = "19.1.0"
|
const val googlePlayServicesWallet = "19.1.0"
|
||||||
|
const val hilt = "2.44"
|
||||||
const val kotsonGsonExt = "2.5.0"
|
const val kotsonGsonExt = "2.5.0"
|
||||||
const val lottie = "3.4.0"
|
const val lottie = "3.4.0"
|
||||||
const val moshi = "1.12.0"
|
const val moshi = "1.12.0"
|
||||||
|
|
|
||||||
1
core/datasource/.gitignore
vendored
Normal file
1
core/datasource/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
/build
|
||||||
46
core/datasource/build.gradle.kts
Normal file
46
core/datasource/build.gradle.kts
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
plugins {
|
||||||
|
id("com.android.library")
|
||||||
|
kotlin("android")
|
||||||
|
kotlin("kapt")
|
||||||
|
id("com.google.dagger.hilt.android")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
compileSdk = AppConfig.compileSdkVersion
|
||||||
|
minSdk = AppConfig.minSdkVersion
|
||||||
|
targetSdk = AppConfig.targetSdkVersion
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
isCoreLibraryDesugaringEnabled = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
|
||||||
|
/** DI */
|
||||||
|
implementation(Library.hilt)
|
||||||
|
implementation(Library.hiltKapt)
|
||||||
|
|
||||||
|
/** Coroutines */
|
||||||
|
implementation(Library.coroutine)
|
||||||
|
|
||||||
|
/** Logging */
|
||||||
|
implementation(Library.timber)
|
||||||
|
|
||||||
|
/** Network */
|
||||||
|
implementation(Library.retrofit)
|
||||||
|
implementation(Library.retrofitMoshiConverter)
|
||||||
|
implementation(Library.moshi)
|
||||||
|
implementation(Library.moshiKotlin)
|
||||||
|
implementation(Library.okHttp)
|
||||||
|
implementation(Library.okHttpLogging)
|
||||||
|
}
|
||||||
2
core/datasource/src/main/AndroidManifest.xml
Normal file
2
core/datasource/src/main/AndroidManifest.xml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest package="com.tangem.datasource" />
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.tangem.datasource.api.referral
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Api for referral functionality
|
||||||
|
*/
|
||||||
|
interface ReferralApi {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.tangem.datasource.di
|
||||||
|
|
||||||
|
import com.tangem.datasource.api.referral.ReferralApi
|
||||||
|
import dagger.Module
|
||||||
|
import dagger.Provides
|
||||||
|
import dagger.hilt.InstallIn
|
||||||
|
import dagger.hilt.components.SingletonComponent
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
|
import okhttp3.logging.HttpLoggingInterceptor
|
||||||
|
import retrofit2.Retrofit
|
||||||
|
import retrofit2.converter.moshi.MoshiConverterFactory
|
||||||
|
import javax.inject.Singleton
|
||||||
|
|
||||||
|
@Module
|
||||||
|
@InstallIn(SingletonComponent::class)
|
||||||
|
class NetworkModule {
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
fun provideReferralApi(okHttpClient: OkHttpClient): ReferralApi {
|
||||||
|
return Retrofit.Builder()
|
||||||
|
.addConverterFactory(
|
||||||
|
MoshiConverterFactory.create(),
|
||||||
|
)
|
||||||
|
.baseUrl(PROD_REFERRAL_BASE_URL)
|
||||||
|
.client(okHttpClient)
|
||||||
|
.build()
|
||||||
|
.create(ReferralApi::class.java)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
fun provideOkHttpClient(): OkHttpClient {
|
||||||
|
return OkHttpClient.Builder()
|
||||||
|
.addInterceptor(
|
||||||
|
HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BASIC),
|
||||||
|
)
|
||||||
|
.build()
|
||||||
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
const val PROD_REFERRAL_BASE_URL = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,3 +2,4 @@ include(":app")
|
||||||
include(":domain")
|
include(":domain")
|
||||||
include(":network")
|
include(":network")
|
||||||
include(":common")
|
include(":common")
|
||||||
|
include(":core:datasource")
|
||||||
Loading…
Add table
Add a link
Reference in a new issue