From e69fc53c3df9eecf728b34936a1a75d44a4702e7 Mon Sep 17 00:00:00 2001 From: lorban Date: Tue, 20 Feb 2024 17:03:20 +0100 Subject: [PATCH] easy script for compiling during development after that the SRI has been divided in several workspaces for external consuption, it is annoying to compile every workspace manually. So, a script named clippy-on-all-workspaces.sh has been added. This script is mean to aid the the final phase of developing a feature, where build compiles and we pass to clippy. In a preliminary phase of developing though, it is necessary something that compiles a bit less deep and we do want to make tests pass. Thats why I propose this script that does exactly this: performes `cargo build` and `cargo +nightly fmt` in each workspace. --- build-on-all-workspaces.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 build-on-all-workspaces.sh diff --git a/build-on-all-workspaces.sh b/build-on-all-workspaces.sh new file mode 100755 index 0000000000..9d7943ed87 --- /dev/null +++ b/build-on-all-workspaces.sh @@ -0,0 +1,24 @@ + +#!/bin/sh + +WORKSPACES="benches common protocols roles utils" + +for workspace in $WORKSPACES; do + echo "Executing build on: $workspace" + cargo build --manifest-path="$workspace/Cargo.toml" -- + if [ $? -ne 0 ]; then + echo "Build found some errors in: $workspace" + exit 1 + fi + + echo "Running fmt on: $workspace" + (cd $workspace && cargo +nightly fmt) + if [ $? -ne 0 ]; then + echo "Fmt failed in: $workspace" + exit 1 + fi +done + +echo "build success!" + +