-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
89 lines (76 loc) · 2.37 KB
/
Makefile
File metadata and controls
89 lines (76 loc) · 2.37 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
.PHONY: build test lint clean install help fmt test-coverage test-integration
# Default target
help:
@echo "AGK Developer CLI - Build Commands"
@echo ""
@echo "Usage:"
@echo " make build Build the binary"
@echo " make test Run unit tests"
@echo " make test-coverage Run tests with coverage report"
@echo " make test-integration Run integration tests"
@echo " make lint Run linter"
@echo " make fmt Format code"
@echo " make clean Clean build artifacts"
@echo " make install Install binary"
@echo " make help Show this help message"
# Build binary
build:
@echo "Building AGK..."
@go build -o agk main.go
@echo "✓ Build complete: ./agk"
# Run tests
test:
@echo "Running tests..."
@go test -v -race ./...
@echo "✓ Tests passed"
# Run tests with coverage
test-coverage:
@echo "Running tests with coverage..."
@go test -v -coverprofile=coverage.txt -covermode=atomic ./...
@go tool cover -html=coverage.txt -o coverage.html
@echo "✓ Coverage report: coverage.html"
# Run integration tests
test-integration:
@echo "Running integration tests..."
@go test -v -tags=integration ./test/integration/...
@echo "✓ Integration tests passed"
# Run linter
lint:
@echo "Running linter..."
@golangci-lint run ./...
@echo "✓ Linting passed"
# Format code
fmt:
@echo "Formatting code..."
@gofmt -s -w .
@goimports -w .
@echo "✓ Code formatted"
# Clean build artifacts
clean:
@echo "Cleaning..."
@rm -f agk agk.exe coverage.txt coverage.html
@rm -rf dist/ build/
@go clean
@echo "✓ Clean complete"
# Install binary
install:
@echo "Installing AGK..."
@go install -ldflags "-X github.com/agenticgokit/agk/cmd.Version=$(shell git describe --tags --always) -X github.com/agenticgokit/agk/cmd.GitCommit=$(shell git rev-parse HEAD) -X github.com/agenticgokit/agk/cmd.BuildDate=$(shell date -u '+%Y-%m-%dT%H:%M:%SZ')"
@echo "✓ Installation complete"
# Development build with all flags
dev-build:
@echo "Building development version..."
@go build -o agk-dev main.go
@echo "✓ Dev build complete: ./agk-dev"
# Run the binary
run: build
@./agk version
# Development mode - watch for changes
watch:
@echo "Watching for changes..."
@go run main.go version
# Generate mocks (if using mockgen)
mocks:
@echo "Generating mocks..."
@go generate ./...
@echo "✓ Mocks generated"