Setup
VIE ships two artifacts:
| Artifact | Purpose |
|---|---|
|
The library: the contract, the ViewModel, the view, middlewares, and |
|
The test helpers: |
VIE 0.1.0 is built with Kotlin 2.4.20 and Compose Multiplatform 1.12.0. Use these versions or newer.
An Android target needs a minSdk of 26 or more, and the JVM artifact is built for Java 17, so it needs a JDK 17 or later.
A module that writes views also needs the Kotlin Compose compiler plugin, which Compose projects already apply.
Kotlin Multiplatform
Add vie-mvi to the common code, and vie-test to the common tests:
kotlin {
sourceSets {
commonMain.dependencies {
implementation("org.kodein.arch.vie:vie-mvi:0.1.0")
}
commonTest.dependencies {
implementation("org.kodein.arch.vie:vie-test:0.1.0") (1)
}
}
}
| 1 | A separate artifact, so the test helpers never reach a production source set. |
JVM or Android only
A project with a single platform adds the same artifacts to its dependencies:
dependencies {
implementation("org.kodein.arch.vie:vie-mvi:0.1.0")
testImplementation("org.kodein.arch.vie:vie-test:0.1.0")
}
What comes along
VIE’s own signatures use Compose, ViewModel and coroutines types, so these come along as transitive dependencies:
-
org.jetbrains.compose.runtime:runtime, sinceVIEViewandSignalEffectare@Composable; -
org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose, sinceVIEViewModelextendsViewModel; -
org.jetbrains.kotlinx:kotlinx-coroutines-core, since models and signals are flows.
vie-test also brings org.jetbrains.kotlinx:kotlinx-coroutines-test, which runVMTest is built on.
VIE does not bring Compose Foundation or Material: your views use whichever components you choose.