Skip to content

codegen: emit the Kotlin client only for projects with a companion API (#311) - #317

Merged
turinglambdaai merged 5 commits into
mainfrom
fix/kotlin-client-gating
Oct 25, 2026
Merged

turinglambdaai merged 5 commits into
mainfrom
fix/kotlin-client-gating

Conversation

@turinglambdaai

Copy link
Copy Markdown
Owner

Closes #311.

Since the Kotlin client joined client-outputs unconditionally, every product's fresh output set requires .rivet/generated/kotlin/dev/rivet/generated/GeneratedBackend.kt — inside .rivet/, which the standard .gitignore ignores (including rivet's own example layout). doctor --release therefore failed on every desktop-only product with "1 generated file missing" until the product force-added a file nothing consumes, and examples/taskboard fails its own gate on a fresh clone.

The Kotlin client is now emitted only when the project declares companion device-rpcs — exactly the projects with a Kotlin/Android consumer. client-outputs is exported so products and tests can inspect the fresh set directly.

  • A project with no device-rpcs (or an emptied list): no Kotlin client in the fresh set; a previously generated file may linger on disk but is no longer part of the gate's contract.
  • A project declaring device-rpcs: unchanged behavior, including the RivetDeviceAPI surface.

examples/taskboard is regenerated against current main — it declares device-rpcs, keeps its Kotlin client, and its stale Swift/C++ outputs are refreshed too, so the example passes doctor --release on a fresh clone again.

Tests in rivet/tests/device-codegen.rkt: no declaration → no Kotlin path in client-outputs; declaration → Kotlin path present; emptied declaration → dropped from the fresh set.

#311)

Every project got a Kotlin client emitted into .rivet/generated/ — a tree
section the standard .gitignore excludes (rivet's own example layout
ignores it). The release freshness gate diffs the tree against
client-outputs, so every desktop-only product failed the gate with
1 generated file missing until it force-added a file nothing consumes;
examples/taskboard fails its own gate on a fresh clone.

The Kotlin client is now part of the fresh output set only when the
project declares companion device RPCs — exactly the projects with a
Kotlin consumer. client-outputs is exported so products and tests can
inspect the fresh set directly. examples/taskboard is regenerated
against current main (it declares device-rpcs and keeps its client).
The demo project has no companion API, so the fresh set no longer
contains the Kotlin client: assert its absence, declare a companion RPC
around the Kotlin content and enum content sections (which also switch
Swift into the RivetTypes device surface — the flip sits after the
Swift/C++ assertions), and restore the desktop-only manifest before the
sections that reuse the project binding.
@turinglambdaai

Copy link
Copy Markdown
Owner Author

Pushed 983831d: the codegen test suite assumed the Kotlin file always existed. It now asserts the fresh set omits it for a desktop-only project, flips the manifest to a companion API around the Kotlin content and enum content sections, and restores the desktop-only manifest afterwards. 258 tests green locally across codegen, device-codegen, doctor and acceptance-matrix.

The 'generated Swift, C++, and Kotlin clients' line was static; now it
reflects whether the project's fresh output set includes the Kotlin
client. The source-package smoke asserts the Kotlin client exists after
declaring the starter's greet RPC — a desktop-only scaffold no longer
carries the file (issue #311).
The KtSmoke scaffold is the Android consumer of the shared generated
client, so it declares the device RPCs it exercises before generating
(issue #311).
@turinglambdaai
turinglambdaai merged commit c55f824 into main Oct 25, 2026
23 checks passed
@turinglambdaai
turinglambdaai deleted the fix/kotlin-client-gating branch October 25, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kotlin client is generated for every project, so the freshness gate fails on trees that ignore .rivet/

1 participant