Skip to content

Commit ad3fe8d

Browse files
committed
Update workspace template
1 parent 257a2a6 commit ad3fe8d

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

workspace/Cargo.toml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22
resolver = "2"
33

44
members = [
5-
"crates/big-cell-fetcher",
6-
"crates/big-witness-hasher",
7-
"contracts/atomics-without-a",
8-
"contracts/legacy-c-dependency",
9-
"contracts/loads-of-hashes",
10-
"contracts/minimal-log",
11-
"contracts/stack-reorder",
5+
# Please don't remove the following line, we use it to automatically
6+
# detect insertion point for newly generated crates.
7+
# @@INSERTION_POINT@@
128
"tests",
139
]
1410

workspace/Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,23 @@ clean:
8383
rm -rf build
8484
cargo clean
8585

86+
TEMPLATE_REPO := https://github.com/xxuejie/ckb-script-templates
87+
CRATE :=
88+
TEMPLATE := contract
89+
DESTINATION := contracts
90+
generate:
91+
@set -eu; \
92+
if [ "x$(CRATE)" = "x" ]; then \
93+
cargo generate --git $(TEMPLATE_REPO) $(TEMPLATE) \
94+
--destination $(DESTINATION); \
95+
echo "Please update workspace-level Cargo.toml so members include the newly created crate!"; \
96+
else \
97+
cargo generate --git $(TEMPLATE_REPO) $(TEMPLATE) \
98+
--destination $(DESTINATION) \
99+
--name $(CRATE); \
100+
sed -i '/@@INSERTION_POINT@@/a \ \ "$(DESTINATION)/$(CRATE)",' Cargo.toml; \
101+
fi
102+
86103
prepare:
87104
rustup target add riscv64imac-unknown-none-elf
88105

0 commit comments

Comments
 (0)