-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (39 loc) · 1.64 KB
/
Makefile
File metadata and controls
48 lines (39 loc) · 1.64 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
41
42
43
44
45
46
47
48
# Use Xcode toolchain (not Command Line Tools) for XCTest support
DEVELOPER_DIR := /Applications/Xcode.app/Contents/Developer
export DEVELOPER_DIR
CERT_NAME := TypoFixrDev
APP_BUNDLE := $(HOME)/Applications/TypoFixr.app
APP_BINARY := $(APP_BUNDLE)/Contents/MacOS/TypoFixr
APP_DOMAIN := com.typofixr.app
XCODE_DERIVED_DATA := .build/xcode
XCODE_RELEASE_APP := $(XCODE_DERIVED_DATA)/Build/Products/Release/TypoFixr.app
.PHONY: build release test deploy preflight-dmg xcode-build xcode-test
build:
swift build -c debug
release:
swift build -c release
test:
swift test --enable-xctest
deploy:
@echo "==> Resetting onboarding..."
defaults write $(APP_DOMAIN) hasCompletedOnboarding -bool false
defaults delete $(APP_DOMAIN) keyboardShortcut 2>/dev/null || true
@echo "==> Stopping running instance..."
pkill -f TypoFixr || true
sleep 0.5
@echo "==> Building app bundle..."
$(DEVELOPER_DIR)/usr/bin/xcodebuild -project TypoFixr.xcodeproj -scheme TypoFixr -configuration Release -derivedDataPath "$(XCODE_DERIVED_DATA)" CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO build
@echo "==> Installing app bundle..."
mkdir -p $$(dirname "$(APP_BUNDLE)")
ditto "$(XCODE_RELEASE_APP)" "$(APP_BUNDLE)"
@echo "==> Signing with $(CERT_NAME)..."
codesign --force --deep --sign "$(CERT_NAME)" "$(APP_BUNDLE)"
@echo "==> Launching..."
open "$(APP_BUNDLE)"
@echo "Done. Accessibility permissions should persist across deploys."
preflight-dmg:
./scripts/preflight_release_dmg.sh
xcode-build:
xcodebuild -project TypoFixr.xcodeproj -scheme TypoFixr -configuration Debug build
xcode-test:
xcodebuild -project TypoFixr.xcodeproj -scheme TypoFixr -configuration Debug test