diff --git a/.claude/commands/compile.md b/.claude/commands/compile.md index 873f3378..7d43eca6 100644 --- a/.claude/commands/compile.md +++ b/.claude/commands/compile.md @@ -101,7 +101,18 @@ Si el target no existe en CMake (porque la app no esta registrada en `cpp/CMakeL ### 4. Copiar a `/mnt/c/Users/lucas/Desktop/apps//` -Replica el flujo documentado en memoria (`feedback_no_adminlocal.md`): el `.exe` + las TTFs de fuentes que el shell ImGui necesita. NO usar `AdminLocal`. +Layout estandar (convencion `local_files/`, ver `cpp_apps.md` §7): + +``` +Desktop/apps// +├── .exe ← binario +├── *.ttf, *.dll ← fuentes + DLLs (junto al exe) +├── assets/ ← opcional, copiada del build +├── enrichers/ ← opcional, si /enrichers existe +├── runtime/ ← opcional, si app.md tiene python_runtime: true +└── local_files/ ← creado por la app al primer arranque + NUNCA borrar al recompilar +``` ```bash DEST="/mnt/c/Users/lucas/Desktop/apps/$APP_ARG" @@ -113,19 +124,38 @@ if [ ! -f "$EXE_SRC" ]; then exit 1 fi +# 1. Binario + TTFs + DLLs (junto al exe del build, copiados por add_imgui_app). cp -v "$EXE_SRC" "$DEST/" +find "$BUILD_WIN/apps/$APP_ARG" -maxdepth 1 -type f \ + \( -name '*.ttf' -o -name '*.dll' \) -exec cp -v {} "$DEST/" \; -# TTFs (estan junto al exe tras el build, copiados por add_imgui_app) -for ttf in "$BUILD_WIN/apps/$APP_ARG"/*.ttf; do - [ -f "$ttf" ] && cp -v "$ttf" "$DEST/" -done - -# Assets opcionales (carpeta assets/ junto al exe del build) +# 2. assets/ del build (opcional). if [ -d "$BUILD_WIN/apps/$APP_ARG/assets" ]; then rsync -a --delete "$BUILD_WIN/apps/$APP_ARG/assets/" "$DEST/assets/" fi +# 3. enrichers/ del app_dir (opcional). Excluye __pycache__ + .pyc. +if [ -d "$APP_DIR/enrichers" ]; then + rsync -a --delete --exclude '__pycache__' --exclude '*.pyc' \ + "$APP_DIR/enrichers/" "$DEST/enrichers/" +fi + +# 4. runtime/ Python embebido (si la app lo declara). +# Lee `python_runtime: true` del frontmatter de app.md. +if grep -q '^python_runtime:[[:space:]]*true' "$APP_DIR/app.md" 2>/dev/null; then + if [ ! -d "$APP_DIR/runtime/python" ] || \ + [ "$APP_DIR/app.md" -nt "$APP_DIR/runtime/.lock" ]; then + echo "[freeze] regenerando runtime Python (Windows) para $APP_ARG" + "$APP_DIR/tools/freeze_python_runtime.sh" "$APP_DIR" windows + fi + rsync -a --delete --exclude '__pycache__' --exclude '*.pyc' \ + "$APP_DIR/runtime/" "$DEST/runtime/" +fi + +# 5. NO TOCAR local_files/. Si existe en $DEST, preservar — contiene +# estado del usuario (DBs, settings, layouts ImGui, proyectos). echo "OK: $APP_ARG -> $DEST" +[ -d "$DEST/local_files" ] && echo " local_files/ preservado: $(du -sh "$DEST/local_files" | cut -f1)" ``` ### 5. Compilar Android (solo si TARGETS contiene `android`)