-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
103 lines (85 loc) · 2.47 KB
/
Makefile
File metadata and controls
103 lines (85 loc) · 2.47 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
102
103
# Makefile for requestCore project
# Provides convenient commands for version management and development
.PHONY: help version major minor patch version-current version-next version-check version-validate test build clean
# Default target
help:
@echo "requestCore Development Commands"
@echo "================================"
@echo ""
@echo "Version Management:"
@echo " version major Bump major version (1.0.0 -> 2.0.0)"
@echo " version minor Bump minor version (1.0.0 -> 1.1.0)"
@echo " version patch Bump patch version (1.0.0 -> 1.0.1)"
@echo " major Alias for 'version major'"
@echo " minor Alias for 'version minor'"
@echo " patch Alias for 'version patch'"
@echo " version-current Show current version"
@echo " version-next TYPE Show next version (major|minor|patch)"
@echo " version-check Check if version needs bumping"
@echo " version-validate Validate commit messages"
@echo ""
@echo "Development:"
@echo " test Run tests"
@echo " build Build the project"
@echo " clean Clean build artifacts"
@echo ""
@echo "Examples:"
@echo " make version minor"
@echo " make minor"
@echo " make patch"
@echo " make version-current"
# Version management commands
version:
@if [ -z "$(filter major minor patch,$(MAKECMDGOALS))" ]; then \
echo "Usage: make version <major|minor|patch>"; \
echo "Or use aliases: make major, make minor, make patch"; \
exit 1; \
fi
major:
@./scripts/version.sh bump major
minor:
@./scripts/version.sh bump minor
patch:
@./scripts/version.sh bump patch
version-current:
@./scripts/version.sh current
version-check:
@./scripts/version.sh check
version-validate:
@./scripts/version.sh validate
version-next:
@if [ -z "$(TYPE)" ]; then \
echo "Usage: make version-next TYPE=<major|minor|patch>"; \
exit 1; \
fi
@./scripts/version.sh next $(TYPE)
# Development commands
test:
@echo "Running tests..."
@go test ./...
build:
@echo "Building requestCore..."
@go build -o bin/requestCore .
clean:
@echo "Cleaning build artifacts..."
@rm -rf bin/
@go clean
# Install dependencies
deps:
@echo "Installing dependencies..."
@go mod tidy
@go mod download
# Format code
fmt:
@echo "Formatting code..."
@go fmt ./...
# Lint code
lint:
@echo "Linting code..."
@go vet ./...
# Run all checks
check: fmt lint test
@echo "All checks passed!"
# Quick development workflow
dev: check build
@echo "Development build complete!"