Set up project skeleton (milestone 1)
- Architecture and feature overview in docs/ARCHITECTURE.md - Gradle 9.8 / AGP 9.4 / Kotlin 2.4 with version catalog and convention plugins - Modules :app, :core:*, :device-profiles, :feature:* (placeholder screens) - Flavors core (no INTERNET, enforced by a build check) and full - Material You theme, navigation, expert mode and dry-run settings (DataStore) - Pixel 8-10 device detection, unit tests, GPLv3 license, English README with Obtainium badge Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
plugins {
|
||||
alias(libs.plugins.pixelwall.jvm.library)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(project(":core:domain"))
|
||||
api(libs.junit)
|
||||
api(libs.kotlinx.coroutines.test)
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package org.pixelwall.core.testing
|
||||
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.update
|
||||
import org.pixelwall.core.domain.UserPreferences
|
||||
import org.pixelwall.core.domain.UserPreferencesRepository
|
||||
|
||||
class FakeUserPreferencesRepository(initial: UserPreferences = UserPreferences()) : UserPreferencesRepository {
|
||||
private val state = MutableStateFlow(initial)
|
||||
override val preferences: Flow<UserPreferences> = state
|
||||
override suspend fun setExpertMode(enabled: Boolean) = state.update { it.copy(expertMode = enabled) }
|
||||
override suspend fun setDryRun(enabled: Boolean) = state.update { it.copy(dryRun = enabled) }
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.pixelwall.core.testing
|
||||
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.test.TestDispatcher
|
||||
import kotlinx.coroutines.test.UnconfinedTestDispatcher
|
||||
import kotlinx.coroutines.test.resetMain
|
||||
import kotlinx.coroutines.test.setMain
|
||||
import org.junit.rules.TestWatcher
|
||||
import org.junit.runner.Description
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
class MainDispatcherRule(
|
||||
val dispatcher: TestDispatcher = UnconfinedTestDispatcher(),
|
||||
) : TestWatcher() {
|
||||
override fun starting(description: Description) = Dispatchers.setMain(dispatcher)
|
||||
override fun finished(description: Description) = Dispatchers.resetMain()
|
||||
}
|
||||
Reference in New Issue
Block a user