Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,22 @@ build:

# 使用 SPM 构建 Release 版本
@echo "📦 使用 Swift Package Manager 编译..."
@swift build -c release
# @swift build -c release
@echo "📦 编译 arm64..."
@swift build -c release --arch arm64
@echo "📦 编译 x86_64..."
@swift build -c release --arch x86_64
@echo "✅ Swift 编译完成"
@echo ""

@echo "🔗 合并 universal binary..."
@lipo -create \
.build/arm64-apple-macosx/release/go2shell \
.build/x86_64-apple-macosx/release/go2shell \
-output .build/release/go2shell
@echo "✅ universal binary 已生成"
@echo ""

# 创建 App Bundle
@echo "📁 创建 App Bundle 结构..."
@$(MAKE) --no-print-directory create-bundle
Expand Down Expand Up @@ -69,7 +81,7 @@ create-bundle:
@cp $(RELEASE_DIR)/go2shell $(APP_BUNDLE)/Contents/MacOS/

# 复制 SPM resource bundle(本地化资源等)
@for bundle in $(BUILD_DIR)/arm64-apple-macosx/release/*.bundle; do \
@for bundle in $(BUILD_DIR)/release/*.bundle; do \
if [ -d "$$bundle" ]; then \
cp -r "$$bundle" $(APP_BUNDLE)/Contents/Resources/; \
fi; \
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 6.3
// swift-tools-version: 6.0
import PackageDescription

let package = Package(
Expand Down