martin-g commented on code in PR #1570:
URL: https://github.com/apache/avro/pull/1570#discussion_r871242405
##########
lang/rust/build.sh:
##########
@@ -17,57 +17,69 @@
set -e # exit on error
-root_dir=$(pwd)
-build_dir="../../build/rust"
-dist_dir="../../dist/rust"
+cd "$(dirname "$0")" # If being called from another folder, cd into the
directory containing this script.
+# shellcheck disable=SC1091
+source ../../share/build-helper.sh "Rust"
+
+build_dir="$BUILD_ROOT/build/rust"
+dist_dir="$BUILD_ROOT/dist/rust"
function clean {
- if [ -d $build_dir ]; then
- find $build_dir | xargs chmod 755
- rm -rf $build_dir
+ if [ -d "$build_dir" ]; then
+ execute find "$build_dir" -exec chmod 755 {} +
+ execute rm -rf "$build_dir"
fi
}
-
function prepare_build {
clean
- mkdir -p $build_dir
+ execute mkdir -p "$build_dir"
+}
+
+function command_clean()
+{
+ execute cargo clean
+}
+
+function command_lint()
+{
+ execute cargo clippy --all-targets --all-features -- -Dclippy::all
+}
+
+function command_test()
+{
+ execute cargo test
+}
+
+function command_dist()
+{
+ execute cargo build --release --lib --all-features
+ execute cargo package
+ execute mkdir -p "$BUILD_ROOT/dist/rust"
Review Comment:
```suggestion
execute mkdir -p "$dist_dir"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]