-
Notifications
You must be signed in to change notification settings - Fork 104
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (39 loc) · 1.72 KB
/
Makefile
File metadata and controls
53 lines (39 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
LIB_CRATES = $(shell cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name | startswith("test_") | not) | .name' | tr '\n' ' ')
TEST_CRATES = $(shell cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name | startswith("test_")) | .name' | tr '\n' ' ')
MSRV = $(shell cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "soroban-sdk") | .rust_version')
TEST_CRATES_RUSTUP_TOOLCHAIN?=$(MSRV)
CARGO_DOC_ARGS?=--open
default: test
doc: fmt
cargo test --doc $(foreach c,$(LIB_CRATES),--package $(c)) --features testutils,alloc,hazmat
cargo +nightly doc --no-deps $(foreach c,$(LIB_CRATES),--package $(c)) --all-features $(CARGO_DOC_ARGS)
test: fmt build-test-wasms test-only
test-only:
cargo hack --feature-powerset --ignore-unknown-features --features testutils --exclude-features docs test
build: build-libs build-test-wasms
build-libs: fmt
cargo hack build --release $(foreach c,$(LIB_CRATES),--package $(c))
build-test-wasms: fmt
# Build the test wasms with MSRV by default, with some meta disabled for
# binary stability for tests.
RUSTUP_TOOLCHAIN=$(TEST_CRATES_RUSTUP_TOOLCHAIN) \
RUSTFLAGS='--cfg soroban_sdk_internal_no_rssdkver_meta' \
cargo hack build --release --target wasm32v1-none $(foreach c,$(TEST_CRATES),--package $(c)) ; \
cd target/wasm32v1-none/release/ && \
for i in *.wasm ; do \
ls -l "$$i"; \
done
build-fuzz:
cd tests/fuzz/fuzz && cargo +nightly fuzz check
readme:
cd soroban-sdk \
&& cargo +nightly rustdoc --features testutils -- -Zunstable-options -wjson \
&& cat ../target/doc/soroban_sdk.json \
| jq -r '.index[.root|tostring].docs' \
> README.md
fmt:
cargo fmt --all
clean:
cargo clean
msrv:
@echo $(MSRV)