build: incremental release on desktop development
This commit is contained in:
parent
18f52f877a
commit
d7d1c53c52
1 changed files with 10 additions and 8 deletions
|
@ -1,25 +1,27 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
debug|release)
|
debug|build)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: build_run.sh [type] where is type is 'debug' or 'release'" >&2
|
echo "Usage: build_run.sh [type] where is type is 'debug' or 'build'" >&2
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Setup build directory
|
# Setup build directory
|
||||||
BASEDIR=$(cd $(dirname $0) && pwd)
|
BASEDIR=$(cd "$(dirname $0)" && pwd)
|
||||||
cd ${BASEDIR}
|
cd "${BASEDIR}" || return
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Build application
|
# Build application
|
||||||
type=$1
|
type=$1
|
||||||
[[ ${type} == "release" ]] && release_param+=(--release)
|
[[ ${type} == "build" ]] && release_param+=(--release)
|
||||||
cargo build ${release_param[@]}
|
cargo --config profile.release.incremental=true build "${release_param[@]}"
|
||||||
|
|
||||||
# Start application
|
# Start application
|
||||||
if [ $? -eq 0 ]
|
if [ $? -eq 0 ]
|
||||||
then
|
then
|
||||||
./target/${type}/grim
|
path=${type}
|
||||||
|
[[ ${type} == "build" ]] && path="release"
|
||||||
|
./target/"${path}"/grim
|
||||||
fi
|
fi
|
Loading…
Reference in a new issue