#!/usr/bin/env bash # Records the public API of the current version: # $API_DIR/.txt readable, diffable list (cargo public-api) # $API_DIR/.json.gz compressed rustdoc JSON, reference of cargo-semver-checks # $API_DIR/.stamp rustc and cargo-public-api used (api-level regenerates if they change) set -euo pipefail . "$(dirname "$0")/common.sh" if [ "${API_TRACKED:-yes}" = no ]; then info " (kind ${CRATE_KIND:-crate}: no Rust API to record)" exit 0 fi require_cargo_tool public-api cargo-public-api version=$(current_version) name=$(crate_name) warn "→ Public API snapshot of $name $version..." emit_snapshot "$version" "$API_DIR" ok "✓ $API_DIR/$version.txt and $API_DIR/$version.json.gz written"