-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild_examples.sh
executable file
·48 lines (38 loc) · 1.13 KB
/
build_examples.sh
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
#!/bin/sh
set -e
# This should match the revision/release used for Radix Engine dependencies
# in the examples.
tag="v1.2.0"
fetch_scrypto() {
if [ ! -d radixdlt-scrypto ] ; then
mkdir radixdlt-scrypto
pushd radixdlt-scrypto
git init
git remote add origin https://github.com/radixdlt/radixdlt-scrypto.git
git fetch --depth 1 origin $tag
git checkout FETCH_HEAD
popd
fi
}
build_scrypto() {
cargo build --manifest-path radixdlt-scrypto/radix-clis/Cargo.toml
}
build_examples() {
scrypto="cargo run --manifest-path radixdlt-scrypto/radix-clis/Cargo.toml --bin scrypto $@ --"
# Get Cargo.toml for each example (those with [package] marker).
# Exclude:
# - radixdlt-scrypto
# - examples, which won't buiild by design
find . \( \
-path './radixdlt-scrypto' -o \
-path './step-by-step/18-candy-store-external-component/2-candy-store' \
\) -prune \
-o -name Cargo.toml -print | xargs grep -l '\[package]' | while read path ; do
echo "Building $(dirname $path)"
$scrypto build --path $path
cargo clean --manifest-path $path
done
}
fetch_scrypto
build_scrypto
build_examples