forked from resonatehq/resonate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
20 lines (17 loc) · 1.27 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
.PHONY: gen-proto
gen-proto:
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/app/subsystems/api/grpc/api/promise.proto
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/app/subsystems/api/grpc/api/schedule.proto
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/app/subsystems/api/grpc/api/lock.proto
.PHONY: deps
deps:
go install github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen@latest
.PHONY: gen-openapi
gen-openapi:
oapi-codegen -generate types,client -package promises ./api/promises-openapi.yml > pkg/client/promises/openapi.go
oapi-codegen -generate types,client -package schedules ./api/schedules-openapi.yml > pkg/client/schedules/openapi.go
oapi-codegen -generate types,client -package locks ./api/locks-openapi.yml > pkg/client/locks/openapi.go
gen-mock:
mockgen -source=pkg/client/promises/openapi.go -destination=pkg/client/promises/mock_client.go -package promises
mockgen -source=pkg/client/schedules/openapi.go -destination=pkg/client/schedules/mock_client.go -package schedules
mockgen -source=pkg/client/locks/openapi.go -destination=pkg/client/locks/mock_client.go -package locks