-
-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathMakefile
More file actions
88 lines (76 loc) Β· 2.95 KB
/
Copy pathMakefile
File metadata and controls
88 lines (76 loc) Β· 2.95 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
.PHONY: help default tests assets dependencies ruby lint format clean setup install-pre-commit pre-commit-run pre-commit-update check-versions
default: tests
help: ## Show this help
@echo "Critical Maps iOS - Available commands:"
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
check-versions: ## Check tool versions against .tool-versions
@echo "π Checking tool versions..."
@echo "Expected versions (from .tool-versions):"
@grep -v '^#' .tool-versions | while read tool version; do \
echo " $$tool: $$version"; \
done
@echo ""
@echo "Note: swiftformat and swiftlint are pinned in .pre-commit-config.yaml"
@echo "and managed by pre-commit, not brew."
@echo ""
@echo "Installed versions:"
@if command -v swiftgen >/dev/null 2>&1; then \
echo " swiftgen: $$(swiftgen --version | grep -o 'v[0-9\.]*' | head -1 | sed 's/v//')"; \
else \
echo " swiftgen: β not installed"; \
fi
@if command -v pre-commit >/dev/null 2>&1; then \
echo " pre-commit: $$(pre-commit --version | grep -o '[0-9\.]*')"; \
else \
echo " pre-commit: β not installed"; \
fi
dependencies: ruby check-versions ## Install all development dependencies
@echo "π¦ Installing development tools..."
@if ! command -v swiftgen >/dev/null 2>&1; then \
echo "Installing swiftgen..."; \
brew install swiftgen; \
else \
echo "β
swiftgen already installed"; \
fi
@if ! command -v pre-commit >/dev/null 2>&1; then \
echo "Installing pre-commit..."; \
brew install pre-commit; \
else \
echo "β
pre-commit already installed"; \
fi
@echo "Building swiftformat / swiftlint via pre-commit (first run only)..."
@pre-commit install-hooks
ruby: ## Install Ruby dependencies (bundler, fastlane)
@echo "π Setting up Ruby environment..."
@if ! command -v bundler >/dev/null 2>&1; then \
echo "Installing bundler..."; \
gem install bundler; \
else \
echo "β
bundler already installed"; \
fi
@echo "Installing fastlane and other Ruby gems..."
@bundle install
assets: ## Generate type-safe assets with SwiftGen
@echo "π¨ Generating type-safe assets..."
@swiftgen
lint: ## Run SwiftLint with auto-fix via pre-commit
@echo "π Running SwiftLint..."
@pre-commit run swiftlint-fix --all-files || true
@pre-commit run swiftlint --all-files
format: ## Format Swift code with SwiftFormat via pre-commit
@echo "β¨ Formatting Swift code..."
@pre-commit run swiftformat --all-files
tests: ## Run all tests via Fastlane
@echo "π§ͺ Running tests..."
@bundle exec fastlane ios test
install-pre-commit: ## Install pre-commit hooks
@echo "πͺ Installing pre-commit hooks..."
@pre-commit install
@echo "β
Pre-commit hooks installed"
pre-commit-run: ## Run pre-commit on all files
@echo "π Running pre-commit on all files..."
@pre-commit run --all-files
pre-commit-update: ## Update pre-commit hook versions
@echo "β¬οΈ Updating pre-commit hooks..."
@pre-commit autoupdate