Skip to content

Commit

Permalink
chore: update pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeseung-bae committed May 24, 2024
1 parent 5560446 commit 253f77b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ easyjson-gen:

containerProtoVer=v0.2
containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer)
containerSuffix=$(shell echo $(CURDIR) | sed 's/\//./g')
containerSuffix=$(shell echo $(CURDIR) | sed 's/[^[:alnum:]_-]/./g')
containerProtoGen=cosmos-sdk-proto-gen-$(containerProtoVer)-$(containerSuffix)
containerProtoGenSwagger=cosmos-sdk-proto-gen-swagger-$(containerProtoVer)-$(containerSuffix)
containerProtoFmt=cosmos-sdk-proto-fmt-$(containerProtoVer)
Expand All @@ -403,28 +403,28 @@ proto-all: proto-format proto-lint proto-gen

proto-gen:
@echo "Generating Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v "$(CURDIR)":/workspace --workdir /workspace $(containerProtoImage) \
sh ./scripts/protocgen.sh; fi
@go mod tidy

# This generates the SDK's custom wrapper for google.protobuf.Any. It should only be run manually when needed
proto-gen-any:
@echo "Generating Protobuf Any"
$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) sh ./scripts/protocgen-any.sh
$(DOCKER) run --rm -v "$(CURDIR)":/workspace --workdir /workspace $(containerProtoImage) sh ./scripts/protocgen-any.sh

proto-swagger-gen:
@echo "Generating Protobuf Swagger"
@if $(DOCKER) ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then $(DOCKER) start -a $(containerProtoGenSwagger); else $(DOCKER) run --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \
@if $(DOCKER) ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then $(DOCKER) start -a $(containerProtoGenSwagger); else $(DOCKER) run --name $(containerProtoGenSwagger) -v "$(CURDIR)":/workspace --workdir /workspace $(containerProtoImage) \
sh ./scripts/protoc-swagger-gen.sh; fi

proto-format:
@echo "Formatting Protobuf files"
@$(DOCKER) run --rm -v $(CURDIR):/workspace \
@$(DOCKER) run --rm -v "$(CURDIR)":/workspace \
--workdir /workspace tendermintdev/docker-build-proto \
find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \;

proto-lint:
@$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace cellink/clang-format-lint \
@$(DOCKER) run --rm -v "$(CURDIR)":/workspace --workdir /workspace cellink/clang-format-lint \
--clang-format-executable /clang-format/clang-format9 -r --extensions proto --exclude ./third_party/* .

proto-check-breaking:
Expand Down

0 comments on commit 253f77b

Please sign in to comment.