forked from stellar/rs-soroban-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (50 loc) · 2.29 KB
/
Makefile
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
54
55
56
57
58
59
60
61
62
63
64
65
all: check test
export RUSTFLAGS=-Dwarnings
CARGO_TEST_SUBCOMMAND:=$(shell type -p cargo-nextest >/dev/null && echo nextest run || echo test)
CARGO_DOC_ARGS?=--open
doc: fmt
cargo test --doc -p soroban-sdk -p soroban-sdk-macros -p soroban-sdk-auth --features testutils
cargo +nightly doc -p soroban-sdk -p soroban-sdk-auth --no-deps --features docs,testutils $(CARGO_DOC_ARGS)
test: fmt build
cargo hack --feature-powerset --exclude-features docs $(CARGO_TEST_SUBCOMMAND)
build: fmt
cargo hack build --target wasm32-unknown-unknown --release
build-optimized: fmt
CARGO_TARGET_DIR=target-tiny cargo +nightly hack build --target wasm32-unknown-unknown --release \
--workspace \
--exclude soroban-spec \
--exclude soroban-sdk \
--exclude soroban-sdk-macros \
--exclude soroban-sdk-auth \
-Z build-std=std,panic_abort \
-Z build-std-features=panic_immediate_abort
cd target-tiny/wasm32-unknown-unknown/release/ && \
for i in *.wasm ; do \
wasm-opt -Oz "$$i" -o "$$i.tmp" && mv "$$i.tmp" "$$i"; \
ls -l "$$i"; \
done
check: build fmt
cargo hack --feature-powerset --exclude-features docs check
cargo hack check --release --target wasm32-unknown-unknown
watch:
cargo watch --clear --watch-when-idle --shell '$(MAKE)'
watch-doc:
cargo +nightly watch --clear --watch-when-idle --shell '$(MAKE) doc CARGO_DOC_ARGS='
fmt:
cargo fmt --all
clean:
cargo clean
CARGO_TARGET_DIR=target-tiny cargo +nightly clean
# Build all projects as if they are being published to crates.io, and do so for
# all feature and target combinations.
publish-dry-run-sdk:
cargo +stable hack --feature-powerset publish --locked --dry-run --exclude-features docs --package soroban-sdk
cargo +stable hack --feature-powerset publish --locked --dry-run --exclude-features docs,testutils --package soroban-sdk --target wasm32-unknown-unknown
publish-dry-run-sdk-macros:
cd macros && cargo +stable hack --feature-powerset publish --locked --dry-run --package soroban-sdk-macros
# Publish publishes the crate to crates.io. The dry-run is a dependency because
# the dry-run target will verify all feature set combinations.
publish-sdk: publish-dry-run-sdk
cargo +stable publish --locked --package soroban-sdk
publish-sdk-macros: publish-dry-run-sdk-macros
cd macros && cargo +stable publish --locked --package soroban-sdk-macros