-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (49 loc) · 2.12 KB
/
Makefile
File metadata and controls
58 lines (49 loc) · 2.12 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
49
50
51
52
53
54
55
56
57
58
.PHONY: gen build run clean notarize release help
# ── Variables ────────────────────────────────────────────────────────────────
SCHEME := TabRecordApp
PROJECT := TabRecordApp.xcodeproj
BUILD := .build
APP := $(BUILD)/Build/Products/Release/TabRecord.app
# ── Targets ──────────────────────────────────────────────────────────────────
help: ## Show available targets
@grep -E '^[a-zA-Z_-]+:.*##' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*##"}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
gen: ## Generate Xcode project from project.yml (requires: brew install xcodegen)
xcodegen generate
build: gen ## Build release app bundle
xcodebuild \
-project $(PROJECT) \
-scheme $(SCHEME) \
-configuration Release \
-derivedDataPath $(BUILD) \
-quiet
run: gen ## Build debug and launch immediately
xcodebuild \
-project $(PROJECT) \
-scheme $(SCHEME) \
-configuration Debug \
-derivedDataPath $(BUILD) \
-quiet
open $(BUILD)/Build/Products/Debug/TabRecord.app
release: ## Bump version and release (PART=major|minor|patch, default: patch)
./scripts/bump.sh $(or $(PART),patch)
clean: ## Remove derived data
rm -rf $(BUILD)
# Notarization — fill in APPLE_ID, TEAM_ID, APP_PASSWORD before using.
notarize: build ## Sign, notarize, and staple the release app
@echo "Codesigning…"
codesign --deep --force --options runtime \
--entitlements TabRecordApp/TabRecord.entitlements \
--sign "Developer ID Application: YOUR_NAME (TEAM_ID)" \
$(APP)
@echo "Creating zip for notarytool…"
ditto -c -k --keepParent $(APP) $(BUILD)/TabRecord.zip
@echo "Submitting for notarization…"
xcrun notarytool submit $(BUILD)/TabRecord.zip \
--apple-id "$(APPLE_ID)" \
--team-id "$(TEAM_ID)" \
--password "$(APP_PASSWORD)" \
--wait
@echo "Stapling ticket…"
xcrun stapler staple $(APP)
@echo "Done — $(APP) is notarized and ready for distribution."