网络 SDK 包含中间生成代码,更新脚本,升级版本号,隔离 pre-commit 脚本范围
This commit is contained in:
30
packages/networks_sdk/scripts/gen.sh
Executable file
30
packages/networks_sdk/scripts/gen.sh
Executable 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."
|
||||
Reference in New Issue
Block a user