-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (78 loc) · 2.31 KB
/
Makefile
File metadata and controls
95 lines (78 loc) · 2.31 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
##
## ================
## Gradient Loading Bar Makefile
## ================
##
######### Tools #########
SWIFTFORMAT := swiftformat
SWIFTLINT := swiftlint
XCODEBUILD := xcodebuild
######### SwiftFormat #########
## $ make verify-swiftformat-installed
## Verifies that SwiftFormat is installed on the system.
##
.PHONY: verify-swiftformat-installed
verify-swiftformat-installed:
@command -v $(SWIFTFORMAT) >/dev/null 2>&1 || { \
echo "warning: SwiftFormat not installed!"; \
exit 1; \
}
## $ make format
## Uses SwiftFormat to automatically reformat the codebase according
## to our guidelines.
##
.PHONY: format
format: verify-swiftformat-installed
@$(SWIFTFORMAT) ./
## $ make format-check
## Runs SwiftFormat in lint mode (no changes). Intended for CI.
##
.PHONY: format-check
format-check: verify-swiftformat-installed
@$(SWIFTFORMAT) --lint ./
######### SwiftLint #########
## $ make verify-swiftlint-installed
## Verifies that SwiftLint is installed on the system.
##
.PHONY: verify-swiftlint-installed
verify-swiftlint-installed:
@command -v $(SWIFTLINT) >/dev/null 2>&1 || { \
echo "warning: SwiftLint not installed!"; \
exit 1; \
}
## $ make lint
## Runs SwiftLint on the whole project according to the linting configuration files.
##
.PHONY: lint
lint: verify-swiftlint-installed
@$(SWIFTLINT) --strict ./
######### XcodeBuild #########
## $ make verify-xcodebuild-installed
## Verifies that xcodebuild is installed on the system.
##
.PHONY: verify-xcodebuild-installed
verify-xcodebuild-installed:
@command -v $(XCODEBUILD) >/dev/null 2>&1 || { \
echo "warning: xcodebuild not installed!"; \
exit 1; \
}
## $ make test
## Runs the test suite using xcodebuild.
##
.PHONY: test
test: verify-xcodebuild-installed
@$(XCODEBUILD) \
test \
-scheme GradientLoadingBar \
-destination 'platform=iOS Simulator,name=iPhone 17,OS=26.2' \
-enableCodeCoverage YES
## $ make build-example-application
## Builds the Example Application using xcodebuild.
##
.PHONY: build-example-application
build-example-application: verify-xcodebuild-installed
@$(XCODEBUILD) \
build \
-project Example/GradientLoadingBarExample.xcodeproj \
-scheme GradientLoadingBarExample \
-destination 'platform=iOS Simulator,name=iPhone 17,OS=26.2'