-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (66 loc) · 1.8 KB
/
Makefile
File metadata and controls
79 lines (66 loc) · 1.8 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
.PHONY: generate build test clean run proto
# Default target
all: generate build
# Generate protobuf files
generate: proto
proto:
@echo "Generating protobuf files..."
@protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
proto/*.proto
@echo "Protobuf generation complete!"
# Build the binary
build:
@echo "Building flowctl..."
@go build -o bin/flowctl
@echo "Binary built at bin/flowctl"
# Run tests
test:
@echo "Running tests..."
@go test -v ./...
# Run the application
run:
@go run ./cmd/flowctl $(ARGS)
# Run the server
server:
@go run ./cmd/flowctl server
# Clean build artifacts
clean:
@echo "Cleaning..."
@rm -rf bin/
@go clean
@echo "Clean complete!"
# Install dependencies
deps:
@echo "Installing dependencies..."
@go mod download
@go mod tidy
# Install protoc plugins
install-proto-tools:
@echo "Installing protobuf Go plugins..."
@go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
@go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
@echo "Protobuf tools installed!"
# Format code
fmt:
@echo "Formatting code..."
@go fmt ./...
@echo "Formatting complete!"
# Lint code
lint:
@echo "Linting code..."
@golangci-lint run
@echo "Linting complete!"
# Help target
help:
@echo "Available targets:"
@echo " make generate - Generate protobuf files"
@echo " make build - Build the flowctl binary"
@echo " make test - Run tests"
@echo " make run - Run flowctl (use ARGS='server' for server mode)"
@echo " make server - Run flowctl server"
@echo " make clean - Clean build artifacts"
@echo " make deps - Install Go dependencies"
@echo " make fmt - Format Go code"
@echo " make lint - Lint Go code"
@echo " make help - Show this help message"