-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from itsdevbear/bump
feat(makefile): add a `Makefile` to help create `bindings` crate.
- Loading branch information
Showing
10 changed files
with
172 additions
and
551 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
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
[workspace] | ||
members = [ | ||
"bindings", | ||
"app", | ||
"crates/bindings", | ||
] | ||
|
||
[workspace.dependencies] | ||
bindings = { path = "crates/bindings" } |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/make -f | ||
|
||
# Default target is build | ||
default: build | ||
|
||
# Define variables | ||
CARGO=cargo | ||
CRATES_FOLDER=crates | ||
CONTRACTS_PATH=./contracts | ||
BINDINGS_FOLDER=bindings | ||
BINDINGS_CRATES_FOLDER=$(CRATES_FOLDER)/$(BINDINGS_FOLDER) | ||
BINDINGS_OUT_PATH=$(CONTRACTS_PATH)/out/$(BINDINGS_FOLDER) | ||
|
||
# Target for generating bindings | ||
bindings: | ||
rm -rf $(BINDINGS_CRATES_FOLDER) | ||
rm -rf $(BINDINGS_OUT_PATH) | ||
|
||
# Generate new bindings | ||
@forge bind --root $(CONTRACTS_PATH) --crate-name $(BINDINGS_FOLDER) | ||
|
||
# Move bindings to the correct location | ||
@mv -f $(BINDINGS_OUT_PATH) $(CRATES_FOLDER) | ||
|
||
# Target for building the project | ||
build: bindings | ||
@$(CARGO) build | ||
|
||
# Target for building the project in release mode | ||
build-release: bindings | ||
@$(CARGO) build --release | ||
|
||
# Target for cleaning the project | ||
clean: | ||
@forge clean --root $(CONTRACTS_PATH) | ||
@$(CARGO) clean | ||
|
||
# Target for formatting the code | ||
fmt: | ||
@forge fmt --check --root $(CONTRACTS_PATH) | ||
@$(CARGO) fmt | ||
|
||
# Target for running tests | ||
test: | ||
@forge test --root $(CONTRACTS_PATH) | ||
@$(CARGO) test | ||
|
||
# Target for installing forge dependencies | ||
setup: | ||
@forge install | ||
|
||
|
||
# Declare phony targets | ||
.PHONY: build build-release clean fmt bindings |
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
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
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
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
[package] | ||
name = "bindings" | ||
version = "0.0.1" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
ethers = { version = "2", default-features = false, features = ["abigen"] } | ||
serde = "1" |
Oops, something went wrong.