cargo: Allow for manual cargo invokations
This commit is contained in:
@ -58,6 +58,15 @@ $ cd ../build/
|
|||||||
$ src/squeekboard
|
$ src/squeekboard
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Maintenance
|
||||||
|
|
||||||
|
Use the `cargo.sh` script for maintaining the Cargo part of the build. The script takes the usual Cargo commands, after the first 2 positionsl arguments: source directory, and output artifact. So, `cargo test` becomes:
|
||||||
|
|
||||||
|
```
|
||||||
|
cd build_dir
|
||||||
|
/source_path/cargo.sh /source_path '' test
|
||||||
|
```
|
||||||
|
|
||||||
### Testing
|
### Testing
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
15
cargo.sh
15
cargo.sh
@ -1,13 +1,22 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script manages Cargo operations
|
||||||
|
# while keeping the artifact directory within the build tree
|
||||||
|
# instead of the source tree
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
SOURCE_DIR="$1"
|
||||||
|
|
||||||
export CARGO_TARGET_DIR=`pwd`
|
export CARGO_TARGET_DIR=`pwd`
|
||||||
if [ ! -z ${2} ]; then
|
if [ ! -z ${2} ]; then
|
||||||
OUT_PATH=`realpath "${2}"`
|
OUT_PATH=`realpath "${2}"`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $1
|
cd $SOURCE_DIR
|
||||||
cargo $3 -p rs
|
shift
|
||||||
|
shift
|
||||||
|
cargo $BUILD_ARG $@
|
||||||
|
|
||||||
if [ ! -z ${OUT_PATH} ]; then
|
if [ ! -z ${OUT_PATH} ]; then
|
||||||
cp "${CARGO_TARGET_DIR}"/debug/librs.a "${OUT_PATH}"
|
cp "${CARGO_TARGET_DIR}"/debug/librs.a "${OUT_PATH}"
|
||||||
|
|||||||
Reference in New Issue
Block a user