Installation
Sinew is a set of small packages. Add the ones you need; every one is released at the same version.
Requirements
| Kotlin | Dart | |
|---|---|---|
| Language | Kotlin 2.4, JDK 17 | Dart 3.13 |
| Platforms | Android (minSdk 24), iOS, JVM desktop, wasm | Android, iOS, web, macOS, Windows, Linux |
| Tools | Xcode for iOS | Flutter 3.47, and CMake for sinew_security |
Add the packages
- Kotlin
- Dart
Add the BOM once, then the modules you need, with no versions:
dependencies {
implementation(platform("com.srctool.sinew:sinew-bom:1.1.0"))
implementation("com.srctool.sinew:sinew-models")
implementation("com.srctool.sinew:sinew-exception")
implementation("com.srctool.sinew:sinew-network")
implementation("com.srctool.sinew:sinew-paging")
implementation("com.srctool.sinew:sinew-viewmodel")
testImplementation("com.srctool.sinew:sinew-testing")
}
In a Kotlin Multiplatform module, put the same lines in the commonMain dependencies. sinew-testing belongs in tests only.
Sinew's own dependency on Camouflage
Only sinew-camouflage (sinew_camouflage) depends on Camouflage. Leave it out and you never see Camouflage.
Developer tools: one artifact per build
Devtools never reach a production build. The app chooses, per build:
- Kotlin
- Dart
On Android, each variant is given one artifact, and a new variant has to choose:
// sample: kotlin-lib/sample/androidApp/build.gradle.kts#devtools-variants
"productionDebugImplementation"(projects.sinewDevtoolsUi)
"stagingImplementation"(projects.sinewDevtoolsUi)
"productionReleaseImplementation"(projects.sinewDevtoolsNoop)
On iOS, desktop and web, the convention is a Gradle property that picks the artifact (the sample uses -Psinew.devtools=true for the real one, and the no-op without it), so a build that forgets it fails safe.
Platform setup
sinew_securityon Flutter compiles BoringSSL forwebcrypto, so every machine that builds the app needs CMake on itsPATH. The first build per platform takes a minute or two longer.- Biometrics need a little native setup on each platform: see Security.
- Secure storage on macOS needs the Keychain Sharing entitlement.