summaryrefslogtreecommitdiff
path: root/Makefile
blob: a0c63431f898ebdef1a5ee13606f324cb5d9dfa3 (plain)
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
# You must use the current protoc-gen-go
#
# go-clone --go-src google.golang.org/protobuf
# cd ~/go/src/google.golang.org/protobuf/cmd/protoc-gen-go
# go install


all: forgeConfig.pb.go
	reset
	make -C forgeConfig

vet: lint
	GO111MODULE=off go vet

lint:
	-buf lint repo.proto

# autofixes your import headers in your golang files
goimports:
	goimports -w *.go
	make -C forgeConfig goimports

redomod:
	rm -f go.*
	GO111MODULE= go mod init
	GO111MODULE= go mod tidy

clean:
	rm -f *.pb.go
	-rm -f go.*
	make -C forgeConfig clean

install:
	make -C forgeConfig install

autogenpb:
	autogenpb --proto forgeConfig.proto --lobase forgeConfig --upbase ForgeConfig --sort "ByPath,GoPath" --marshal ForgeConfigs --append GoPath

forgeConfig.pb.go: forgeConfig.proto
	# I'm using version v1.35.x from google.golang.org/protobuf/cmd/protoc-gen-go
	cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/forgepb \
		--go_opt=MforgeConfig.proto=go.wit.com/lib/protobuf/forgepb \
		forgeConfig.proto