Skip to content

Commit 6ebc9f8

Browse files
authored
Merge pull request #26 from CosmWasm/multiple-contracts-support
Multiple contracts support
2 parents 5005406 + ab69fdc commit 6ebc9f8

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 0.10.6
4+
5+
- Add support for building multiple non-workspace contracts at once (#25)
6+
37
## 0.10.5
48

59
- Remove `trzeci/emscripten` dependency and install `wasm-opt` manually

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
DOCKER_NAME_RUST_OPTIMIZER := "cosmwasm/rust-optimizer"
44
DOCKER_NAME_WORKSPACE_OPTIMIZER := "cosmwasm/workspace-optimizer"
5-
DOCKER_TAG := 0.10.5
5+
DOCKER_TAG := 0.10.6
66

77
build-rust-optimizer:
88
docker build -t $(DOCKER_NAME_RUST_OPTIMIZER):$(DOCKER_TAG) --file rust-optimizer.Dockerfile .

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ you to produce a smaller build that works with the cosmwasm integration tests
2424
docker run --rm -v "$(pwd)":/code \
2525
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
2626
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
27-
cosmwasm/rust-optimizer:0.10.5
27+
cosmwasm/rust-optimizer:0.10.6
2828
```
2929

3030
Demo this with `cosmwasm-examples` (going into eg. `erc20` subdir before running),
@@ -57,7 +57,7 @@ To compile all contracts in the workspace deterministically, you can run:
5757
docker run --rm -v "$(pwd)":/code \
5858
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
5959
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
60-
cosmwasm/workspace-optimizer:0.10.5
60+
cosmwasm/workspace-optimizer:0.10.6
6161
```
6262

6363
The downside is that to verify one contract in the workspace, you need to compile them
@@ -83,7 +83,7 @@ case, we can use the optimize.sh command:
8383
docker run --rm -v "$(pwd)":/code \
8484
--mount type=volume,source="devcontract_cache_burner",target=/code/contracts/burner/target \
8585
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
86-
cosmwasm/rust-optimizer:0.10.5 ./contracts/burner
86+
cosmwasm/rust-optimizer:0.10.6 ./contracts/burner
8787
```
8888

8989
## Development

optimize.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ command -v shellcheck > /dev/null && shellcheck "$0"
55
export PATH=$PATH:/root/.cargo/bin
66

77
mkdir -p artifacts
8-
contractdir="$1"
8+
contractdirs="$@"
99

1010
# There are two cases here
1111
# 1. All contracts (or one) are included in the root workspace (eg. `cosmwasm-template`, `cosmwasm-examples`, `cosmwasm-plus`)
1212
# In this case, we pass no argument, just mount the proper directory.
13-
# 2. Contacts are excluded from the root workspace, but import relative paths from other packages (only `cosmwasm`).
13+
# 2. Contracts are excluded from the root workspace, but import relative paths from other packages (only `cosmwasm`).
1414
# In this case, we mount root workspace and pass in a path `docker run <repo> ./contracts/hackatom`
1515

1616
# This parameter allows us to mount a folder into docker container's "/code"
1717
# and build "/code/contracts/mycontract".
1818
# Note: if contractdir is "." (default in Docker), this ends up as a noop
19+
for contractdir in $contractdirs
20+
do
1921
echo "Building contract in $(realpath -m "$contractdir")"
2022
(
2123
cd "$contractdir"
@@ -39,3 +41,4 @@ done
3941
)
4042

4143
echo "done"
44+
done

0 commit comments

Comments
 (0)