Dependeasy
Dependeasy is Reaktor's build layer, in dependeasy/. Each repository declares its modules, artifacts, checks
and deliveries in Kotlin. Gradle evaluates those declarations and schedules the work, while the language tools (the
Kotlin compiler, pnpm and Vite, SwiftPM, CMake) still compile and resolve their own packages. Dependeasy adds no second
scheduler, dependency resolver or runtime dependency. Reaktor, BestBuds and Manna all build with it.
Overview#
Everything a repository builds, checks and ships is declared once, in Kotlin. Gradle turns the declarations into tasks, and exportBuildModel turns the same graph into data, so Hangar, the CLI and coding agents can tell what a change affects and run exactly those checks.
How the layers split#
| Layer | Owns |
|---|---|
| Component and workspace declarations | Modules, apps, artifacts, checks, deliveries and product choices, as typed Kotlin |
| Specs and Kotlin kernels | Build decisions, tool plans, and the contracts generated for Wrangler and CMake |
| Gradle bindings | Inputs, outputs and task registration, kept thin |
| Tool wrappers | Typed arguments for pnpm, Vite, SwiftPM, CMake, Wrangler and fastlane |
| Workspace kernel | Approval, execution and run records |
| CLI, Hangar and MCP | Views of the same build model and the same operations |
Every declaration returns an ordinary Gradle task provider. An unusual case can still set a task's arguments, environment, inputs or outputs directly, or add its own task to the graph, without a new runner or a bigger options object.
Declaring a module#
A module applies one plugin bundle and declares its targets, dependencies and outputs in one call:
plugins { id("dev.shibasis.dependeasy.compose-library") }
library(namespace = "example.shared", targets = Targets.All, ui = Compose(stability = "compose-stability.conf")) {
dependencies {
common { api(Reaktor.Ui, Reaktor.Auth) }
commonTest { implementation(Versions.Kotlin.KtorMock) }
}
web(module = "example-kt")
appleFramework(exports = listOf(Reaktor.Auth))
val unit by tests(Suite.Jvm)
}
Only the platforms named in targets are created. Test dependencies sit beside each platform's production
dependencies. Builds and JVM tools run on Java 25, Android bytecode targets Java 21, and bytecode = 21 states an
explicit compatibility contract for a JVM module. For an unusual compilation, source-set layout or binary, use the
ordinary kotlin { } block in the same script.
The plugin bundles, all named dev.shibasis.dependeasy.<name>:
| Plugin | Applied by |
|---|---|
library, compose-library | Multiplatform libraries, headless or with Compose |
compose-application | Android apps |
apple-app, apple-library | The Xcode app host, and Apple-only frameworks such as a notification service extension |
web-app, browser | Web apps and Kotlin/JS browser bundles |
worker-fleet | Cloudflare Workers and their Wrangler configurations |
jvm, cli, desktop-app, spring-application | JVM programs, command-line tools, the Compose desktop app and Spring servers |
device-tests, load-tests | Maestro device flows and k6 load tests |
workspace, pipeline | A repository root, and a standalone build graph |
settings | settings.gradle.kts, which prepares native sources at pinned commits |
Inside a module, a few more declarations replace hand-written plumbing:
boundary(groupPrefixes = …, modules = …, reason = …)failscheckwhen a module reaches a dependency it must not, for example a headless runtime that pulls in Compose.generated(BuildFlags)generates a Kotlin object, declared once withGeneratedObject, intocommonMainormain.program,launcheranddistributionbuild a JVM program from its compiled@Entry, andpackagedRuntime()checks the packaged desktop app against its real jars.server(image = …)builds a Spring server with a pinned buildpack builder and a Java 25 runtime.
The workspace#
The repository root declares the product, the builds it includes, its checks, its gate and its deliveries. Abridged from BestBuds:
plugins { id("dev.shibasis.dependeasy.workspace") }
workspace {
val bestbuds = product(shared = projects.app) {
clients(projects.appAndroid, projects.appDarwin, projects.appBrowser, projects.reaktorDesktop, projects.appWeb)
services(projects.workers, projects.reaktorServer)
sites(projects.reaktorWeb, projects.companyOs)
tools(projects.reaktorCli, projects.kernel, projects.pipeline)
}
val framework = include(Reaktor.build)
val reaktorVerify by verify { include(framework.verify) }
val jsChecks by verify { include(verification(projects.app, Verification.JavaScript)) }
val reaktorWebChecks by browserTests(Playwright("tests/reaktorWeb/playwright/playwright.config.mjs"),
browserBundle(projects.reaktorWeb))
val pr by verify(bestbuds, role = Workspace.Verify, run = Run.onLocal()) {
include(reaktorVerify, jsChecks)
}
delivery(after = pr, run = Run.onMac()) {
val playInternal by release(androidBundle(projects.appAndroid, Build.Release), AndroidLane.PlayInternal)
val workers by deploy(projects.workers, run = Run.onLinux().onWorker())
}
packageScripts()
}
Checks come in a few kinds: verify groups other checks, browserTests runs a Playwright suite after the bundle it
tests, nodeTests runs Node test files, lighthouse measures a page, and external wraps a script that has no
Kotlin owner yet and names what will replace it. A check states what it covers, for example
covers(Domain.Tooling, Aspect.Security), and Hangar's Testing pane reads that coverage. run = Run.onLocal(),
Run.onMac() and Run.onWorker() say which machine a node runs on. Deployment covers the
delivery block: deploys, releases, migrations and infrastructure.
Artifacts carry their producers#
When one node consumes another's files, declare the consumption, not just the order:
dependeasy {
val frontend = javascript("frontend", "web")
val generated = tasks.register<GenerateSources>("generateSources")
val bundle = frontend.vite()
node(bundle).consumes(artifact(generated) { it.outputDirectory })
workspace {
val buildGeneratedWeb by artifacts { include(frontend.build("buildWeb", bundle = bundle)) }
}
}
consumes adds both the producer dependency and a tracked file input. after only orders work; it says nothing about
which files a node reads, so a clean or incremental build can miss a change.
./gradlew <entrypoint> --dry-run lists the tasks an entrypoint would run. ./gradlew exportBuildModel writes the
whole graph, with each node's owning build and declaration site, to build/dependeasy/model.json. Hangar, the CLI and
the MCP door read that file; the build itself never depends on it.

