mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 16:17:59 +00:00
4ff97bd856
* Adds `WASM_TARGET_DIRECTORY` env variable to `wasm-builder` * Create the `wasm-builder-runner`'s in a common workspace * Make `wasm-builder` trigger less rebuilds * Version up * Adds script for building only the WASM files * Apply suggestions from code review Co-Authored-By: André Silva <andre.beat@gmail.com> Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>
30 lines
716 B
Bash
Executable File
30 lines
716 B
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
# Script for building only the WASM binary of the given project.
|
|
|
|
set -e
|
|
|
|
PROJECT_ROOT=`git rev-parse --show-toplevel`
|
|
|
|
if [ "$#" -lt 1 ]; then
|
|
echo "You need to pass the name of the crate you want to compile!"
|
|
exit 1
|
|
fi
|
|
|
|
WASM_BUILDER_RUNNER="$PROJECT_ROOT/target/release/wbuild-runner/$1"
|
|
|
|
if [ -z "$2" ]; then
|
|
export WASM_TARGET_DIRECTORY=$(pwd)
|
|
else
|
|
export WASM_TARGET_DIRECTORY=$2
|
|
fi
|
|
|
|
if [ -d $WASM_BUILDER_RUNNER ]; then
|
|
export DEBUG=false
|
|
export OUT_DIR="$PROJECT_ROOT/target/release/build"
|
|
cargo run --release --manifest-path="$WASM_BUILDER_RUNNER/Cargo.toml" \
|
|
| grep -vE "cargo:rerun-if-|Executing build command" \
|
|
else
|
|
cargo build --release -p $1
|
|
fi
|