Build the macOS app in one shared directory for incremental builds
This commit is contained in:
+9
-2
@@ -1,11 +1,18 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
mac=$(cd "$(dirname "$0")" && pwd)
|
||||
root=$(dirname "$mac")
|
||||
shared=$HOME/Library/Caches/byre/build
|
||||
build=$mac/.build
|
||||
app=$build/byre.app
|
||||
svg=$mac/icon.svg
|
||||
icns=$build/byre.icns
|
||||
swift build --package-path "$mac" --configuration release
|
||||
mkdir -p "$shared" "$build"
|
||||
lockf -k "$shared.lock" sh -ec '
|
||||
rsync -rlc --delete --exclude /mac/.build "$1/mac" "$1/api" "$2/"
|
||||
swift build --package-path "$2/mac" --configuration release --no-color-diagnostics
|
||||
cp "$2/mac/.build/release/Byre" "$3"
|
||||
' sh "$root" "$shared" "$build/Byre"
|
||||
if [ ! "$icns" -nt "$svg" ]; then
|
||||
iconset=$build/byre.iconset
|
||||
rm -rf "$iconset"
|
||||
@@ -18,7 +25,7 @@ if [ ! "$icns" -nt "$svg" ]; then
|
||||
fi
|
||||
rm -rf "$app"
|
||||
mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources/fonts"
|
||||
cp "$build/release/Byre" "$app/Contents/MacOS/Byre"
|
||||
cp "$build/Byre" "$app/Contents/MacOS/Byre"
|
||||
cp "$mac/Info.plist" "$app/Contents/Info.plist"
|
||||
cp "$mac"/fonts/*.woff2 "$app/Contents/Resources/fonts/"
|
||||
cp "$icns" "$app/Contents/Resources/byre.icns"
|
||||
|
||||
Reference in New Issue
Block a user