fix(deploy): ENOTEMPTY-Halbwipe von android/ verhindern
clean-ios.sh rief 'expo prebuild --clean' ohne --platform → wollte auch android/ löschen. Hält ein Gradle-Daemon android/build|.gradle offen, failt 'rmdir android' mit ENOTEMPTY und hinterlässt ein halb-gewischtes android/ (Source weg, gelocktes build/ bleibt) → späterer Release-Build failt mit "autolinking.json doesn't exist". - clean-ios.sh: 'prebuild --clean --platform ios' → android/ wird beim iOS-Clean gar nicht mehr angefasst. - deploy.sh: release_android_locks() (gradlew --stop + GradleDaemon-kill + rm build/.gradle) läuft vor dem android-prebuild --clean in ensure_native_dir. Ergänzt den ensure_native_dir-Self-Healing-Fix (fe6a63b): jetzt wird der Halbwipe nicht nur erkannt+repariert, sondern an der Quelle verhindert. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
fe6a63bd8d
commit
579eb5b5e0
@ -64,8 +64,12 @@ if [ "$SKIP_PODS" = "1" ]; then
|
||||
else
|
||||
# 3. Prebuild: regeneriert ios/ aus app.config.ts + Config-Plugins
|
||||
# Dank with-fmt-consteval-fix-Plugin wird das Podfile auto-gepatcht.
|
||||
echo "→ pnpm expo prebuild --clean"
|
||||
pnpm expo prebuild --clean
|
||||
# ⚠️ --platform ios: NUR ios/ regenerieren, android/ NICHT anfassen. Ein
|
||||
# 'prebuild --clean' ohne --platform will auch android/ löschen; hält ein
|
||||
# Gradle-Daemon dort build/.gradle offen, failt das rmdir mit ENOTEMPTY und
|
||||
# hinterlässt ein halb-gewischtes android/ (Source weg, gelocktes build/ bleibt).
|
||||
echo "→ pnpm expo prebuild --clean --platform ios"
|
||||
pnpm expo prebuild --clean --platform ios
|
||||
|
||||
# 4. Pod install
|
||||
echo "→ cd ios && pod install"
|
||||
|
||||
@ -389,6 +389,18 @@ ASC_API_KEY_PATH="${ASC_API_KEY_PATH:-}"
|
||||
ASC_API_KEY_ID="${ASC_API_KEY_ID:-}"
|
||||
ASC_API_KEY_ISSUER="${ASC_API_KEY_ISSUER:-}"
|
||||
|
||||
# Stoppt laufende Gradle-Daemons + entfernt android-Build-Output, BEVOR ein
|
||||
# 'expo prebuild --clean' android/ löschen will. Ein Daemon (von Builds, lebt ~3h)
|
||||
# hält sonst android/build|.gradle offen → 'rmdir android' failt mit ENOTEMPTY →
|
||||
# android/ wird nur halb gewischt (Source weg, gelocktes build/ bleibt). Idempotent.
|
||||
release_android_locks() {
|
||||
if [[ -x "$ANDROID_DIR/gradlew" ]]; then
|
||||
( cd "$ANDROID_DIR" && ./gradlew --stop >/dev/null 2>&1 ) || true
|
||||
fi
|
||||
pkill -f "GradleDaemon" 2>/dev/null || true
|
||||
rm -rf "$ANDROID_DIR/build" "$ANDROID_DIR/.gradle" "$ANDROID_DIR/app/build" 2>/dev/null || true
|
||||
}
|
||||
|
||||
# Stellt sicher dass ios/ oder android/ ein VOLLSTÄNDIGES Prebuild ist — sonst
|
||||
# Auto-(Re)Prebuild (fehlt komplett → prebuild; halb-gewischt → prebuild --clean).
|
||||
# Usage: ensure_native_dir ios | ensure_native_dir android
|
||||
@ -414,6 +426,9 @@ ensure_native_dir() {
|
||||
|
||||
if [[ -d "$target_dir" && ! -f "$marker" ]]; then
|
||||
warn "$platform/ ist unvollständig (Marker $(basename "$marker") fehlt) — regeneriere via prebuild --clean"
|
||||
# Vor dem android-Clean Gradle-Daemons stoppen + Build-Output entfernen, sonst
|
||||
# kann 'prebuild --clean' am gelockten android/build mit ENOTEMPTY scheitern.
|
||||
[[ "$platform" == "android" ]] && release_android_locks
|
||||
# --clean wischt + regeneriert NUR $platform/ (die andere Plattform bleibt
|
||||
# unangetastet) und räumt den kaputten Halb-Zustand sauber auf.
|
||||
run_quiet "expo prebuild --clean ($platform)" "$LOG_DIR/prebuild-$platform-$TIMESTAMP.log" \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user