-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (60 loc) · 1.74 KB
/
Copy pathMakefile
File metadata and controls
72 lines (60 loc) · 1.74 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
.PHONY: all build test clean run release format lint coverage install help
# Default target
all: format lint test build
# Build the project
build:
@echo "Building project..."
@cargo build
# Build release version
release:
@echo "Building release version..."
@cargo build --release
# Run tests
test:
@echo "Running tests..."
@cargo test
# Run the application
run:
@echo "Running trackwatch..."
@cargo run --release
# Format code
format:
@echo "Formatting code..."
@cargo fmt
# Run linter
lint:
@echo "Running clippy..."
@cargo clippy -- -D warnings
# Generate coverage report
coverage:
@echo "Generating coverage report..."
@cargo tarpaulin --out Html
@echo "Coverage report generated: tarpaulin-report.html"
# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
@cargo clean
@rm -f cobertura.xml tarpaulin-report.html lcov.info
# Install the binary locally
install:
@echo "Installing trackwatch..."
@cargo install --path .
# Check if all dependencies are available
check-deps:
@echo "Checking dependencies..."
@command -v playerctl >/dev/null 2>&1 || { echo "playerctl is required but not installed."; exit 1; }
@echo "All dependencies are installed!"
# Help
help:
@echo "Available targets:"
@echo " make build - Build the project"
@echo " make release - Build release version"
@echo " make test - Run tests"
@echo " make run - Run the application"
@echo " make format - Format code"
@echo " make lint - Run clippy linter"
@echo " make coverage - Generate coverage report"
@echo " make clean - Clean build artifacts"
@echo " make install - Install the binary locally"
@echo " make check-deps- Check if dependencies are installed"
@echo " make help - Show this help message"