-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (65 loc) · 1.7 KB
/
Makefile
File metadata and controls
76 lines (65 loc) · 1.7 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
.PHONY: build test clean install run-example help
# Build the binary
build:
@echo "Building apicontract..."
@go build -o apicontract ./cmd/apicontract
@echo "✓ Build complete: ./apicontract"
# Run tests
test:
@echo "Running tests..."
@go test -v ./...
# Run the test script
test-all: build
@echo "Running full test suite..."
@./test.sh
# Clean build artifacts
clean:
@echo "Cleaning..."
@rm -f apicontract
@echo "✓ Clean complete"
# Install the binary to GOPATH/bin
install:
@echo "Installing apicontract..."
@go install ./cmd/apicontract
@echo "✓ Install complete"
# Run example
run-example: build
@echo "Running example..."
@./apicontract -spec examples/openapi-local.yaml \
-endpoint http://localhost:8080/posts/1 \
-method GET \
-verbose
# Start test server
start-server:
@echo "Starting test server on http://localhost:8080..."
@go run examples/test-server.go
# Format code
fmt:
@echo "Formatting code..."
@go fmt ./...
@echo "✓ Format complete"
# Run linter
lint:
@echo "Running linter..."
@go vet ./...
@echo "✓ Lint complete"
# Get dependencies
deps:
@echo "Getting dependencies..."
@go mod download
@go mod tidy
@echo "✓ Dependencies updated"
# Help
help:
@echo "Available targets:"
@echo " build - Build the binary"
@echo " test - Run Go tests"
@echo " test-all - Run full test suite"
@echo " clean - Remove build artifacts"
@echo " install - Install to GOPATH/bin"
@echo " run-example - Run an example validation"
@echo " start-server - Start the test server"
@echo " fmt - Format code"
@echo " lint - Run linter"
@echo " deps - Update dependencies"
@echo " help - Show this help message"