diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index daa92c6b93..009ba7769b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,7 +10,7 @@ androidx-lifecycle = "2.6.1" androidx-room = "2.5.2" androidx-viewpager2 = "1.0.0" androidx-work = "2.8.1" -dagger = "2.47" +dagger = "2.48" eventbus = "3.3.1" facebook = "16.2.0" facebook-flipper = "0.213.0" diff --git a/library/analytics/src/main/kotlin/org/cru/godtools/analytics/appsflyer/AppsFlyerModule.kt b/library/analytics/src/main/kotlin/org/cru/godtools/analytics/appsflyer/AppsFlyerModule.kt index eda6a7b047..c61d71f0d2 100644 --- a/library/analytics/src/main/kotlin/org/cru/godtools/analytics/appsflyer/AppsFlyerModule.kt +++ b/library/analytics/src/main/kotlin/org/cru/godtools/analytics/appsflyer/AppsFlyerModule.kt @@ -14,7 +14,7 @@ abstract class AppsFlyerModule { @Binds @IntoSet @EagerSingleton(threadMode = EagerSingleton.ThreadMode.MAIN) - abstract fun AppsFlyerAnalyticsService.eagerSingleton(): Any + abstract fun eagerSingleton(service: AppsFlyerAnalyticsService): Any @Multibinds abstract fun deepLinkResolvers(): Set diff --git a/library/api/src/main/kotlin/org/cru/godtools/api/ApiModule.kt b/library/api/src/main/kotlin/org/cru/godtools/api/ApiModule.kt index d74d9355a0..83a2e72992 100644 --- a/library/api/src/main/kotlin/org/cru/godtools/api/ApiModule.kt +++ b/library/api/src/main/kotlin/org/cru/godtools/api/ApiModule.kt @@ -112,43 +112,45 @@ object ApiModule { @Provides @Reusable - fun @receiver:Named(MOBILE_CONTENT_API) Retrofit.analyticsApi() = create() + fun analyticsApi(@Named(MOBILE_CONTENT_API) retrofit: Retrofit): AnalyticsApi = retrofit.create() @Provides @Reusable - fun @receiver:Named(MOBILE_CONTENT_API) Retrofit.attachmentsApi() = create() + fun attachmentsApi(@Named(MOBILE_CONTENT_API) retrofit: Retrofit): AttachmentsApi = retrofit.create() @Provides @Reusable - fun @receiver:Named(MOBILE_CONTENT_API) Retrofit.authApi() = create() + fun authApi(@Named(MOBILE_CONTENT_API) retrofit: Retrofit): AuthApi = retrofit.create() @Provides @Reusable - fun @receiver:Named(MOBILE_CONTENT_API) Retrofit.followupApi() = create() + fun followupApi(@Named(MOBILE_CONTENT_API) retrofit: Retrofit): FollowupApi = retrofit.create() @Provides @Reusable - fun @receiver:Named(MOBILE_CONTENT_API) Retrofit.languagesApi() = create() + fun languagesApi(@Named(MOBILE_CONTENT_API) retrofit: Retrofit): LanguagesApi = retrofit.create() @Provides @Reusable - fun @receiver:Named(MOBILE_CONTENT_API) Retrofit.toolsApi() = create() + fun toolsApi(@Named(MOBILE_CONTENT_API) retrofit: Retrofit): ToolsApi = retrofit.create() @Provides @Reusable - fun @receiver:Named(MOBILE_CONTENT_API) Retrofit.translationsApi() = create() + fun translationsApi(@Named(MOBILE_CONTENT_API) retrofit: Retrofit): TranslationsApi = retrofit.create() @Provides @Reusable - fun @receiver:Named(MOBILE_CONTENT_API_AUTHENTICATED) Retrofit.userApi() = create() + fun userApi(@Named(MOBILE_CONTENT_API_AUTHENTICATED) retrofit: Retrofit): UserApi = retrofit.create() @Provides @Reusable - fun @receiver:Named(MOBILE_CONTENT_API_AUTHENTICATED) Retrofit.userCountersApi() = create() + fun userCountersApi( + @Named(MOBILE_CONTENT_API_AUTHENTICATED) retrofit: Retrofit, + ): UserCountersApi = retrofit.create() @Provides @Reusable - fun @receiver:Named(MOBILE_CONTENT_API) Retrofit.viewsApi() = create() + fun viewsApi(@Named(MOBILE_CONTENT_API) retrofit: Retrofit): ViewsApi = retrofit.create() @Provides @Singleton diff --git a/library/db/src/main/kotlin/org/cru/godtools/db/DatabaseModule.kt b/library/db/src/main/kotlin/org/cru/godtools/db/DatabaseModule.kt index 3d5731a79e..26ea36f37c 100644 --- a/library/db/src/main/kotlin/org/cru/godtools/db/DatabaseModule.kt +++ b/library/db/src/main/kotlin/org/cru/godtools/db/DatabaseModule.kt @@ -40,75 +40,79 @@ object DatabaseModule { @Provides @Reusable - internal fun GodToolsRoomDatabase.attachmentsRepository(legacyDb: GodToolsDatabase): AttachmentsRepository { + internal fun attachmentsRepository(db: GodToolsRoomDatabase, legacyDb: GodToolsDatabase): AttachmentsRepository { legacyDb.triggerDataMigration() - return attachmentsRepository + return db.attachmentsRepository } @Provides @Reusable - internal fun LegacyDownloadedFilesRepository.downloadedFilesRepository( + internal fun downloadedFilesRepository( + repository: LegacyDownloadedFilesRepository, legacyDb: GodToolsDatabase, ): DownloadedFilesRepository { legacyDb.triggerDataMigration() - return this + return repository } @Provides @Reusable - internal fun GodToolsRoomDatabase.languagesRepository(legacyDb: GodToolsDatabase): LanguagesRepository { + internal fun languagesRepository(db: GodToolsRoomDatabase, legacyDb: GodToolsDatabase): LanguagesRepository { legacyDb.triggerDataMigration() - return languagesRepository + return db.languagesRepository } @Provides @Reusable - internal fun GodToolsRoomDatabase.followupsRepository(legacyDb: GodToolsDatabase): FollowupsRepository { + internal fun followupsRepository(db: GodToolsRoomDatabase, legacyDb: GodToolsDatabase): FollowupsRepository { legacyDb.triggerDataMigration() - return followupsRepository + return db.followupsRepository } @Provides @Reusable - internal fun GodToolsRoomDatabase.globalActivityRepository(legacyDb: GodToolsDatabase): GlobalActivityRepository { + internal fun globalActivityRepository( + db: GodToolsRoomDatabase, + legacyDb: GodToolsDatabase, + ): GlobalActivityRepository { legacyDb.triggerDataMigration() - return globalActivityRepository + return db.globalActivityRepository } @Provides @Reusable - internal fun GodToolsRoomDatabase.trainingTipsRepository(legacyDb: GodToolsDatabase): TrainingTipsRepository { + internal fun trainingTipsRepository(db: GodToolsRoomDatabase, legacyDb: GodToolsDatabase): TrainingTipsRepository { legacyDb.triggerDataMigration() - return trainingTipsRepository + return db.trainingTipsRepository } @Provides @Reusable - internal fun GodToolsRoomDatabase.userRepository(): UserRepository = userRepository + internal fun userRepository(db: GodToolsRoomDatabase): UserRepository = db.userRepository @Provides @Reusable - internal fun GodToolsRoomDatabase.userCountersRepository(legacyDb: GodToolsDatabase): UserCountersRepository { + internal fun userCountersRepository(db: GodToolsRoomDatabase, legacyDb: GodToolsDatabase): UserCountersRepository { legacyDb.triggerDataMigration() - return userCountersRepository + return db.userCountersRepository } @Provides @Reusable - internal fun GodToolsRoomDatabase.lastSyncTimeRepository(): LastSyncTimeRepository = lastSyncTimeRepository + internal fun lastSyncTimeRepository(db: GodToolsRoomDatabase): LastSyncTimeRepository = db.lastSyncTimeRepository @Provides @Reusable - internal fun GodToolsRoomDatabase.toolsRepository(legacyDb: GodToolsDatabase): ToolsRepository { + internal fun toolsRepository(db: GodToolsRoomDatabase, legacyDb: GodToolsDatabase): ToolsRepository { legacyDb.triggerDataMigration() - return toolsRepository + return db.toolsRepository } @Provides @Reusable - internal fun GodToolsRoomDatabase.translationsRepository(legacyDb: GodToolsDatabase): TranslationsRepository { + internal fun translationsRepository(db: GodToolsRoomDatabase, legacyDb: GodToolsDatabase): TranslationsRepository { legacyDb.triggerDataMigration() - return translationsRepository + return db.translationsRepository } private fun GodToolsDatabase.triggerDataMigration() {