diff --git a/server/Makefile b/server/Makefile index 3924dbf..8f638ab 100644 --- a/server/Makefile +++ b/server/Makefile @@ -1,14 +1,3 @@ -gen-proto: - if not exist ".\internal\pb\plantsapi" mkdir ".\internal\pb\plantsapi" - protoc -I api \ - -I$(GOPATH)/pkg/mod \ - -I$(GOPATH)/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@v1.16.0/third_party/googleapis \ - -I$(GOPATH)/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@v1.16.0 \ - --go_out=internal/pkg/pb --go_opt=paths=source_relative \ - --grpc-gateway_out=internal/pkg/pb --grpc-gateway_opt=paths=source_relative \ - --go-grpc_out=internal/pkg/pb --go-grpc_opt=paths=source_relative .\api\plants\v1\plants.proto - - proto: rm -rf internal/pkg/pb && mkdir -p internal/pkg/pb protoc -I api -I $(GOPATH)/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@v1.16.0/third_party/googleapis \ @@ -17,3 +6,7 @@ proto: --grpc-gateway_out=internal/pkg/pb --grpc-gateway_opt=paths=source_relative \ --openapiv2_out gen/docs \ ./api/**/**/*.proto + +win-gen-proto: + if not exist ".\internal\pb\" mkdir ".\internal\pb\" + powershell -Command "Get-ChildItem -Path \"api\" -Filter \"*proto\" -Recurse | ForEach{protoc -I api -I $(GOPATH)/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@v1.16.0/third_party/googleapis --go_out=internal/pkg/pb --go_opt=paths=source_relative --go-grpc_out=./internal/pkg/pb --go-grpc_opt=paths=source_relative --grpc-gateway_out=./internal/pkg/pb --grpc-gateway_opt=paths=source_relative --openapiv2_out ./gen/docs $$_.FullName.Replace($$pwd.Path, '.')}"