Merge pull request 'Update the mason clean architecture bricks to the setup.sh' (#3) from josh/dev/melos/script/mason_add_bricks into dev

Reviewed-on: https://gitea.winwayinfo.com/CUS-IM/customer-im-client/pulls/3
This commit is contained in:
wangfeng
2026-03-06 18:53:47 +08:00

View File

@@ -28,13 +28,13 @@ echo "=== customer-im-client 环境初始化 ==="
echo ""
# ---- Step 1: 安装全局工具 ----
echo "[1/6] 安装全局工具 (melos + mason_cli)..."
echo "[1/7] 安装全局工具 (melos + mason_cli)..."
dart pub global activate melos
dart pub global activate mason_cli
echo ""
# ---- Step 2: 配置 PATH ----
echo "[2/6] 配置 PATH..."
echo "[2/7] 配置 PATH..."
if [[ "$SHELL" == */zsh ]]; then
SHELL_CONFIG="$HOME/.zshrc"
elif [[ "$SHELL" == */bash ]]; then
@@ -78,12 +78,19 @@ if [ -f "$ROOT_DIR/mason-lock.json" ]; then
fi
# ---- Step 5: 注册 mason bricks ----
echo "[5/6] mason get (注册本地 bricks)..."
echo "[5/7] mason get (注册本地 bricks)..."
cd "$ROOT_DIR" && "$PUB_CACHE_BIN/mason" get
echo ""
echo "[6/7] mason add clean_plugin_sdk bricks..."
if ! grep -qE '^\s*clean_plugin_sdk:' "$ROOT_DIR/mason.yaml" 2>/dev/null; then
cd "$ROOT_DIR" && "$PUB_CACHE_BIN/mason" add clean_plugin_sdk --path ./mason/bricks/clean_plugin_sdk
else
echo " clean_plugin_sdk 已在 mason.yaml 中,跳過"
fi
# ---- Step 6: 首次代码生成 ----
echo "[6/6] melos run gen (首次代码生成)..."
echo "[7/7] melos run gen (首次代码生成)..."
cd "$ROOT_DIR" && "$PUB_CACHE_BIN/melos" run gen
echo ""