Merged
feat(intelliRouter): 添加 whl 打包脚本并注册到 build-sdk.sh #381
yutaoJustinBieber1223Add on 17 days ago
feat(intelliRouter): 添加 whl 打包脚本并注册到 build-sdk.sh #381
Merged
Total: 3 files changed+30-1
| @@ -0,0 +1,26 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# Build the intelli_router wheel. Invoked by scripts/build-sdk.sh. | ||
| 3 | +# Usage: bash build.sh [extra build args, e.g. --sdist] | ||
| 4 | +set -euo pipefail | ||
| 5 | + | ||
| 6 | +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" | ||
| 7 | +PROJECT_DIR="$(cd -- "${SCRIPT_DIR}/.." && pwd)" | ||
| 8 | +cd -- "${PROJECT_DIR}" | ||
| 9 | + | ||
| 10 | +log() { | ||
| 11 | + printf '[%s] %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$*" | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +if command -v uv >/dev/null 2>&1; then | ||
| 15 | + log "[BUILD] intelli_router: uv build --wheel $*" | ||
| 16 | + uv build --wheel "$@" | ||
| 17 | +else | ||
| 18 | + log "[BUILD] intelli_router: python3 -m build --wheel (uv not found)" | ||
| 19 | + if ! python3 -m build --wheel "$@"; then | ||
| 20 | + log "[ERROR] intelli_router: build failed. Install uv, or run: python3 -m pip install build" | ||
| 21 | + exit 1 | ||
| 22 | + fi | ||
| 23 | +fi | ||
| 24 | + | ||
| 25 | +log "[OK] intelli_router: artifacts in ${PROJECT_DIR}/dist:" | ||
| 26 | +ls -1 "${PROJECT_DIR}/dist" | ||
| @@ -4,7 +4,7 @@ set -euo pipefail | |||
| 4 | 4 | ||
| 5 | usage() { | 5 | usage() { |
| 6 | echo "Usage: bash scripts/build-sdk.sh <project> [project options...]" | 6 | echo "Usage: bash scripts/build-sdk.sh <project> [project options...]" |
| 7 | - echo "Projects: A4P-java-sdk, A4P-arkts-sdk, MCP/cpp-sdk, A2A/cpp-sdk" | 7 | + echo "Projects: A4P-java-sdk, A4P-arkts-sdk, MCP/cpp-sdk, A2A/cpp-sdk, intelli_router" |
| 8 | echo "ArkTS requires separately supplied SDK sources and scripts/build.sh." | 8 | echo "ArkTS requires separately supplied SDK sources and scripts/build.sh." |
| 9 | } | 9 | } |
| 10 | 10 | ||
| @@ -15,6 +15,7 @@ case "${1:-}" in | |||
| 15 | A4P-arkts-sdk) build_file="scripts/build.sh" ;; | 15 | A4P-arkts-sdk) build_file="scripts/build.sh" ;; |
| 16 | MCP/cpp-sdk) build_file="scripts/build.sh" ;; | 16 | MCP/cpp-sdk) build_file="scripts/build.sh" ;; |
| 17 | A2A/cpp-sdk) build_file="scripts/build.sh" ;; | 17 | A2A/cpp-sdk) build_file="scripts/build.sh" ;; |
| 18 | + intelli_router) build_file="scripts/build.sh" ;; | ||
| 18 | *) echo "Error: unknown build project '$1'." >&2; usage >&2; exit 2 ;; | 19 | *) echo "Error: unknown build project '$1'." >&2; usage >&2; exit 2 ;; |
| 19 | esac | 20 | esac |
| 20 | project="$1" | 21 | project="$1" |