From db8547b4c39232baa34129b30db8d1d1ddeeee9e Mon Sep 17 00:00:00 2001 From: SantaSpeen Date: Sun, 22 Nov 2026 00:44:30 +0300 Subject: [PATCH] Initialize native macOS app scaffold --- .gitignore | 5 +++++ Package.swift | 9 +++++++++ Packaging/Info.plist | 22 ++++++++++++++++++++++ README.md | 20 ++++++++++++++++++++ Sources/EzDent/EzDentApp.swift | 12 ++++++++++++ scripts/build-app.sh | 31 +++++++++++++++++++++++++++++++ 6 files changed, 99 insertions(+) create mode 100644 .gitignore create mode 100644 Package.swift create mode 100644 Packaging/Info.plist create mode 100644 README.md create mode 100644 Sources/EzDent/EzDentApp.swift create mode 100755 scripts/build-app.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2fab09b --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/_source/ +/.build/ +/.swiftpm/ +/dist/ +.DS_Store diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..7c62d67 --- /dev/null +++ b/Package.swift @@ -0,0 +1,9 @@ +// swift-tools-version: 5.9 +import PackageDescription + +let package = Package( + name: "EzDent", + platforms: [.macOS(.v13)], + products: [.executable(name: "EzDent", targets: ["EzDent"])], + targets: [.executableTarget(name: "EzDent")] +) diff --git a/Packaging/Info.plist b/Packaging/Info.plist new file mode 100644 index 0000000..0788ee4 --- /dev/null +++ b/Packaging/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleExecutable + EzDent + CFBundleIdentifier + ru.anidev.ezdent + CFBundleName + EzDent + CFBundlePackageType + APPL + CFBundleShortVersionString + 0.1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + 13.0 + NSHighResolutionCapable + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..312e31e --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# EzDent для macOS + +Каркас нативного приложения на SwiftUI для macOS 13 и новее. Универсальный пакет содержит исполняемый код для Intel (`x86_64`) и Apple Silicon (`arm64`). + +## Разработка + +Нужны Xcode или Xcode Command Line Tools с Swift 5.9 или новее и SDK macOS. Откройте `Package.swift` в Xcode или запустите приложение из терминала. + +```sh +swift run EzDent +``` + +## Универсальная сборка + +```sh +./scripts/build-app.sh +open dist/EzDent.app +``` + +Скрипт собирает обе архитектуры, объединяет их через `lipo` и ставит локальную подпись ad hoc. Для распространения за пределами Mac App Store подготовьте подпись Developer ID и нотарификацию. diff --git a/Sources/EzDent/EzDentApp.swift b/Sources/EzDent/EzDentApp.swift new file mode 100644 index 0000000..9a066d5 --- /dev/null +++ b/Sources/EzDent/EzDentApp.swift @@ -0,0 +1,12 @@ +import SwiftUI + +@main +struct EzDentApp: App { + var body: some Scene { + WindowGroup { + Text("EzDent") + .font(.largeTitle) + .frame(minWidth: 480, minHeight: 320) + } + } +} diff --git a/scripts/build-app.sh b/scripts/build-app.sh new file mode 100755 index 0000000..6ce2f3c --- /dev/null +++ b/scripts/build-app.sh @@ -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"