网络 SDK 包含中间生成代码,更新脚本,升级版本号,隔离 pre-commit 脚本范围

This commit is contained in:
Cody
2026-03-10 19:22:58 +08:00
parent 890e102543
commit db8d269944
7 changed files with 1294 additions and 226 deletions

View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Code generation for networks_sdk — clean lock/cache, resolve deps, run build_runner
#
# Usage:
# bash scripts/gen.sh
#
# Generated files (*.freezed.dart, *.g.dart) are committed to git so that
# git-tag consumers can build without running build_runner themselves.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SDK_DIR="$(dirname "$SCRIPT_DIR")"
cd "$SDK_DIR"
# ── Clean stale lock and tool cache ────────────────────────────────────────
echo "==> Removing pubspec.lock and .dart_tool..."
rm -rf pubspec.lock .dart_tool
# ── Resolve dependencies ────────────────────────────────────────────────────
echo "==> Running flutter pub get..."
flutter pub get
# ── Run build_runner ────────────────────────────────────────────────────────
echo "==> Running build_runner build..."
dart run build_runner build --delete-conflicting-outputs
echo ""
echo "networks_sdk code generation complete."