mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 19:27:58 +00:00
Make it easier to just rebuild the WASM files (#3510)
* 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>
This commit is contained in:
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user