-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (48 loc) · 1.62 KB
/
Copy pathMakefile
File metadata and controls
58 lines (48 loc) · 1.62 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
.PHONY: build test run dev clean lint fmt swagger deps help
## Build the maptoposter binary
build: swagger
@echo "Building..."
@go build -o bin/maptoposter ./cmd
@echo "✓ Binary: bin/maptoposter"
## Run all tests with race detector and coverage
test:
@echo "Running tests..."
@go test -v -race -cover ./...
## Build and start the API server
run: build
@./bin/maptoposter
## Start with Air (live reload on .go file changes; install with: go install github.com/air-verse/air@latest)
dev:
@air
## Remove build artifacts and generated posters
clean:
@rm -rf bin/ posters/
## Run golangci-lint (must be installed separately)
lint:
@golangci-lint run ./...
## Format all Go source files
fmt:
@gofmt -w .
## Generate Swagger docs (requires swag CLI)
swagger:
@echo "Generating Swagger docs..."
@swag init -g cmd/main.go -o docs --parseDependency --parseInternal
@echo "✓ Swagger docs generated in docs/"
## Download and tidy dependencies
deps:
@go install github.com/swaggo/swag/cmd/swag@latest
@go install github.com/air-verse/air@latest
@go mod tidy
## Show this help
help:
@echo "Available targets:"
@echo " make build - Generate Swagger docs and build the binary"
@echo " make test - Run all tests"
@echo " make run - Build and start the API server"
@echo " make dev - Start with Air (live reload)"
@echo " make clean - Remove build artifacts"
@echo " make lint - Run linter"
@echo " make fmt - Format Go source files"
@echo " make swagger - Regenerate Swagger docs"
@echo " make deps - Install swag CLI and tidy Go modules"
@echo " make help - Show this help"