Skip to content

feat(ant-dev): expand ant dev example to dispatch all 15 SDKs#84

Merged
Nic-dorman merged 1 commit into
mainfrom
fix/ant-dev-example-dispatcher
May 14, 2026
Merged

feat(ant-dev): expand ant dev example to dispatch all 15 SDKs#84
Nic-dorman merged 1 commit into
mainfrom
fix/ant-dev-example-dispatcher

Conversation

@Nic-dorman
Copy link
Copy Markdown
Collaborator

Closes #65.

ant dev example only knew how to run Python and C# — the other 13 SDKs each ship runnable examples in their own directories, but the dispatcher couldn't reach them. New contributors who wanted to verify e.g. their Go binding had to know the per-language invocation by hand.

Approach

cmd_example.py is now a small data-driven adapter table. Each language is a single Adapter(...) entry declaring:

  • sdk_dir / cwd_subdir — where to cd before running
  • examples — mapping of short names (connect, data, chunks, ...) to the language's identifier (filename, gradle arg, cargo example name, ...)
  • prep — optional list of build/install commands (gradle build, composer install, dart pub get, cmake, etc.)
  • run — callable returning the argv for a given example

cli.py's --language choices read straight from LANGUAGES.keys(), so adding a new SDK is a one-entry change with no second site to update.

Languages supported now

cpp, csharp, dart, elixir, go, java, js, kotlin, lua, php, python, ruby, rust, swift, zig

swift is configured but auto-skipped with a clear message, because its REST/gRPC SDK is macOS-only per the antd-swift README.

Test plan

Daemon up via ant dev start --ant-node-dir ~/Projects/ant-node (small preset), then:

  • ant dev example data -l python — round-trip OK
  • ant dev example data -l go — round-trip OK
  • ant dev example data -l rust — round-trip OK
  • ant dev example data -l swiftSkipping swift: REST/gRPC SDK is macOS-only per antd-swift README
  • ant dev example --help — all 15 languages listed in choices

End-to-end across the rest was already validated via the cross-SDK e2e harness in this repo's sandbox (the same one that surfaced #66#71, #78).

Notes for reviewers

  • A handful of languages still need their own one-PR fix before their per-language data example will actually green up (#79/#82 for zig). The dispatcher itself doesn't gate on those — it just shells out and lets the underlying tool exit non-zero if the example is broken.
  • The examples maps don't need to be complete for every short name — they declare what's available per SDK (e.g. antd-go/examples/ only has 01-connect, 02-data, 03-files, so the Go adapter declares only those).
  • If a language wants something genuinely complex (custom preflight, environment variables, conditional flags), prefer adding a small helper script in the SDK directory rather than extending this dispatcher.

ant dev example only supported python and csharp. The other 13 SDKs all
ship runnable examples in their own directories but were unreachable
through the dispatcher (see #65).

Rewrite cmd_example.py as a data-driven adapter table. Each language is
one entry declaring its examples map, an optional prep step list, and a
run-argv builder. Adding the next SDK is a single entry.

Languages now supported:
  cpp, csharp, dart, elixir, go, java, js, kotlin, lua, php, python,
  ruby, rust, swift, zig

swift is configured but auto-skipped with a clear reason because its
REST/gRPC SDK is macOS-only per the antd-swift README.

cli.py reads choices straight from the LANGUAGES table so help/argparse
stay in sync automatically when a new SDK is added.

Closes #65
@Nic-dorman Nic-dorman force-pushed the fix/ant-dev-example-dispatcher branch from 2af7d93 to e31c773 Compare May 14, 2026 11:06
@Nic-dorman Nic-dorman merged commit f68168b into main May 14, 2026
@Nic-dorman Nic-dorman deleted the fix/ant-dev-example-dispatcher branch May 14, 2026 11:06
Nic-dorman added a commit that referenced this pull request May 14, 2026
Cuts v0.7.1 atop v0.7.0. Primarily refreshes the upstream `ant-core`
pin to the `ant-cli-v0.2.3` release tag (no API change for antd
consumers). Bundles a substantial round of cross-SDK example/build
fixes, dispatcher improvements, and CI/release workflow hardening.

## antd

- chore(antd): bump ant-core to v0.2.3 (#85)

## SDK example/build fixes

- fix(antd-php): use cost-estimate fields in example 02 (#74)
- fix(antd-elixir): print cost-estimate fields in examples (#75)
- fix(antd-lua): add missing discover module to rockspec (#76)
- fix(antd-kotlin): make put-response cost optional + ship gradle wrapper (#77)
- fix(antd-zig): pass payment_mode to dataPutPublic/dataPutPrivate (#79)
- fix(antd-java): make examples runnable via gradle :examples subproject (#80)
- fix(antd-zig): align stdlib API to declared 0.14.x minimum (#82)
- fix(antd-swift): port to Linux + populate cost-estimate fields (#87)

## ant-dev (developer CLI)

- fix(ant-dev): clean up orphan anvil/antnode and stale node identities on stop (#81)
- fix(ant-dev): tooling cluster — flag alias, sys.executable, anvil preflight, README (#83)
- feat(ant-dev): expand `ant dev example` to dispatch all 15 SDKs (#84)
- fix(ant-dev): dispatcher swift no-skip + lua LUA_PATH wrap (#86)
- feat(ant-dev): expose --preset flag on `ant dev start` (default: small) (#88)

## CI / release

- ci: authenticate arduino/setup-protoc on ci.yml too (#60)
- feat(release): publish antd-linux-arm64 artifact (#89)

## Validation

15/15 SDKs round-tripped end-to-end against a daemon built from this
commit on a Linux dev box (Ubuntu 24.04, 0.7.1 atop ant-core v0.2.3).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

ant dev example dispatcher supports only python+csharp; 13 other SDKs have examples but are unreachable

1 participant