Use Dagger Hilt for dependency injection

This gets rid of our own janky dependency injection through the AegisApplication class
This commit is contained in:
Alexander Bakker 2022-02-06 19:00:01 +01:00
parent 927f5f2bd5
commit 71f2b54deb
42 changed files with 1157 additions and 977 deletions

View file

@ -1,5 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.protobuf'
apply plugin: 'dagger.hilt.android.plugin'
def getCmdOutput = { cmd ->
def stdout = new ByteArrayOutputStream()
@ -126,10 +127,12 @@ dependencies {
def cameraxVersion = '1.0.2'
def glideVersion = '4.12.0'
def guavaVersion = '31.0.1'
def hiltVersion = '2.38.1'
def junitVersion = '4.13.2'
def libsuVersion = '3.2.1'
annotationProcessor 'androidx.annotation:annotation:1.3.0'
annotationProcessor "com.google.dagger:hilt-compiler:$hiltVersion"
annotationProcessor "com.github.bumptech.glide:compiler:${glideVersion}"
implementation fileTree(dir: 'libs', include: ['*.jar'])
@ -142,12 +145,13 @@ dependencies {
implementation "androidx.core:core:1.7.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation "androidx.lifecycle:lifecycle-process:2.4.0"
implementation "androidx.lifecycle:lifecycle-process:2.4.1"
implementation 'androidx.preference:preference:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation "androidx.viewpager2:viewpager2:1.0.0"
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'com.caverock:androidsvg-aar:1.4'
implementation "com.google.dagger:hilt-android:$hiltVersion"
implementation 'com.github.avito-tech:krop:0.52'
implementation "com.github.bumptech.glide:annotations:${glideVersion}"
implementation "com.github.bumptech.glide:glide:${glideVersion}"
@ -170,6 +174,8 @@ dependencies {
implementation 'info.guardianproject.trustedintents:trustedintents:0.2'
implementation 'org.bouncycastle:bcprov-jdk15on:1.70'
androidTestAnnotationProcessor "com.google.dagger:hilt-android-compiler:$hiltVersion"
androidTestImplementation "com.google.dagger:hilt-android-testing:$hiltVersion"
androidTestImplementation "androidx.test:core:${androidTestVersion}"
androidTestImplementation "androidx.test:runner:${androidTestVersion}"
androidTestImplementation "androidx.test:rules:${androidTestVersion}"