-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
101 lines (77 loc) · 3.1 KB
/
Copy pathMakefile
File metadata and controls
101 lines (77 loc) · 3.1 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
96
97
98
99
100
101
.PHONY: help setup clean dev dev-vite build-vite build-tauri build format typegen test test-frontend test-rust test-e2e format-check clippy verify
.DEFAULT_GOAL := help
CYAN := \033[0;36m
GREEN := \033[0;32m
YELLOW := \033[0;33m
RED := \033[0;31m
NC := \033[0m
##@ General
help: ## Display this help message
@echo "$(CYAN)Gitru Build System$(NC)"
@echo ""
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make $(CYAN)<target>$(NC)\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " $(CYAN)%-20s$(NC) %s\n", $$1, $$2 } /^##@/ { printf "\n$(YELLOW)%s$(NC)\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
setup: ## Install dependencies and build Rust crates
@echo "$(GREEN)Installing dependencies...$(NC)"
bun install
@echo "$(GREEN)Building Rust crates...$(NC)"
cargo build
@echo "$(GREEN)Setup complete!$(NC)"
##@ Development
dev: ## Start development server with Tauri
@echo "$(GREEN)Starting Tauri development server...$(NC)"
bun --cwd="./apps/desktop" run tauri dev
dev-vite: ## Start Vite development server only (no Tauri)
@echo "$(GREEN)Starting Vite development server...$(NC)"
bun --cwd="./apps/desktop" run dev
##@ Build
build-vite: ## Build Vite application only (no Tauri)
@echo "$(GREEN)Building Vite application...$(NC)"
@. ./scripts/load-env.sh && \
bun --cwd="./apps/desktop" run build
@echo "$(GREEN)Vite build complete!$(NC)"
build-tauri: ## Build Tauri application
@echo "$(GREEN)Building Tauri application...$(NC)"
@. ./scripts/load-env.sh && \
bun --cwd="./apps/desktop" run tauri build
@echo "$(GREEN)Tauri build complete!$(NC)"
build: ## Build both Vite and Tauri applications
@echo "$(GREEN)Building both Vite and Tauri applications...$(NC)"
@make build-tauri
##@ Utilities
format: ## Format code
@echo "$(YELLOW)Formatting code...$(NC)"
bun run format
typegen: ## Generate TypeScript types
@echo "$(YELLOW)Generating types...$(NC)"
@./scripts/typegen.sh
clean: ## Clean build artifacts and dependencies
@echo "$(RED)Cleaning build artifacts...$(NC)"
@./scripts/clear.sh
@echo "$(GREEN)Clean complete!$(NC)"
##@ Testing
test: test-frontend test-rust ## Run all frontend and Rust tests
test-frontend: ## Run frontend tests headlessly
@echo "$(GREEN)Running frontend tests...$(NC)"
bun run test
test-rust: ## Run all Rust tests
@echo "$(GREEN)Running Rust tests...$(NC)"
cargo test --workspace --verbose
test-e2e: ## Run packaged desktop end-to-end smoke tests
@echo "$(GREEN)Running packaged desktop end-to-end smoke tests...$(NC)"
bun --cwd=apps/desktop run e2e
format-check: ## Check code formatting
@echo "$(YELLOW)Checking code formatting...$(NC)"
cargo fmt --all -- --check
clippy: ## Run Clippy linter
@echo "$(YELLOW)Running Clippy linter...$(NC)"
cargo clippy --workspace --all-targets -- -D warnings
verify: ## Run the complete local and CI verification suite
@echo "$(YELLOW)Running frontend tests, lint, type checks, and desktop build...$(NC)"
bun run test
bun run lint
bun run check-types
bun run build --filter gitru
@echo "$(YELLOW)Running Rust formatting, lint, and tests...$(NC)"
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace