-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (53 loc) · 1.81 KB
/
Copy pathMakefile
File metadata and controls
71 lines (53 loc) · 1.81 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
59
60
61
62
63
64
65
66
67
68
69
70
71
VERSION = 1.1
APP = TZBar.app
DMG = TZBar-$(VERSION).dmg
APP_RESOURCES = $(APP)/Contents/Info.plist $(APP)/Contents/Resources/AppIcon.icns
build: $(APP_RESOURCES)
swift build
mkdir -p $(APP)/Contents/MacOS
cp .build/debug/TZBar $(APP)/Contents/MacOS/TZBar
run: build
$(APP)/Contents/MacOS/TZBar
format:
swiftformat Sources
format-check:
swiftformat --lint Sources
lint:
swiftlint lint Sources
build-release: $(APP_RESOURCES)
swift build -c release --arch arm64 --arch x86_64
mkdir -p $(APP)/Contents/MacOS
cp .build/apple/Products/Release/TZBar $(APP)/Contents/MacOS/TZBar
$(APP)/Contents/Info.plist: packaging/Info.plist
mkdir -p $(@D)
cp $< $@
packaging/AppIcon.icns: packaging/AppIcon.png
pnpm icns-generator -i $< -O .icons
cp .icons/icon.icns $@
$(APP)/Contents/Resources/AppIcon.icns: packaging/AppIcon.icns
mkdir -p $(@D)
cp $< $@
build-signed: build-release
codesign --force --timestamp --options runtime \
--entitlements packaging/entitlements.plist \
--sign "$(APPLE_CODESIGN_IDENTITY)" $(APP)/Contents/MacOS/TZBar
codesign --force --timestamp --options runtime \
--entitlements packaging/entitlements.plist \
--sign "$(APPLE_CODESIGN_IDENTITY)" $(APP)
dmg: build-release
rm -f $(DMG)
pnpm appdmg packaging/dmg.json $(DMG)
dmg-signed: build-signed
rm -f $(DMG)
pnpm appdmg packaging/dmg.json $(DMG)
codesign --force --timestamp --sign "$(APPLE_CODESIGN_IDENTITY)" $(DMG)
release: dmg-signed
xcrun notarytool submit $(DMG) --wait \
--key "$(APPLE_API_KEY_PATH)" --key-id "$(APPLE_API_KEY)" --issuer "$(APPLE_API_ISSUER)"
xcrun stapler staple $(DMG)
clean:
swift package clean
rm -rf $(APP) .icons $(DMG)
bump:
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $(VERSION)" packaging/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $(VERSION)" packaging/Info.plist