-
Notifications
You must be signed in to change notification settings - Fork 17
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
Makefile: generate RPC bindings #345
Changes from all commits
11874bf
b194144
778b763
f961ee9
10a8769
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
issues: | ||
exclude-rules: | ||
- path: ./rpc | ||
linters: | ||
- unused # RPC bindings are allowed to contain some unused convertors. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
*.avm | ||
*.nef | ||
*.manifest.json | ||
bindings_config.yml | ||
config.json | ||
/vendor/ | ||
.idea | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ export GOBIN ?= $(shell pwd)/bin | |
export CGO_ENABLED=0 | ||
NEOGO ?= $(GOBIN)/cli | ||
VERSION ?= $(shell git describe --tags --dirty --match "v*" --always --abbrev=8 2>/dev/null || cat VERSION 2>/dev/null || echo "develop") | ||
NEOGOORIGMOD = github.com/nspcc-dev/neo-go | ||
NEOGOORIGMOD = github.com/nspcc-dev/neo-go@v0.101.5-0.20230802075307-afa4530c7d73 | ||
NEOGOMOD = $(shell go list -f '{{.Path}}' -m $(NEOGOORIGMOD)) | ||
NEOGOVER = $(shell go list -f '{{.Version}}' -m $(NEOGOORIGMOD) | tr -d v) | ||
|
||
|
@@ -31,7 +31,9 @@ nns_sc = nns | |
|
||
define sc_template | ||
$(2)$(1)/$(1)_contract.nef: $(2)$(1)/$(1)_contract.go | ||
$(NEOGO) contract compile -i $(2)$(1) -c $(if $(2),$(2),$(1)/)config.yml -m $(2)$(1)/config.json -o $(2)$(1)/$(1)_contract.nef | ||
$(NEOGO) contract compile -i $(2)$(1) -c $(if $(2),$(2),$(1)/)config.yml -m $(2)$(1)/config.json -o $(2)$(1)/$(1)_contract.nef --bindings $(2)$(1)/bindings_config.yml | ||
mkdir -p rpc/$(1) | ||
$(NEOGO) contract generate-rpcwrapper -o rpc/$(1)/rpcbinding.go -m $(2)$(1)/config.json --config $(2)$(1)/bindings_config.yml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This, btw, should be handled by the Makefile. Makefile is not a shell script, it's all about targets, dependencies and the way they're produced. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's the only question I wasn't able to fix. Could you, please, review one more time and point out how to create a proper make target depending on all these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's leave it for now. |
||
|
||
$(if $(2),$(2)$(1)/$(1)_contract.go: alphabet/alphabet.go alphabet/alphabet.tpl | ||
go run alphabet/alphabet.go | ||
|
@@ -57,6 +59,8 @@ test: | |
clean: | ||
find . -name '*.nef' -exec rm -rf {} \; | ||
find . -name 'config.json' -exec rm -rf {} \; | ||
find . -name 'bindings_config.yml' -exec rm -rf {} \; | ||
find . -name 'rpc' -type d -prune -exec rm -rf {} \; | ||
rm -rf ./bin/ | ||
|
||
mr_proper: clean | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AnnaShaleva, since that is a
temporary use
, do we need an issue for that?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will be an issue to upgrade to 0.102.0 anyway. Can be created now, doesn't matter much.