-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (60 loc) · 3 KB
/
Copy pathMakefile
File metadata and controls
73 lines (60 loc) · 3 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
72
73
APP = dist/Battistics.app
DERIVED = .build/xcode
SPARKLE_BIN = $(DERIVED)/SourcePackages/artifacts/sparkle/Sparkle/bin
SIGN_IDENTITY ?= -
VERSION = $(shell /usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' Sources/BattisticsApp/Support/Info.plist)
.PHONY: gen build test app run install dmg appcast release tap metrics clean
gen:
xcodegen generate
# SIGN_IDENTITY defaults to ad-hoc, which is fine until you need the
# privileged helper: SMAppService will not register a daemon without a real
# team identifier. Build with
# SIGN_IDENTITY="Developer ID Application: ..." make run
# to exercise that path locally.
build: gen
xcodebuild -project Battistics.xcodeproj -scheme Battistics -configuration Debug \
-derivedDataPath $(DERIVED) build \
CODE_SIGN_IDENTITY="$(SIGN_IDENTITY)" $(if $(filter -,$(SIGN_IDENTITY)),,CODE_SIGN_STYLE=Manual CODE_SIGN_INJECT_BASE_ENTITLEMENTS=NO OTHER_CODE_SIGN_FLAGS="--timestamp --options=runtime")
test:
swift test
app: gen
xcodebuild -project Battistics.xcodeproj -scheme Battistics -configuration Release \
-derivedDataPath $(DERIVED) build \
CODE_SIGN_IDENTITY="$(SIGN_IDENTITY)" $(if $(filter -,$(SIGN_IDENTITY)),,CODE_SIGN_STYLE=Manual CODE_SIGN_INJECT_BASE_ENTITLEMENTS=NO OTHER_CODE_SIGN_FLAGS="--timestamp --options=runtime")
rm -rf dist && mkdir -p dist
ditto $(DERIVED)/Build/Products/Release/Battistics.app $(APP)
SIGN_IDENTITY="$(SIGN_IDENTITY)" bash scripts/sign-app.sh $(APP)
run: build
open $(DERIVED)/Build/Products/Debug/Battistics.app
install: app
rm -rf /Applications/Battistics.app
ditto $(APP) /Applications/Battistics.app
@echo "Installed to /Applications/Battistics.app"
dmg: app
bash scripts/make-dmg.sh
appcast:
rm -rf dist/release && mkdir -p dist/release
cp dist/Battistics-$(VERSION).dmg dist/release/
$(SPARKLE_BIN)/generate_appcast dist/release \
--download-url-prefix "https://github.com/doguyilmaz/battistics/releases/download/v$(VERSION)/"
# generate_appcast names its output after SUFeedURL in the app's
# Info.plist, so it already writes appcast-2.xml. The mv is only a guard
# in case that ever stops being true.
[ -f dist/release/appcast-2.xml ] || mv dist/release/appcast.xml dist/release/appcast-2.xml
cp scripts/legacy-appcast.xml dist/release/appcast.xml
release: appcast
awk -v want="## $(VERSION)" '$$0 == want { f = 1; next } /^## / { if (f) exit } f' \
CHANGELOG.md > dist/release/notes.md
gh release create v$(VERSION) dist/release/Battistics-$(VERSION).dmg \
dist/release/appcast-2.xml dist/release/appcast.xml \
--title "Battistics-$(VERSION)" --notes-file dist/release/notes.md
./scripts/update-tap.sh $(VERSION) dist/release/Battistics-$(VERSION).dmg
# Only needed if the release job's cask step was skipped or failed.
# VERSION is the working tree's placeholder, so ask GitHub what shipped.
# Override with `make tap V=1.2.0`.
tap:
@./scripts/update-tap.sh $(if $(V),$(V),$(shell gh release view --json tagName --jq '.tagName' | sed 's/^v//'))
metrics:
@./scripts/metrics.sh
clean:
rm -rf .build dist Battistics.xcodeproj