Skip to content

Commit

Permalink
backend/Makefile: set GOBIN for codegen
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Batts <[email protected]>
  • Loading branch information
vbatts committed Mar 10, 2023
1 parent 14cd49c commit 690baa5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ code-checks: tools/golangci-lint
swagger-init: tools/swag
./tools/swag init -g cmd/userctl/main.go -o api

.PHONY: tools/codegen
tools/codegen:
go install github.com/deepmap/oapi-codegen/cmd/[email protected].2
.PHONY: tools/oapi-codegen
tools/oapi-codegen:
env GOBIN=$(CURDIR)/tools/ go install github.com/deepmap/oapi-codegen/cmd/[email protected].4

.PHONY: codegen
codegen: tools/codegen
PATH=$$GOPATH/bin:$$PATH oapi-codegen --old-config-style --generate=server --package codegen -o ./pkg/codegen/server.gen.go ./api/spec.yaml;
PATH=$$GOPATH/bin:$$PATH oapi-codegen --old-config-style --generate=spec --package codegen -o ./pkg/codegen/spec.gen.go ./api/spec.yaml;
PATH=$$GOPATH/bin:$$PATH oapi-codegen --old-config-style --generate=client --package codegen -o ./pkg/codegen/client.gen.go ./api/spec.yaml;
PATH=$$GOPATH/bin:$$PATH oapi-codegen --old-config-style --generate=types --package codegen -o ./pkg/codegen/types.gen.go ./api/spec.yaml;
codegen: tools/oapi-codegen
PATH=$$GOPATH/bin:$$PATH ./tools/oapi-codegen --old-config-style --generate=server --package codegen -o ./pkg/codegen/server.gen.go ./api/spec.yaml;
PATH=$$GOPATH/bin:$$PATH ./tools/oapi-codegen --old-config-style --generate=spec --package codegen -o ./pkg/codegen/spec.gen.go ./api/spec.yaml;
PATH=$$GOPATH/bin:$$PATH ./tools/oapi-codegen --old-config-style --generate=client --package codegen -o ./pkg/codegen/client.gen.go ./api/spec.yaml;
PATH=$$GOPATH/bin:$$PATH ./tools/oapi-codegen --old-config-style --generate=types --package codegen -o ./pkg/codegen/types.gen.go ./api/spec.yaml;

0 comments on commit 690baa5

Please sign in to comment.