chore: 引入 Hilt
This commit is contained in:
parent
0b2e64bcd3
commit
697e7dd964
|
|
@ -3,6 +3,7 @@ plugins {
|
||||||
id "kotlin-android"
|
id "kotlin-android"
|
||||||
id "kotlin-kapt"
|
id "kotlin-kapt"
|
||||||
id 'com.google.protobuf'
|
id 'com.google.protobuf'
|
||||||
|
id 'dagger.hilt.android.plugin'
|
||||||
}
|
}
|
||||||
|
|
||||||
def keystoreProperties = new Properties()
|
def keystoreProperties = new Properties()
|
||||||
|
|
@ -88,6 +89,15 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation "com.google.dagger:hilt-android:$hilt_version"
|
||||||
|
kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
|
||||||
|
|
||||||
|
def accompanist_version = "0.15.0"
|
||||||
|
|
||||||
|
implementation "com.google.accompanist:accompanist-insets:$accompanist_version"
|
||||||
|
implementation "com.google.accompanist:accompanist-insets-ui:$accompanist_version"
|
||||||
|
implementation "com.google.accompanist:accompanist-systemuicontroller:$accompanist_version"
|
||||||
|
|
||||||
def compose_version = '1.2.0'
|
def compose_version = '1.2.0'
|
||||||
|
|
||||||
implementation "androidx.compose.ui:ui:$compose_version"
|
implementation "androidx.compose.ui:ui:$compose_version"
|
||||||
|
|
@ -109,7 +119,10 @@ dependencies {
|
||||||
api 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
|
api 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
|
||||||
api 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
|
api 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
|
||||||
|
|
||||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.0'
|
def lifecycle_version = "2.5.1"
|
||||||
|
|
||||||
|
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
|
||||||
|
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
|
||||||
|
|
||||||
//Local Files
|
//Local Files
|
||||||
implementation fileTree(include: ["*.jar"], dir: "libs")
|
implementation fileTree(include: ["*.jar"], dir: "libs")
|
||||||
|
|
@ -153,7 +166,7 @@ dependencies {
|
||||||
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
|
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
|
||||||
implementation "com.squareup.retrofit2:converter-protobuf:$retrofit_version"
|
implementation "com.squareup.retrofit2:converter-protobuf:$retrofit_version"
|
||||||
|
|
||||||
implementation 'com.google.code.gson:gson:2.9.0'
|
implementation 'com.google.code.gson:gson:2.9.1'
|
||||||
implementation "cn.dreamtobe.kpswitch:library:1.6.2"
|
implementation "cn.dreamtobe.kpswitch:library:1.6.2"
|
||||||
implementation "org.litepal.android:kotlin:3.0.0"
|
implementation "org.litepal.android:kotlin:3.0.0"
|
||||||
implementation 'cn.jzvd:jiaozivideoplayer:7.7.2.3300'
|
implementation 'cn.jzvd:jiaozivideoplayer:7.7.2.3300'
|
||||||
|
|
|
||||||
|
|
@ -46,12 +46,14 @@ import com.microsoft.appcenter.AppCenter
|
||||||
import com.microsoft.appcenter.analytics.Analytics
|
import com.microsoft.appcenter.analytics.Analytics
|
||||||
import com.microsoft.appcenter.crashes.Crashes
|
import com.microsoft.appcenter.crashes.Crashes
|
||||||
import com.microsoft.appcenter.distribute.*
|
import com.microsoft.appcenter.distribute.*
|
||||||
|
import dagger.hilt.android.HiltAndroidApp
|
||||||
import org.intellij.lang.annotations.RegExp
|
import org.intellij.lang.annotations.RegExp
|
||||||
import org.litepal.LitePal
|
import org.litepal.LitePal
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.regex.Pattern
|
import java.util.regex.Pattern
|
||||||
|
|
||||||
|
|
||||||
|
@HiltAndroidApp
|
||||||
class BaseApplication : Application(), IApp {
|
class BaseApplication : Application(), IApp {
|
||||||
private val mActivityList: MutableList<Activity> = mutableListOf()
|
private val mActivityList: MutableList<Activity> = mutableListOf()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ buildscript {
|
||||||
retrofit_version = "2.9.0"
|
retrofit_version = "2.9.0"
|
||||||
kotlin_version = '1.7.10'
|
kotlin_version = '1.7.10'
|
||||||
grpc_version = '1.47.0'
|
grpc_version = '1.47.0'
|
||||||
|
hilt_version = '2.43.1'
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
|
|
@ -16,6 +17,7 @@ buildscript {
|
||||||
classpath 'com.android.tools.build:gradle:7.2.1'
|
classpath 'com.android.tools.build:gradle:7.2.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
|
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
|
||||||
|
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue