-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (37 loc) · 1.16 KB
/
Makefile
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
.PHONY: run init tidy build
# Dependencies
MODULES := $(wildcard cmd/**/*.go internal/**/*.go pkg/**/*.go)
# Initialize project by tidying up dependencies and running the application
init: tidy run
# Tidy up Go modules
tidy:
go mod tidy
# Build the Go application
build:
go build -o bin/main ./cmd/main.go
# Run the Go application
run: $(MODULES)
go run ./cmd/main.go
test:
go test ./... -cover
gql-gen:
go get github.com/99designs/gqlgen
go run github.com/99designs/gqlgen generate
grpc-server-gen:
mkdir -p internal/adapters/grpc_server/pb
protoc \
--proto_path=internal/adapters/grpc_server/proto \
--go_out=internal/adapters/grpc_server/pb \
--go_opt=paths=source_relative \
--go-grpc_out=internal/adapters/grpc_server/pb \
--go-grpc_opt=paths=source_relative \
internal/adapters/grpc_server/proto/*.proto
grpc-client-gen:
mkdir -p internal/adapters/grpc_server/pb
protoc \
--proto_path=internal/adapters/grpc_server/proto \
--go_out=internal/adapters/grpc_server/pb \
--go_opt=paths=source_relative \
--go-grpc_out=internal/adapters/grpc_server/pb \
--go-grpc_opt=paths=source_relative \
internal/adapters/grpc_server/proto/*.proto