-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (33 loc) · 1.03 KB
/
Makefile
File metadata and controls
40 lines (33 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.PHONY: build app run clean dev test dist
# Development build and run (debug, faster compilation)
dev:
swift build
swift run
# Release build
build:
swift build -c release
# Run tests
test:
swift test
# Create .app bundle
app: build
@mkdir -p build/Command.app/Contents/MacOS
@mkdir -p build/Command.app/Contents/Resources
@cp .build/release/Command build/Command.app/Contents/MacOS/
@cp Info.plist build/Command.app/Contents/
@cp Resources/AppIcon.icns build/Command.app/Contents/Resources/ 2>/dev/null || true
@codesign --force --deep --sign - build/Command.app
@echo "Built build/Command.app"
# Create distributable zip
dist: app
@xattr -cr build/Command.app
@cd build && ditto -c -k --keepParent Command.app Command.zip
@echo "Created build/Command.zip ($(du -h build/Command.zip | cut -f1))"
# Build and launch .app (kills existing instance first)
run: app
@pkill -f 'Command.app/Contents/MacOS/Command' 2>/dev/null; sleep 0.5; true
open build/Command.app
# Clean all build artifacts
clean:
swift package clean
rm -rf build