Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package voice.core.data.repo.internals

import android.content.Context
import androidx.datastore.core.DataStore
import androidx.room.migration.Migration
import androidx.test.core.app.ApplicationProvider
import dev.zacsweers.metro.AppScope
import dev.zacsweers.metro.DependencyGraph
import dev.zacsweers.metro.Provides
import dev.zacsweers.metro.SingleIn
import dev.zacsweers.metro.createGraphFactory
import voice.core.data.store.DarkThemeStore
import dev.zacsweers.metro.createGraph

@SingleIn(AppScope::class)
@DependencyGraph(
Expand All @@ -18,25 +13,8 @@ import voice.core.data.store.DarkThemeStore
internal interface TestGraph {

val migrations: Set<@JvmSuppressWildcards Migration>

@DependencyGraph.Factory
interface Factory {

fun create(
@Provides
@DarkThemeStore
darkThemeStore: DataStore<Boolean>,
@Provides
context: Context,
): TestGraph
}
}

internal fun allMigrations(): Array<Migration> {
return createGraphFactory<TestGraph.Factory>()
.create(
darkThemeStore = MemoryDataStore(false),
context = ApplicationProvider.getApplicationContext(),
)
.migrations.toTypedArray()
return createGraph<TestGraph>().migrations.toTypedArray()
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
package voice.core.playback.di

import dev.zacsweers.metro.Scope

@Scope
annotation class PlaybackScope
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ package voice.features.bookOverview.di
import dev.zacsweers.metro.AppScope
import dev.zacsweers.metro.ContributesTo
import dev.zacsweers.metro.GraphExtension
import dev.zacsweers.metro.Scope
import voice.features.bookOverview.bottomSheet.BottomSheetViewModel
import voice.features.bookOverview.deleteBook.DeleteBookViewModel
import voice.features.bookOverview.editTitle.EditBookTitleViewModel
import voice.features.bookOverview.fileCover.FileCoverViewModel
import voice.features.bookOverview.overview.BookOverviewViewModel

@Scope
annotation class BookOverviewScope

@GraphExtension(scope = BookOverviewScope::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,6 @@ class BookmarkViewModel(

@AssistedFactory
interface Factory {
fun create(id: BookId): BookmarkViewModel
fun create(bookId: BookId): BookmarkViewModel
}
}
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ agp = "9.0.1"
ktlint-core = "1.8.0"
ktlint-gradlePlugin = "0.13.0"
retrofit = "3.0.0"
metro = "0.10.3"
metro = "0.11.1"
navigation3 = "1.0.1"

[libraries]
Expand Down Expand Up @@ -144,6 +144,6 @@ googleServices = { id = "com.google.gms.google-services", version = "4.4.4" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version = "2.3.5" }
ksp = { id = "com.google.devtools.ksp", version = "2.3.6" }
ktlint = { id = "io.github.usefulness.ktlint-gradle-plugin", version.ref = "ktlint-gradlePlugin" }
metro = { id = "dev.zacsweers.metro", version.ref = "metro" }