-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add makefile auto download and sed on proto
- Loading branch information
Showing
2 changed files
with
117 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,15 @@ CWD ?= CURRENT_WORKING_DIRECTIONRY_NOT_SUPPLIED | |
# `VERBOSE_TEST="" make test_persistence` is an easy way to run the same tests without verbose output | ||
VERBOSE_TEST ?= -v | ||
|
||
# Detect OS using the $(shell uname -s) command | ||
ifeq ($(shell uname -s),Darwin) | ||
# Add macOS-specific commands here | ||
SEDI = sed -i '' | ||
else ifeq ($(shell uname -s),Linux) | ||
# Add Linux-specific commands here | ||
SEDI = sed -i | ||
endif | ||
|
||
.SILENT: | ||
|
||
.PHONY: list ## List all make targets | ||
|
@@ -309,13 +318,24 @@ protogen_local: go_protoc-go-inject-tag ## Generate go structures for all of the | |
$(PROTOC_SHARED) -I=./p2p/types/proto --go_out=./p2p/types ./p2p/types/proto/*.proto | ||
|
||
# IBC | ||
make copy_ics23_proto | ||
$(PROTOC_SHARED) -I=./ibc/types/proto --go_out=./ibc/types ./ibc/types/proto/*.proto | ||
|
||
# echo "View generated proto files by running: make protogen_show" | ||
|
||
# CONSIDERATION: Some proto files contain unused gRPC services so we may need to add the following | ||
# if/when we decide to include it: `grpc--go-grpc_opt=paths=source_relative --go-grpc_out=./output/path` | ||
|
||
.PHONY: copy_ics23_proto | ||
copy_ics23_proto: | ||
echo "Downloading cosmos/ics23 proto definitions..." | ||
curl -s -o ./ibc/types/proto/proofs.proto https://raw.githubusercontent.com/cosmos/ics23/master/proto/cosmos/ics23/v1/proofs.proto && \ | ||
$(SEDI) \ | ||
-e '/^package/{N;d;}' \ | ||
-e '[email protected]/.*"@github.com/pokt-network/ibc/types"@g' \ | ||
./ibc/types/proto/proofs.proto && \ | ||
awk 'BEGIN { print "// ===== !! THIS IS CLONED FROM cosmos/ics23 !! =====\n" } { print }' ./ibc/types/proto/proofs.proto > tmpfile && mv tmpfile ./ibc/types/proto/proofs.proto | ||
|
||
.PHONY: protogen_docker_m1 | ||
## TECHDEBT: Test, validate & update. | ||
protogen_docker_m1: docker_check | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters