Skip to content

Commit

Permalink
setup: adding Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Jan 24, 2024
1 parent 5617264 commit e3617ec
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ debug/
target/
schema/

artifacts/
artifacts-local/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
Expand Down
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
build-opt:
# https://github.com/CosmWasm/rust-optimizer
docker run --rm -v "$(CURDIR)":/code \
--mount type=volume,source="$$(basename "$(CURDIR)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/workspace-optimizer:0.15.0

build:
# @RUSTFLAGS='-C link-arg=-s' cargo +stable build --target wasm32-unknown-unknown --release --lib
cargo build --target wasm32-unknown-unknown --release --lib
@mkdir -p artifacts-local
@cp target/wasm32-unknown-unknown/release/*.wasm ./artifacts-local

check:
cosmwasm-check target/wasm32-unknown-unknown/release/*.wasm

unit-test:
cargo test --lib

0 comments on commit e3617ec

Please sign in to comment.