fix(ci): Windows 构建清除 cp 复制的插件软链,避免 PathExists(errno 183)
cp -r 把 windows/flutter/ephemeral/.plugin_symlinks 复制成真实目录, flutter createPluginSymlinks 只清软链、清不掉真目录,重建时撞车。 复制后删除 ephemeral/.dart_tool/build,由 flutter 干净重建。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,14 @@ rm -rf "$BUILD_ROOT"
|
||||
mkdir -p "$BUILD_ROOT"
|
||||
cp -r client "$BUILD_CLIENT"
|
||||
|
||||
# `cp -r` turns Flutter's plugin symlinks (windows/flutter/ephemeral/.plugin_symlinks/*)
|
||||
# into real directories. flutter's createPluginSymlinks only cleans up *symlinks*, so it
|
||||
# then fails to create a symlink over the copied real dir (errno 183 / PathExists).
|
||||
# Drop all regenerable artifacts so the build below recreates them cleanly.
|
||||
rm -rf "${BUILD_CLIENT}/windows/flutter/ephemeral" \
|
||||
"${BUILD_CLIENT}/.dart_tool" \
|
||||
"${BUILD_CLIENT}/build"
|
||||
|
||||
# Build (run from the clean path; pushd/popd avoids needing $() to save cwd)
|
||||
pushd "$BUILD_CLIENT" > /dev/null
|
||||
flutter create --platforms=windows . --project-name jiu_client
|
||||
|
||||
Reference in New Issue
Block a user