Skip to content

feat(api): build the contract packages from local checkouts - #646

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

feat(api): build the contract packages from local checkouts#646
bmc08gt merged 1 commit into
mainfrom
feat/local-proto-development

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

FlipcashAPI/Package.swift pins both contract packages with .package(url:, exact:), so trying a
contract change meant tagging a release of the client repos first.

The manifest now reads FLIPCASH_PROTO_LOCAL. When it names a directory holding
ocp-client-protocol and flipcash2-client-protocol checkouts, both dependencies become
.package(path:); unset, the manifest resolves the same pinned versions as before. Product
references and the re-export are untouched, so import FlipcashAPI behaves identically either way.
Xcode inherits the environment of whatever launched it, so it has to be started from a shell that
exported the variable.

Nothing is edited to enter local mode, so there is nothing to commit by accident. It does drop the
two contract entries from the workspace Package.resolved while active. That is noise rather than a
version change, since the manifest pins are exact, but the file should be restored before
committing.

Checked with swift package dump-package in both states, and with swift build of FlipcashAPI
against local client checkouts carrying an uncommitted proto change: the added message reached
Ocp_Common_V1_LocalDevProbe in the generated Swift and the build succeeded.

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 and a tag for it, because
FlipcashAPI pins both contract packages exactly. Setting FLIPCASH_PROTO_LOCAL to
the directory holding the two client checkouts swaps the pinned dependencies for
path dependencies.

An environment variable rather than an edit to this file, for two reasons: the
switch has to survive worktrees, where a relative path to a sibling checkout
does not, and a manifest nobody edits is one nobody can commit in local mode.
CI never sets the variable, so release builds resolve the pins.

Verified with swift build against local ocp-client-protocol and
flipcash2-client-protocol checkouts, including a message added to a proto and
brought in with sync-protos.sh --local.
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.

1 participant