-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate dagger/hilt to koin for multiplatform DI (#434)
- Loading branch information
David Ly
committed
Sep 12, 2023
1 parent
d500aa4
commit 147bc9c
Showing
228 changed files
with
1,464 additions
and
1,490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
app/src/androidTest/java/ly/david/mbjc/MusicSearchRoomDatabaseTestRule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package ly.david.mbjc | ||
|
||
import ly.david.data.room.MusicSearchRoomDatabase | ||
import org.junit.rules.TestWatcher | ||
import org.junit.runner.Description | ||
|
||
class MusicSearchRoomDatabaseTestRule( | ||
private val database: MusicSearchRoomDatabase, | ||
) : TestWatcher() { | ||
override fun starting(description: Description) { | ||
super.starting(description) | ||
} | ||
|
||
override fun finished(description: Description) { | ||
super.finished(description) | ||
database.clearAllTables() | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
app/src/androidTest/java/ly/david/mbjc/TestAndroidAppModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package ly.david.mbjc | ||
|
||
import ly.david.data.coverart.CoverArtDataModule | ||
import ly.david.data.di.auth.AuthStoreModule | ||
import ly.david.data.di.coroutines.coroutinesScopesModule | ||
import ly.david.data.di.logging.loggingModule | ||
import ly.david.data.di.musicbrainz.musicBrainzAuthModule | ||
import ly.david.data.di.room.databaseDaoModule | ||
import ly.david.data.domain.DomainDataModule | ||
import ly.david.data.musicbrainz.auth.MusicBrainzDataModule | ||
import ly.david.data.spotify.di.SpotifyDataModule | ||
import ly.david.mbjc.di.appDataModule | ||
import ly.david.mbjc.di.testCoroutineDispatchersModule | ||
import ly.david.mbjc.di.testDatabaseModule | ||
import ly.david.mbjc.di.testImageModule | ||
import ly.david.mbjc.di.testNetworkModule | ||
import ly.david.mbjc.di.testPreferencesDataStoreModule | ||
import ly.david.ui.collections.CollectionUiModule | ||
import ly.david.ui.common.CommonUiModule | ||
import ly.david.ui.history.HistoryUiModule | ||
import ly.david.ui.nowplaying.NowPlayingUiModule | ||
import ly.david.ui.settings.SettingsUiModule | ||
import org.koin.dsl.module | ||
import org.koin.ksp.generated.module | ||
|
||
val testAndroidAppModule = module { | ||
includes( | ||
testCoroutineDispatchersModule, | ||
testNetworkModule, | ||
testPreferencesDataStoreModule, | ||
testDatabaseModule, | ||
testImageModule, | ||
|
||
ViewModelsModule().module, | ||
appDataModule, | ||
coroutinesScopesModule, | ||
loggingModule, | ||
musicBrainzAuthModule, | ||
databaseDaoModule, | ||
CoverArtDataModule().module, | ||
DomainDataModule().module, | ||
MusicBrainzDataModule().module, | ||
SpotifyDataModule().module, | ||
AuthStoreModule().module, | ||
CollectionUiModule().module, | ||
CommonUiModule().module, | ||
HistoryUiModule().module, | ||
NowPlayingUiModule().module, | ||
SettingsUiModule().module, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package ly.david.mbjc | ||
|
||
import android.app.Application | ||
import org.koin.android.ext.koin.androidContext | ||
import org.koin.core.context.startKoin | ||
import org.koin.core.context.stopKoin | ||
|
||
class TestApplication : Application() { | ||
override fun onCreate() { | ||
super.onCreate() | ||
startKoin { | ||
androidContext(this@TestApplication) | ||
modules(testAndroidAppModule) | ||
} | ||
} | ||
|
||
override fun onTerminate() { | ||
super.onTerminate() | ||
stopKoin() | ||
} | ||
} |
45 changes: 0 additions & 45 deletions
45
app/src/androidTest/java/ly/david/mbjc/di/FakeImageModule.kt
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
app/src/androidTest/java/ly/david/mbjc/di/FakeNetworkModule.kt
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
app/src/androidTest/java/ly/david/mbjc/di/FakePreferencesDataStoreModule.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.