Skip to content

Commit

Permalink
Merge pull request #43 from moevm/back-31
Browse files Browse the repository at this point in the history
back-31: Генерация proto файлов
  • Loading branch information
AnjeZenda authored Nov 30, 2024
2 parents 51c02c3 + 11d940b commit 2747b36
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions server/Makefile
Original file line number Diff line number Diff line change
@@ -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/[email protected]/third_party/googleapis \
-I$(GOPATH)/pkg/mod/github.com/grpc-ecosystem/[email protected] \
--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/[email protected]/third_party/googleapis \
Expand All @@ -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/[email protected]/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, '.')}"

0 comments on commit 2747b36

Please sign in to comment.