Initialize native macOS app scaffold

This commit is contained in:
SantaSpeen committed 2026-11-22 00:47:11 +03:00
commit db8547b4c3
6 files changed
+99

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.."
build_for_arch() {
local arch="$1"
local scratch_path=".build/$arch"
swift build -c release --arch "$arch" --scratch-path "$scratch_path" >&2 || return
swift build -c release --arch "$arch" --scratch-path "$scratch_path" --show-bin-path
}
arm64_bin="$(build_for_arch arm64)"
x86_64_bin="$(build_for_arch x86_64)"
mkdir -p dist
stage="$(mktemp -d dist/.EzDent.XXXXXX)"
trap 'rm -rf "$stage"' EXIT
app="$stage/EzDent.app"
executable="$app/Contents/MacOS/EzDent"
mkdir -p "$app/Contents/MacOS"
cp Packaging/Info.plist "$app/Contents/Info.plist"
xcrun lipo -create "$arm64_bin/EzDent" "$x86_64_bin/EzDent" -output "$executable"
xcrun lipo "$executable" -verify_arch arm64 x86_64
codesign --force --sign - "$app"
codesign --verify --strict "$app"
rm -rf dist/EzDent.app
mv "$app" dist/EzDent.app
printf '%s\n' "$PWD/dist/EzDent.app"