Skip to content

Commit f3ba4c4

Browse files
committed
Rename add-debugger to native-simulator
1 parent 21aa595 commit f3ba4c4

File tree

10 files changed

+15
-8
lines changed

10 files changed

+15
-8
lines changed

cargo-generate.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sub_templates = [
77
"contract",
88
"atomics-contract",
99
"stack-reorder-contract",
10-
"add-debugger",
10+
"native-simulator",
1111
# Dependency crate templates
1212
"c-wrapper-crate",
1313
"x64-simulator-crate",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

workspace/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ overflow-checks = true
1313
strip = true
1414
codegen-units = 1
1515

16+
[profile.ckb-debug]
17+
inherits = "release"
18+
strip = false
19+
debug = true
20+
1621
# TODO: Will be deleted after release
1722
[replace]
1823
"ckb-std:0.15.3" = { git = "https://github.com/nervosnetwork/ckb-std.git", branch = "master" }

workspace/Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ build-simulator: build
6060
@set -eu; \
6161
if [ "x$(CONTRACT)" = "x" ]; then \
6262
for contract in $(wildcard contracts/*); do \
63-
$(MAKE) -e -C $$contract build-simulator; \
63+
if [ -d "$$contract/`basename $$contract`-dbg" ]; then \
64+
$(MAKE) -e -C $$contract build-simulator; \
65+
fi; \
6466
done; \
6567
else \
6668
$(MAKE) -e -C contracts/$(CONTRACT) build-simulator; \
@@ -128,7 +130,7 @@ generate:
128130
mv Cargo.toml.new Cargo.toml; \
129131
if [ "$(ALSO_ADD_DEBUGGER)" = "true" ] && [ "$(TEMPLATE)" = "contract" ]; then \
130132
echo "Generate native simulator debugger"; \
131-
scripts/add-debugger $${GENERATED_DIR#$(DESTINATION)/} $(TEMPLATE_TYPE) $(TEMPLATE_REPO); \
133+
scripts/generate-native-simulator $${GENERATED_DIR#$(DESTINATION)/} $(TEMPLATE_TYPE) $(TEMPLATE_REPO); \
132134
fi; \
133135
else \
134136
cargo generate $(TEMPLATE_TYPE) $(TEMPLATE_REPO) $(TEMPLATE) \
@@ -142,16 +144,16 @@ generate:
142144
mv Cargo.toml.new Cargo.toml; \
143145
if [ "$(ALSO_ADD_DEBUGGER)" = "true" ] && [ "$(TEMPLATE)" = "contract" ]; then \
144146
echo "Generate native simulator debugger"; \
145-
scripts/add-debugger $(CRATE) $(TEMPLATE_TYPE) $(TEMPLATE_REPO); \
147+
scripts/generate-native-simulator $(CRATE) $(TEMPLATE_TYPE) $(TEMPLATE_REPO); \
146148
fi; \
147149
fi;
148150

149-
add-debugger:
151+
generate-native-simulator:
150152
@set -eu; \
151153
if [ "x$(CRATE)" = "x" ]; then \
152-
scripts/add-debugger _ $(TEMPLATE_TYPE) $(TEMPLATE_REPO); \
154+
scripts/generate-native-simulator _ $(TEMPLATE_TYPE) $(TEMPLATE_REPO); \
153155
else \
154-
scripts/add-debugger $(CRATE) $(TEMPLATE_TYPE) $(TEMPLATE_REPO); \
156+
scripts/generate-native-simulator $(CRATE) $(TEMPLATE_TYPE) $(TEMPLATE_REPO); \
155157
fi
156158

157159
prepare:

workspace/scripts/add-debugger renamed to workspace/scripts/generate-native-simulator

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fi
5050

5151
CONTRACT_CRATE=$(echo "$CONTRACT_NAME" | tr '-' '_')
5252

53-
cargo generate $2 $3 add-debugger -n $CONTRACT_NAME-dbg --destination contracts/$CONTRACT_NAME -d contract_name=$CONTRACT_NAME -d contract_crate_name=$CONTRACT_CRATE
53+
cargo generate $2 $3 native-simulator -n $CONTRACT_NAME-dbg --destination contracts/$CONTRACT_NAME -d contract_name=$CONTRACT_NAME -d contract_crate_name=$CONTRACT_CRATE
5454
cd contracts/$CONTRACT_NAME
5555
mv $CONTRACT_NAME-dbg/src/contract-lib.rs src/lib.rs
5656
echo "Finally, you need to add a feature to the contract's Cargo.toml:"

0 commit comments

Comments
 (0)