The toolchain#
ToolchainVersions.kt, in dependeasy/gradle/src/main/kotlin/dev/shibasis/dependeasy/toolchain, is ordinary Kotlin
and the only place versions live for Reaktor, BestBuds and Manna. There is no generated version file,
properties catalog or TOML catalog. It selects:
| Tool | Version |
|---|---|
| Kotlin | 2.4.21 |
| Gradle | 9.7 |
| Android Gradle plugin and NDK | 9.1.1 and r30 |
| Java | 25 for builds and tools; 21 for Android bytecode and for Dependeasy itself |
| C++ | C++23 |
| Swift | Language mode 6; Swift 6.4 recommended, Xcode's 6.3 also works |
| TypeScript | 7.0.2, with 6.0.3 for tools that need the JavaScript compiler API |
| Node and pnpm | 24.21.0 LTS and 12.10.1 |
Gradle, Node and pnpm downloads are checksum-verified and shared under ~/.gradle/dependeasy/tools. Kotlin generates
its JavaScript package metadata into the same pnpm workspace and never runs its own npm or Yarn installer.
Dependencies come from Maven Central and Google; JitPack and GitHub Packages are filtered to their package groups.
Maven Local is off unless you pass -Pdependeasy.useMavenLocal=true. Add an exceptional repository with
dependencyRepositories { maven { url = uri("…") } }.
Reproducible installs#
- pnpm installs with
--frozen-lockfilefrom the repository'spnpm-lock.yaml, andpnpm runrefuses stale dependencies instead of installing them. Change dependencies on purpose with./gradlew pnpmLock. - SwiftPM builds with automatic resolution off. Resolve on purpose and commit
Package.resolved. - CMake gets a separate build directory per target and configuration. Sources, headers, arguments, tool identity and dependencies all invalidate it.
- Native sources are pinned by full commit SHA in
NativeSources.kt. Checking them out is a task, never a settings-time clone, and a checkout with local edits is rejected rather than reset.
A build is only as reproducible as its tasks' declared inputs. A custom task must declare its tools, environment, files and outputs, and a Node script must declare the files it reads.
Platforms#
- Apple. A library's Apple targets produce Kotlin libraries; only an app or a deliberate umbrella module exports a
framework. Xcode's first build phase runs
:app:embedAndSignAppleFrameworkForXcode, and the Xcode SDK and configuration pick the Kotlin slice. Third-party SDKs such as Google Sign-In and Firebase are exact-version SwiftPM dependencies, reached through small Swift adapters in each module'ssrc/iosMain/swift; Kotlin keeps the behaviour. There is no CocoaPods. - Web. A web app is one declaration, for example
webApp(kotlin = listOf(kotlinJsLibrary(projects.app)), tests = Vitest()), with typed bundles (WebBundle.Vite,WebBundle.Node,WebBundle.Package), generators and checks. Kotlin/JS exports are written to each module'sbuild/dependeasy/kotlin/libraryand reach JavaScript consumers through the frozen pnpm installation. - Native. Typed CMake tasks, Android Prefab extraction and Kotlin/Native cinterop share one declaration. Hermes builds its host compiler once with the macOS SDK.
- JVM. Programs, launchers and distributions share one classpath. The desktop app keeps the ordinary Compose packaging DSL; Spring servers use Gradle's own BOM support.
Package scripts are graph nodes#
With packageScripts(), a package.json script that builds, tests, deploys or releases is a node in the build model,
and its script entry is a generated alias that calls Gradle. Scripts that start a dev server or open an operations
tool stay as written. Never hide a Gradle command inside an authored package script: declare the node instead, so
Hangar, the CLI and the gate can see it.
Local CI and releases#
CI runs locally, through reaktor build run pr in each repository; there are no GitHub Actions workflows.
Mac-only and physical-device nodes stay in the graph and run on their declared host.
Store releases are release(output, lane) nodes inside delivery(after = pr). A release runs after the gate, and so
do the producers of what it consumes. If a release would consume an output the gate itself builds, which would make
the gate depend on itself, the build stops before any task runs and names the release, the producer and the gate.
fastlane runs from the product's locked Gemfile through a shared launcher.
From the terminal#
./gradlew pr --dry-run
reaktor build tree
reaktor build explain bestbuds:pr
reaktor build plan bestbuds:pr
reaktor build run bestbuds:pr --json
reaktor build affected --since HEAD
affected reads Git and declared inputs, follows dependency edges and reports what it could not cover; it does not
run anything. CLI has the full command set. To test Dependeasy itself, run
./gradlew -p dependeasy test from the Reaktor root: TestKit drives the graph and real pnpm, SwiftPM and CMake
commands.
Try it: what a change selects#
reaktor build affected starts from the changed paths. A path inside a node's declared input selects that node, and
the selection then spreads to every node that consumes it, includes it or runs after it. ordered after only orders
work, so nothing spreads along it. A changed build declaration selects everything, because it could change any node.
The box below applies the same rules to a small graph written as text. Each node lists its inputs and edges, and the
paths under changed stand in for git diff.
Things to try:
- Leave it as it is.
Circles.ktsits in the compile's input tree, so the compile is selected. So are the JVM tests and the web bundle that consume it, the browser tests that run after the bundle, and theprgate that includes the tests.README.mdmatches no input, and the answer lists it instead of dropping it. - Replace the
Circles.ktline withworkers/auth/index.ts. The auth Worker's deploy is selected but the chat Worker's is not:ordered afterputs the chat deploy after the auth deploy without depending on it. - Change the browser tests'
aftertoordered after. A change to the app no longer selects them. - Delete the
consumesline underweb:vite. The bundle still reads the compiled code, but nothing declares that, so the selection misses the bundle and the browser tests. This is why the rules below insist on declared state. - Add
build.gradle.ktsunderchanged. Every node is selected.
node bestbuds:app:compileKotlinJvm
input tree app/src/commonMain
input configuration jvmCompileClasspath
node bestbuds:app:jvmTest
input tree app/src/jvmTest
consumes bestbuds:app:compileKotlinJvm
node bestbuds:web:vite
input tree web/src
consumes bestbuds:app:compileKotlinJvm
node bestbuds:web:browserTests
input tree tests/web include **/*.spec.ts
after bestbuds:web:vite
node bestbuds:workers:deployAuth
input tree workers/auth
node bestbuds:workers:deployChat
input tree workers/chat
ordered after bestbuds:workers:deployAuth
node bestbuds:pr
includes bestbuds:app:jvmTest
includes bestbuds:web:browserTests
declarations
build.gradle.kts
changed
app/src/commonMain/circles/Circles.kt
README.md
The Not covered list matters as much as the selection. Gradle resolves a configuration such as a classpath, so
affected cannot match changed files against it, and it matches a tree with filters as the whole tree. The real
command reports the same gaps, marks its coverage as partial, and never treats a selection as permission to reuse old
results.
Rules for build changes#
- Keep declaring separate from running. Applying a plugin or reading a plan must not install dependencies, clone repositories or compile tools.
- Compose small domain APIs. A component declares its sources and producers; its tasks can then join any graph.
- Carry the producer with every artifact, and give every task declared state instead of reading
Projectwhile it runs. - Put each mechanism in its own domain, and keep product choices visible where they are made.
- Keep real constraints. Never disable lint, weaken a type check, raise a budget or add a stub to make a build look green.
What Dependeasy improves#
| Usual approach | What goes wrong | Dependeasy's approach |
|---|---|---|
| A hand-written Gradle script per module | Each module repeats its targets, dependencies and plumbing, and the copies drift apart | One plugin bundle and one library(...) call declare a module's targets, dependencies and outputs |
| CI written in YAML for a hosted runner | The pipeline is a second build definition that only runs remotely, and it drifts from the local build | The pr gate is a node in the same graph, and reaktor build run pr runs it on your machine or the build worker |
Ordering tasks with dependsOn | Ordering says nothing about which files a task reads, so an incremental build can miss a change | consumes declares the producer and a tracked file input together |
| Guessing which tests a change needs | People run everything, which is slow, or run too little and miss a break | The build model records every node and its inputs, and reaktor build affected follows them from the changed files, saying what it could not cover |
Limitations#
- Gradle is required. Dependeasy adds no scheduler of its own, so a repository that does not use Gradle cannot use it.
affectedcan only follow what is declared. An input a task reads without declaring it is invisible to it, which is why the rules above insist on declared state.- The build model holds declarations, not live state. Observed runs are not yet recorded beside them.
- There are no bundle or runtime budgets per product yet.
- Signed Apple archives on physical devices, JVM production start-up and credentialed store releases are not qualified yet.
Open work#
- Qualify compiler updates per target, and the new Android KMP plugin with the existing NDK and CMake integration.
- Record observed runs separately from declarations before the model shows live state.
- Set product bundle and runtime budgets, and qualify the browser flows against them.
- Replace host OpenSSL discovery with pinned, target-specific crypto artifacts.
- Qualify signed Apple archives on physical devices, JVM production start-up, and credentialed store releases.
- Measure cold and warm builds under controlled load.