Skip to content

Instantly share code, notes, and snippets.

@hasanmohdkhan
Created July 22, 2020 07:15
Show Gist options
  • Save hasanmohdkhan/2f1f9e97a05b077b2861b77969969ecf to your computer and use it in GitHub Desktop.
Save hasanmohdkhan/2f1f9e97a05b077b2861b77969969ecf to your computer and use it in GitHub Desktop.

Revisions

  1. hasanmohdkhan created this gist Jul 22, 2020.
    31 changes: 31 additions & 0 deletions HiltDraggerSetup.kt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    #project level
    build.gradle
    dependencies {
    //...
    classpath "com.google.dagger:hilt-android-gradle-plugin:${version_hilt}
    //...
    }
    #Module level
    build.gradle
    //Plugin required
    apply plugin: 'kotlin-kapt'
    apply plugin: 'dagger.hilt.android.plugin'
    //Hilt uses Java 8 features. To enable Java 8 in your project,
    android {
    ...
    compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
    }
    }
    dependencies {
    //...
    implementation "com.google.dagger:hilt-android:$version_hilt"
    kapt "com.google.dagger:hilt-android-compiler:$version_hilt"
    //...
    }