feat(ant-dev): expand ant dev example to dispatch all 15 SDKs#84
Open
Nic-dorman wants to merge 1 commit into
Open
feat(ant-dev): expand ant dev example to dispatch all 15 SDKs#84Nic-dorman wants to merge 1 commit into
ant dev example to dispatch all 15 SDKs#84Nic-dorman wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #65.
ant dev exampleonly 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.pyis now a small data-driven adapter table. Each language is a singleAdapter(...)entry declaring:sdk_dir/cwd_subdir— where tocdbefore runningexamples— 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 examplecli.py's--languagechoices read straight fromLANGUAGES.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, zigswiftis configured but auto-skipped with a clear message, because its REST/gRPC SDK is macOS-only per theantd-swiftREADME.Test plan
Daemon up via
ant dev start --ant-node-dir ~/Projects/ant-node(smallpreset), then:ant dev example data -l python— round-trip OKant dev example data -l go— round-trip OKant dev example data -l rust— round-trip OKant dev example data -l swift—Skipping swift: REST/gRPC SDK is macOS-only per antd-swift READMEant dev example --help— all 15 languages listed inchoicesEnd-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
dataexample will actually green up (#79/#82for 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.examplesmaps don't need to be complete for every short name — they declare what's available per SDK (e.g.antd-go/examples/only has01-connect,02-data,03-files, so the Go adapter declares only those).