-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (47 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
.DEFAULT_GOAL := generate
# Paths
XCODEGEN := xcodegen
SWIFTGEN := swiftgen
SWIFTFORMAT := swiftformat
PROJECT := swiyu.xcodeproj
# ANSI color codes for better readability in supported terminals
RESET_COLOR := \033[0m
GREEN_COLOR := \033[32m
RED_COLOR := \033[31m
YELLOW_COLOR := \033[33m
CYAN_COLOR := \033[36m
# SPM
SPM_DIRS := $(shell find Modules/Features Modules/Platforms -type d -mindepth 1 -maxdepth 1)
install:
@echo "=> Installing tools"
brew update
brew bundle
bundle install
generate-info-plist:
@echo "=> Generating Info.plist using xcodegen"
$(XCODEGEN) generate
generate-swiftgen:
@echo "=> Generating Swift code using swiftgen"
$(SWIFTGEN) && \
$(XCODEGEN) generate
prepare-modules:
@echo "$(CYAN_COLOR)=> Generation & Configuration of Modules$(RESET_COLOR)"
for dir in $(SPM_DIRS); do \
echo ""; \
echo "$(YELLOW_COLOR)=> Generating module in $$dir$(RESET_COLOR)"; \
if (cd "$$dir" && make); then \
echo "$(GREEN_COLOR)=> Success: $$dir generated$(RESET_COLOR)"; \
else \
echo "$(RED_COLOR)=> Error: Failed to generate $$dir$(RESET_COLOR)"; \
fi; \
echo "-----------------------------------------"; \
done
swiftformat:
@echo "=> Formatting Swift code using swiftformat"
$(SWIFTFORMAT) .
open-project:
@echo "=> Opening Xcode project"
open "$(PROJECT)"
generate: generate-info-plist generate-swiftgen swiftformat prepare-modules open-project
setup: install generate swiftformat open-project
@echo "=> Done"