-
Notifications
You must be signed in to change notification settings - Fork 36
/
Makefile
59 lines (44 loc) · 1.44 KB
/
Makefile
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
.DEFAULT_GOAL := generate
# Code Signing Settings
NO_CODE_SIGN_SETTINGS = CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
# Install Tasks
install-lint:
brew list swiftlint &>/dev/null || brew install swiftlint
install-xcodegen:
brew list xcodegen &>/dev/null || brew install xcodegen
install-xcbeautify:
brew list xcbeautify &>/dev/null || brew install xcbeautify
# Run Tasks
generate: install-xcodegen
xcodegen generate
test: lint test-iPad
lint: install-lint
swiftlint lint --strict 2>/dev/null
test-iPad:
set -o pipefail && \
xcodebuild \
-project Hammer.xcodeproj \
-scheme Hammer \
-destination "name=iPad Pro (12.9-inch) (6th generation)" \
test \
$(NO_CODE_SIGN_SETTINGS) | xcbeautify
test-iPhone:
set -o pipefail && \
xcodebuild \
-project Hammer.xcodeproj \
-scheme Hammer \
-destination "name=iPhone 15" \
test \
$(NO_CODE_SIGN_SETTINGS) | xcbeautify
test-iPhone-iOS15:
set -o pipefail && \
xcodebuild \
-project Hammer.xcodeproj \
-scheme Hammer \
-destination "name=iPhone 11" \
-sdk iphonesimulator15.0 \
test \
$(NO_CODE_SIGN_SETTINGS) | xcbeautify
# List all targets (from https://stackoverflow.com/questions/4219255/how-do-you-get-the-list-of-targets-in-a-makefile)
list:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'