Skip to content
12 min readUpdated 23 Nov 2026

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#

Dependeasy. You declare modules, checks and deliveries in Kotlin. Gradle schedules the work and the language tools compile. exportBuildModel writes the whole graph to build/dependeasy/model.json, which Hangar, the reaktor CLI and coding agents read. Local CI runs the pr gate, and deliveries run after it.YOU DECLARE IN KOTLINlibrary(namespace = "example.shared",        targets = Targets.All) {  dependencies {    common { api(Reaktor.Auth) }  }  val unit by tests(Suite.Jvm)}workspace {  val app = product(shared = …)  val pr by verify(app) {    include(reaktorVerify, jsChecks)  }  delivery(after = pr) {    val workers by deploy(…)    val playInternal by release(…)  }}GRADLE RUNS THE WORKOne task graphGradle evaluates the declarations andschedules every node; inputs andoutputs are tracked per nodeTHE LANGUAGE TOOLS STILL COMPILEKotlin compilerpnpm and ViteSwiftPMCMakeWranglerfastlanepr gatethe checks a changemust pass, runlocally or onthe workerDeliveriesdeploys and storereleases, whichrun only afterthe gateevaluateONE BUILD MODEL, MANY READERSbuild/dependeasy/model.json./gradlew exportBuildModel writes every node,its build and its declaration; builds never read itHangar Testing and Build paneschecks, coverage, affected checksThe reaktor CLIbuild tree, explain, plan, run, affectedCoding agents through MCPatlas_query affected-checks, check_runLocal CIreaktor build run pr runs the pr nodeon this Mac or the build workerexport
One declaration, one task graph and one build model. The tools that show or run the build read the model; the build itself never does.

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#

LayerOwns
Component and workspace declarationsModules, apps, artifacts, checks, deliveries and product choices, as typed Kotlin
Specs and Kotlin kernelsBuild decisions, tool plans, and the contracts generated for Wrangler and CMake
Gradle bindingsInputs, outputs and task registration, kept thin
Tool wrappersTyped arguments for pnpm, Vite, SwiftPM, CMake, Wrangler and fastlane
Workspace kernelApproval, execution and run records
CLI, Hangar and MCPViews 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>:

PluginApplied by
library, compose-libraryMultiplatform libraries, headless or with Compose
compose-applicationAndroid apps
apple-app, apple-libraryThe Xcode app host, and Apple-only frameworks such as a notification service extension
web-app, browserWeb apps and Kotlin/JS browser bundles
worker-fleetCloudflare Workers and their Wrangler configurations
jvm, cli, desktop-app, spring-applicationJVM programs, command-line tools, the Compose desktop app and Spring servers
device-tests, load-testsMaestro device flows and k6 load tests
workspace, pipelineA repository root, and a standalone build graph
settingssettings.gradle.kts, which prepares native sources at pinned commits

Inside a module, a few more declarations replace hand-written plumbing:

  • boundary(groupPrefixes = …, modules = …, reason = …) fails check when 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 with GeneratedObject, into commonMain or main.
  • program, launcher and distribution build a JVM program from its compiled @Entry, and packagedRuntime() 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.

Hangar's Build pane on the BestBuds repository. The Targets tab lists the build's 25 declarations on the left. On the right, androidArtifacts shows its kind, an artifact set; its host, portable; its runner, Gradle; its kernel; its declared invocation; and the Android APK it consumes. A banner says one declaration input changed and asks for a fresh export before planning or running.
Hangar's Build pane reads the exported model, here 1,908 nodes and 2,214 relationships. Each target shows its kind, host, runner, kernel and the outputs it consumes. Every row says Stale because the repository had changed since the last export.

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:

ToolVersion
Kotlin2.4.21
Gradle9.7
Android Gradle plugin and NDK9.1.1 and r30
Java25 for builds and tools; 21 for Android bytecode and for Dependeasy itself
C++C++23
SwiftLanguage mode 6; Swift 6.4 recommended, Xcode's 6.3 also works
TypeScript7.0.2, with 6.0.3 for tools that need the JavaScript compiler API
Node and pnpm24.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-lockfile from the repository's pnpm-lock.yaml, and pnpm run refuses 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's src/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's build/dependeasy/kotlin/library and 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:

  1. Leave it as it is. Circles.kt sits 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 the pr gate that includes the tests. README.md matches no input, and the answer lists it instead of dropping it.
  2. Replace the Circles.kt line with workers/auth/index.ts. The auth Worker's deploy is selected but the chat Worker's is not: ordered after puts the chat deploy after the auth deploy without depending on it.
  3. Change the browser tests' after to ordered after. A change to the app no longer selects them.
  4. Delete the consumes line under web: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.
  5. Add build.gradle.kts under changed. 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 Project while 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 approachWhat goes wrongDependeasy's approach
A hand-written Gradle script per moduleEach module repeats its targets, dependencies and plumbing, and the copies drift apartOne plugin bundle and one library(...) call declare a module's targets, dependencies and outputs
CI written in YAML for a hosted runnerThe pipeline is a second build definition that only runs remotely, and it drifts from the local buildThe 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 dependsOnOrdering says nothing about which files a task reads, so an incremental build can miss a changeconsumes declares the producer and a tracked file input together
Guessing which tests a change needsPeople run everything, which is slow, or run too little and miss a breakThe 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.
  • affected can 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.