Skip to content

feat(gradle): build the contract packages from local checkouts - #1327

Merged
bmc08gt merged 1 commit into
code/cashfrom
feat/local-proto-development
Aug 25, 2026
Merged

feat(gradle): build the contract packages from local checkouts#1327
bmc08gt merged 1 commit into
code/cashfrom
feat/local-proto-development

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Changing a .proto and seeing it in the app required a real release of the client packages, because
gradle/libs.versions.toml is the only way in. Maven Central will not take a version number twice,
so iterating burned versions.

settings.gradle.kts now reads an optional protoLocalRoot from local.properties. When it is
set, the build includes ocp-client-protocol and flipcash2-client-protocol from that directory as
composite builds. Gradle substitutes them for com.flipcash:ocp-client-protocol and
com.flipcash:flipcash2-client-protocol on its own because the coordinates match, so no module
declares anything different and the pinned versions are ignored while the override is on. A missing
checkout fails configuration with the path it looked for rather than silently falling back.

The opt-in lives in local.properties, which is untracked and never written by CI, so a release
build resolves the version pins exactly as it does today.

Substitution is confirmed rather than assumed: with both versions temporarily pinned to a
nonexistent 99.99.99, resolution succeeds with protoLocalRoot set and reports
com.flipcash:ocp-client-protocol:99.99.99 FAILED without it. A message appended to an uncommitted
.proto reached com.codeinc.opencode.gen.common.v1.LocalDevProbe, and
:services:opencode:compileDebugKotlin built against it.

Pairs with the client-repo change that lets the contract itself be synced from a local checkout:
code-payments/ocp-client-protocol#3 and code-payments/flipcash2-client-protocol#3.

Trying a proto change meant publishing a version for it, because the contract
packages are only ever consumed at the versions pinned in libs.versions.toml.
Setting protoLocalRoot in local.properties includes ocp-client-protocol and
flipcash2-client-protocol as composite builds instead, and Gradle substitutes
the com.flipcash modules for them on its own, because the coordinates match.

Verified by pinning both versions to a nonexistent 99.99.99:
:services:opencode resolves with protoLocalRoot set, and reports
com.flipcash:ocp-client-protocol:99.99.99 FAILED without it, so the opt-in is
what selects the local build rather than a cached artifact.

local.properties is untracked and CI never writes it, so release builds keep
resolving the published versions.
@github-actions github-actions Bot added type: feature New functionality area: build-system Gradle, convention plugins, build-logic and removed type: feature New functionality labels Aug 25, 2026
@bmc08gt
bmc08gt merged commit fd91e98 into code/cash Aug 25, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the feat/local-proto-development branch August 25, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build-system Gradle, convention plugins, build-logic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant