mirror of
https://github.com/hanzo-java/sdk.git
synced 2026-11-20 20:02:20 +00:00
Regenerated with the java row's packages moved up a level: `cloud` under ai.hanzo named nothing a caller needed. ApiClient, JSON and the rest of the invoker sit in ai.hanzo beside the hand-written Hanzo; the examples are ai.hanzo.examples. An import of ai.hanzo.cloud.* becomes ai.hanzo.*. The artifact keeps its coordinate, ai.hanzo:hanzo-java-cloud. Co-authored-by: Hanzo Dev <[email protected]>
#!/bin/sh
# README.md prints the coordinate a reader pastes, so the version it names has
# to be one this build publishes. It named 8.5.89, which Maven Central never
# served, while Central served 8.5.156.
#
# It names the RELEASE LINE, not the patch: every cloud release cuts a patch
# into build.gradle and nothing else, so a README pinned to a patch is stale
# from the next release on. Gradle's `X.Y.+` and Maven's `[X.Y,X.Y+1)` both
# resolve the newest patch of the line build.gradle is on.
set -eu
cd "$(dirname "$0")/.."
want=$(./scripts/version)
[ -n "$want" ] || { echo "no version in hanzo-java-cloud/build.gradle" >&2; exit 1; }
line=${want%.*}
major=${line%.*}; minor=${line#*.}
gradle="$line.+"
maven="[$line,$major.$((minor + 1)))"
named=$(grep -oE 'ai\.hanzo:hanzo-java-cloud:[0-9][0-9A-Za-z.+-]*' README.md | sed 's/.*://' | sort -u)
[ "$named" = "$gradle" ] || { echo "README.md names ai.hanzo:hanzo-java-cloud:$(echo $named); this build publishes the $gradle line" >&2; exit 1; }
versions=$(grep -oE '<version>[^<]+</version>' README.md | sed -E 's#</?version>##g' | sort -u)
[ "$versions" = "$maven" ] || { echo "README.md's Maven <version> is $(echo $versions); this build publishes $maven" >&2; exit 1; }
echo "README.md names $gradle and $maven, the line of $want"
# Every API class a README snippet names is one this build generates. The
# quickstart called KeysApi and ModelsApi, which neither this tree nor any
# published jar has had, so the first thing a reader pasted did not compile.
api=hanzo-java-cloud/src/main/java/ai/hanzo/api
missing=$(grep -oE '\b[A-Z][A-Za-z0-9]*Api\b' README.md | sort -u | while read -r class; do
[ -f "$api/$class.java" ] || printf ' %s' "$class"
done)
[ -z "$missing" ] || { echo "README.md names$missing; $api has no such class" >&2; exit 1; }
echo "README.md names only generated API classes"