Improved progress display

Previously, the progress bar updated only after completing an entire table.

For large tables such as LIBARC, this could make the application appear to have stopped responding.

Phase 10 updates the interface while rows are being exported.
This commit is contained in:
Mark Gregory
2026-10-18 14:27:16 +01:00
parent 33ec9f7f14
commit 312efaa771
19 changed files with 346 additions and 226 deletions
+16 -58
View File
@@ -1,59 +1,17 @@
#!/bin/zsh
#!/bin/bash
set -euo pipefail
PROJECT_DIR="${PROJECT_DIR:-/Volumes/Developer/Applications/WorkbenchReplacement}"
PHASE="${1:-57}"
LABEL="${2:-Development}"
RELEASE_DIR="${RELEASE_DIR:-$PROJECT_DIR/releases}"
SCHEME="WorkbenchReplacement"
if [[ ! "$PHASE" =~ '^[0-9]+$' ]]; then
echo 'Usage: ./release-workbench.sh PHASE [Release-Label]' >&2
exit 2
fi
if [[ ! -f "$PROJECT_DIR/WorkbenchReplacement.xcodeproj/project.pbxproj" ]]; then
echo "Xcode project not found: $PROJECT_DIR" >&2
exit 1
fi
if [[ ! -d "$PROJECT_DIR/docs" ]]; then
echo 'docs/ directory is required.' >&2
exit 1
fi
mkdir -p "$RELEASE_DIR"
SAFE_LABEL=$(printf '%s' "$LABEL" | tr -cs 'A-Za-z0-9._-' '-')
NAME="WorkbenchReplacement-Phase${PHASE}-${SAFE_LABEL}"
DERIVED="$PROJECT_DIR/build"
APP="$DERIVED/Build/Products/Release/${SCHEME}.app"
echo "Building ${NAME}..."
xcodebuild \
-project "$PROJECT_DIR/WorkbenchReplacement.xcodeproj" \
-scheme "$SCHEME" \
-configuration Release \
-destination 'platform=macOS,arch=arm64' \
-derivedDataPath "$DERIVED" \
CODE_SIGNING_ALLOWED=NO \
clean build
if [[ ! -d "$APP" ]]; then
echo "Build succeeded but app was not found: $APP" >&2
exit 1
fi
# Source release excludes local build artifacts, git internals, and prior releases.
SOURCE_ZIP="$RELEASE_DIR/${NAME}-Source.zip"
(
cd "$PROJECT_DIR"
/usr/bin/zip -qry "$SOURCE_ZIP" \
WorkbenchReplacement WorkbenchReplacement.xcodeproj docs \
-x '*.DS_Store' '*/.build/*' '*/DerivedData/*'
)
APP_ZIP="$RELEASE_DIR/${NAME}-App-Unsigned.zip"
(
cd "${APP:h}"
/usr/bin/ditto -c -k --sequesterRsrc --keepParent "$APP:t" "$APP_ZIP"
)
/usr/bin/unzip -tq "$SOURCE_ZIP" >/dev/null
/usr/bin/unzip -tq "$APP_ZIP" >/dev/null
printf '\nRelease completed:\n%s\n%s\n' "$SOURCE_ZIP" "$APP_ZIP"
printf 'Note: App ZIP is unsigned and not notarized; intended for local testing.\n'
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
PHASE="${1:?Usage: release-workbench.sh PHASE NAME}"
NAME="${2:?Usage: release-workbench.sh PHASE NAME}"
cd "$ROOT"
mkdir -p releases
xcodebuild -project WorkbenchReplacement.xcodeproj -scheme WorkbenchReplacement -configuration Release -destination 'platform=macOS' -derivedDataPath "$ROOT/build" clean build
APP="$ROOT/build/Build/Products/Release/WorkbenchReplacement.app"
test -d "$APP"
SOURCE="WorkbenchReplacement-Phase${PHASE}-${NAME}-Source.zip"
BINARY="WorkbenchReplacement-Phase${PHASE}-${NAME}-App-Unsigned.zip"
/usr/bin/zip -qr "releases/$SOURCE" WorkbenchReplacement WorkbenchReplacement.xcodeproj docs scripts -x '*.DS_Store'
(cd "$ROOT/build/Build/Products/Release" && /usr/bin/zip -qr "$ROOT/releases/$BINARY" WorkbenchReplacement.app)
/usr/bin/unzip -tq "releases/$SOURCE" >/dev/null
/usr/bin/unzip -tq "releases/$BINARY" >/dev/null
printf 'Created:\n %s\n %s\n' "releases/$SOURCE" "releases/$BINARY"