Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs #1705

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ proto-gen:
proto-swagger-gen:
@echo "Downloading Protobuf dependencies"
@make proto-download-deps
@make psf
@echo "Generating Protobuf Swagger"
$(protoCosmosImage) sh ./scripts/protoc-swagger-gen.sh

Expand All @@ -193,7 +194,12 @@ proto-lint:
SWAGGER_DIR=./swagger-proto
THIRD_PARTY_DIR=$(SWAGGER_DIR)/third_party

psf:
@echo psf $(SWAGGER_DIR)
./scripts/protoswagfix/bin/psf $(SWAGGER_DIR)

proto-download-deps:
rm -rf $(SWAGGER_DIR)
mkdir -p "$(THIRD_PARTY_DIR)/cosmos_tmp" && \
cd "$(THIRD_PARTY_DIR)/cosmos_tmp" && \
git init && \
Expand Down Expand Up @@ -271,4 +277,25 @@ proto-download-deps:
mkdir -p "$(THIRD_PARTY_DIR)/cosmos/ics23/v1" && \
curl -sSL "https://raw.githubusercontent.com/cosmos/ics23/$(DEPS_COSMOS_ICS23)/proto/cosmos/ics23/v1/proofs.proto" > "$(THIRD_PARTY_DIR)/cosmos/ics23/v1/proofs.proto"

.PHONY: proto-gen proto-swagger-gen proto-format proto-lint proto-download-deps
mkdir -p "$(THIRD_PARTY_DIR)/grpc_gw_tmp" && \
cd "$(THIRD_PARTY_DIR)/grpc_gw_tmp" && \
git init && \
git remote add origin "https://github.com/grpc-ecosystem/grpc-gateway.git" && \
git config core.sparseCheckout true && \
printf "protoc-gen-openapiv2/options\n" > .git/info/sparse-checkout && \
git fetch --depth=1 origin main && \
git checkout FETCH_HEAD && \
mkdir -p "$(THIRD_PARTY_DIR)/protoc-gen-openapiv2/options" && \
mv ./* .. && \
rm -rf "$(THIRD_PARTY_DIR)/grpc_gw_tmp"

# prepare swagger generation
mkdir -p "$(SWAGGER_DIR)/proto"
printf "version: v1\ndirectories:\n - proto\n - third_party" > "$(SWAGGER_DIR)/buf.work.yaml"
printf "version: v1\nname: buf.build/dymensionxyz/dymension\n" > "$(SWAGGER_DIR)/proto/buf.yaml"
cp ./proto/buf.gen.swagger.yaml "$(SWAGGER_DIR)/proto/buf.gen.swagger.yaml"

# copy existing proto files
cp -r ./proto/dymensionxyz "$(SWAGGER_DIR)/proto"

.PHONY: proto-gen proto-swagger-gen proto-format proto-lint proto-download-deps psf
Loading
Loading