-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (65 loc) · 2.08 KB
/
Makefile
File metadata and controls
78 lines (65 loc) · 2.08 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
#!/usr/bin/make -f
.PHONY: build run clean test setup-neo4j stop-neo4j help
# Build the CLI analyzer
build-cli:
@echo "Building CLI analyzer..."
go build -o analyzer-cli main_cli.go analyzer.go ast_parser.go models.go graph_db.go git.go
# Build the Web analyzer
build-web:
@echo "Building Web analyzer..."
go build -o analyzer-web main.go analyzer.go ast_parser.go models.go graph_db.go git.go web_server.go
# Build both versions
build: build-cli build-web
# Run the analyzer with example repo
run: build
@echo "Running analyzer..."
./analyzer -repo https://github.com/gin-gonic/gin
# Clean build artifacts
clean:
@echo "Cleaning up..."
rm -f analyzer
rm -rf ../source/*
# Run tests
test:
@echo "Running tests..."
go test ./...
# Setup Neo4j using Docker
setup-neo4j:
@echo "Starting Neo4j database..."
docker-compose up -d neo4j
@echo "Waiting for Neo4j to be ready..."
@until docker-compose exec neo4j cypher-shell -u neo4j -p password "RETURN 1" > /dev/null 2>&1; do \
echo "Waiting for Neo4j..."; \
sleep 2; \
done
@echo "Neo4j is ready at http://localhost:7474"
@echo "Username: neo4j, Password: password"
# Stop Neo4j
stop-neo4j:
@echo "Stopping Neo4j database..."
docker-compose down
# Install dependencies
deps:
@echo "Installing dependencies..."
go mod download
go mod tidy
# Full setup
setup: deps setup-neo4j
@echo "Setup complete!"
# Example analysis
example: setup build
@echo "Analyzing example repository..."
./analyzer -repo https://github.com/gorilla/mux
@echo "Analysis complete! Check Neo4j browser at http://localhost:7474"
help:
@echo "Available commands:"
@echo " build - Build the analyzer binary"
@echo " run - Build and run analyzer with gin example"
@echo " clean - Clean build artifacts and cloned repositories"
@echo " test - Run tests"
@echo " setup-neo4j- Start Neo4j using Docker"
@echo " stop-neo4j - Stop Neo4j container"
@echo " deps - Install Go dependencies"
@echo " setup - Complete setup (deps + Neo4j)"
@echo " example - Run full example analysis"
@echo " help - Show this help message"