Guest User

Untitled

a guest
Aug 28th, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.83 KB | None | 0 0
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'kotlin-android'
  3. apply plugin: 'kotlin-kapt' --<<<<<<<
  4. apply plugin: 'kotlin-android-extensions'
  5.  
  6. --------------------------------------------------------------------------------
  7.  
  8.     def dagger_version = '2.28.3'
  9.     //Dagger
  10.     implementation "com.google.dagger:dagger:$dagger_version"
  11.     kapt "com.google.dagger:dagger-compiler:$dagger_version"
  12.  
  13. --------------------------------------------------------------------------------
  14.  
  15. @Singleton
  16. @Component(modules = [ModuleRepository::class])
  17. interface AppComponent {
  18.     fun getDatabase(): DBRepository
  19. }
  20.  
  21. --------------------------------------------------------------------------------
  22.  
  23. @Module
  24. class ModuleRepository {
  25.  
  26.     @Provides
  27.     @Singleton
  28.     fun getDB(): DBRepository {
  29.         return DBRepository()
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment