Skip to content

Commit

Permalink
crates
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdevbear committed Nov 28, 2023
1 parent 5f32972 commit d97341e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
5 changes: 4 additions & 1 deletion Cargo.toml
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" }
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@ 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:
# Remove old bindings
rm -rf $(BINDINGS_FOLDER)
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) .
@mv -f $(BINDINGS_OUT_PATH) $(CRATES_FOLDER)

# Target for building the project
build: bindings
Expand Down
4 changes: 2 additions & 2 deletions app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bindings = { path = "../bindings" }
bindings = { workspace = true }
ethers = { version = "2", default-features = false, features = ["rustls"] }
eyre = "0.6"
tokio = { version = "1.19", features = ["macros", "rt-multi-thread"] }
tokio = { version = "1.19", features = ["macros", "rt-multi-thread"] }
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ imports_granularity = "Crate"
wrap_comments = true
comment_width = 100
# ignore automatically generated bindings
ignore = ["bindings/"]
ignore = ["crates/bindings/"]

# See more keys and their definitions at https://rust-lang.github.io/rustfmt

0 comments on commit d97341e

Please sign in to comment.