-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
169 lines (147 loc) · 5.78 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#!/usr/bin/xcrun make -f
.PHONY: all
all: help
.PHONY: install-pkgx
install-pkgx:
@echo "Installing pkgx..."
@curl -Ssf https://pkgx.sh | sh &> /dev/null
@echo "... done.\n"
.PHONY: install-bundler
install-bundler:
@echo "Installing bundler..."
@pkgx bundle config set path '.bundle'
@pkgx bundle install
@echo "... done.\n"
.PHONY: fastlane
fastlane: install-pkgx install-bundler
@pkgx bundle exec fastlane
.PHONY: archive-demo-ios
archive-demo-ios: install-pkgx install-bundler
@pkgx bundle exec fastlane archive_demo_ios
.PHONY: archive-demo-tvos
archive-demo-tvos: install-pkgx install-bundler
@pkgx bundle exec fastlane archive_demo_tvos
.PHONY: deliver-demo-nightly-ios
deliver-demo-nightly-ios: install-pkgx install-bundler
@echo "Delivering demo nightly build for iOS..."
@pkgx +magick +rsvg-convert bundle exec fastlane deliver_demo_nightly_ios
@echo "... done.\n"
.PHONY: deliver-demo-nightly-tvos
deliver-demo-nightly-tvos: install-pkgx install-bundler
@echo "Delivering demo nightly build for tvOS..."
@pkgx +magick +rsvg-convert bundle exec fastlane deliver_demo_nightly_tvos
@echo "... done.\n"
.PHONY: deliver-demo-release-ios
deliver-demo-release-ios: install-pkgx install-bundler
@echo "Delivering demo release build for iOS..."
@pkgx bundle exec fastlane deliver_demo_release_ios
@echo "... done.\n"
.PHONY: deliver-demo-release-tvos install-bundler
deliver-demo-release-tvos: install-pkgx
@echo "Delivering demo release build for tvOS..."
@pkgx bundle exec fastlane deliver_demo_release_tvos
@echo "... done.\n"
.PHONY: test-streams-start
test-streams-start: install-pkgx
@echo "Starting test streams"
@Scripts/test-streams.sh -s
@echo "... done.\n"
.PHONY: test-streams-stop
test-streams-stop: install-pkgx
@echo "Stopping test streams"
@Scripts/test-streams.sh -k
@echo "... done.\n"
.PHONY: test-ios
test-ios: install-pkgx install-bundler
@echo "Running unit tests..."
@Scripts/test-streams.sh -s
@pkgx bundle exec fastlane test_ios
@Scripts/test-streams.sh -k
@echo "... done.\n"
.PHONY: test-tvos
test-tvos: install-pkgx install-bundler
@echo "Running unit tests..."
@Scripts/test-streams.sh -s
@pkgx bundle exec fastlane test_tvos
@Scripts/test-streams.sh -k
@echo "... done.\n"
.PHONY: check-quality
check-quality: install-pkgx
@echo "Checking quality..."
@Scripts/check-quality.sh
@echo "... done.\n"
.PHONY: fix-quality
fix-quality: install-pkgx
@echo "Fixing quality..."
@Scripts/fix-quality.sh
@echo "... done.\n"
.PHONY: git-hook-install
git-hook-install:
@echo "Installing git hooks..."
@git config core.hooksPath hooks
@echo "... done.\n"
.PHONY: git-hook-uninstall
git-hook-uninstall:
@echo "Uninstalling git hooks..."
@git config --unset core.hooksPath
@echo "... done.\n"
.PHONY: spm-reload
spm-reload:
@echo "Remove dependencies..."
@swift package reset
@echo "... done.\n"
@echo "Reload dependencies..."
@swift package update
@echo "... done.\n"
.PHONY: clean-imports
clean-imports:
@echo "Cleaning imports..."
@mkdir -p .build
@xcodebuild -scheme Pillarbox -destination generic/platform=ios > ./.build/xcodebuild.log
@pkgx swiftlint analyze --fix --compiler-log-path ./.build/xcodebuild.log
@xcodebuild -scheme Pillarbox-demo -project ./Demo/Pillarbox-demo.xcodeproj -destination generic/platform=iOS > ./.build/xcodebuild.log
@pkgx swiftlint analyze --fix --compiler-log-path ./.build/xcodebuild.log
@echo "... done.\n"
.PHONY: find-dead-code
find-dead-code:
@echo "Start checking dead code..."
@mkdir -p .build
@xcodebuild -scheme Pillarbox -destination generic/platform=iOS -derivedDataPath ./.build/derived-data clean build &> /dev/null
@pkgx periphery scan --retain-public --skip-build --index-store-path ./.build/derived-data/Index.noindex/DataStore/
@xcodebuild -scheme Pillarbox-demo -project ./Demo/Pillarbox-demo.xcodeproj -destination generic/platform=iOS -derivedDataPath ./.build/derived-data clean build &> /dev/null
@pkgx periphery scan --project ./Demo/Pillarbox-demo.xcodeproj --schemes Pillarbox-demo --targets Pillarbox-demo --skip-build --index-store-path ./.build/derived-data/Index.noindex/DataStore/
@echo "... done.\n"
.PHONY: help
help:
@echo "The following targets are available:"
@echo ""
@echo " all Default target"
@echo ""
@echo " fastlane Run fastlane"
@echo ""
@echo " archive-demo-ios Archive the iOS demo (for all configurations)"
@echo " archive-demo-tvos Archive the tvOS demo (for all configurations)"
@echo ""
@echo " deliver-demo-nightly-ios Deliver a demo nightly build for iOS"
@echo " deliver-demo-nightly-tvos Deliver a demo nightly build for tvOS"
@echo ""
@echo " deliver-demo-release-ios Deliver a demo release build for iOS"
@echo " deliver-demo-release-tvos Deliver a demo release build for tvOS"
@echo ""
@echo " test-streams-start Start servicing test streams"
@echo " test-streams-stop Stop servicing test streams"
@echo ""
@echo " test-ios Build and run unit tests for iOS"
@echo " test-tvos Build and run unit tests for tvOS"
@echo ""
@echo " check-quality Run quality checks"
@echo " fix-quality Fix quality automatically (if possible)"
@echo ""
@echo " git-hook-install Use hooks located in ./hooks"
@echo " git-hook-uninstall Use default hooks located in .git/hooks"
@echo ""
@echo " spm-reload Reload SPM dependencies"
@echo " clean-imports Remove useless imports from the project"
@echo " find-dead-code Find dead code"
@echo ""
@echo " help Display this help message"