fix models list reload after USB mass storage connection (#5963)
[opentx.git] / tools / build-companion-nightly.sh
blob94a4f92bfcc8682bd827aa09c0bce4b87835303f
1 #!/bin/bash
3 # Stops on first error, echo on
4 set -e
5 set -x
7 JOBS=2
9 while [ $# -gt 0 ]
11 case "$1" in
12 --jobs=*)
13 JOBS="${1#*=}";;
14 -j*)
15 JOBS="${1#*j}";;
16 -*)
17 echo >&2 "usage: $0 [-j<jobs>|--jobs=<jobs>] SRCDIR OUTDIR VERSION_SUFFIX"
18 exit 1;;
20 break;; # terminate while loop
21 esac
22 shift
23 done
25 SRCDIR=$1
26 OUTDIR=$2
28 COMMON_OPTIONS="-DALLOW_NIGHTLY_BUILDS=YES -DNIGHTLY_BUILD_WARNING=YES -DGVARS=YES -DHELI=YES -DLUA=YES -DMULTIMODULE=YES -DTELEMETRY=FRSKY -DPPM_LIMITS_SYMETRICAL=YES -DVARIO=YES -DGAUGES=YES -DAUTOSWITCH=YES -DAUTOSOURCE=YES -DAUDIO=YES -DGPS=YES -DPPM_CENTER_ADJUSTABLE=YES -DFLIGHT_MODES=YES -DOVERRIDE_CHANNEL_FUNCTION=YES -DFRSKY_STICKS=YES"
29 if [ "$(uname)" = "Darwin" ]; then
30 COMMON_OPTIONS="${COMMON_OPTIONS} -DCMAKE_PREFIX_PATH=~/Qt/5.7/clang_64/ -DCMAKE_OSX_DEPLOYMENT_TARGET='10.9'"
33 if [ "$3" != "" ]; then
34 COMMON_OPTIONS="${COMMON_OPTIONS} -DVERSION_SUFFIX=$3"
37 rm -rf build
38 mkdir build
39 cd build
41 cmake ${COMMON_OPTIONS} -DPCB=9X ${SRCDIR}
42 make -j${JOBS} libsimulator
44 cmake ${COMMON_OPTIONS} -DPCB=9X128 ${SRCDIR}
45 make -j${JOBS} libsimulator
47 cmake ${COMMON_OPTIONS} -DPCB=9XR ${SRCDIR}
48 make -j${JOBS} libsimulator
50 cmake ${COMMON_OPTIONS} -DPCB=9XR128 ${SRCDIR}
51 make -j${JOBS} libsimulator
53 cmake ${COMMON_OPTIONS} -DPCB=GRUVIN9X ${SRCDIR}
54 make -j${JOBS} libsimulator
56 cmake ${COMMON_OPTIONS} -DPCB=MEGA2560 ${SRCDIR}
57 make -j${JOBS} libsimulator
59 cmake ${COMMON_OPTIONS} -DPCB=AR9X ${SRCDIR}
60 make -j${JOBS} libsimulator
62 cmake ${COMMON_OPTIONS} -DPCB=SKY9X ${SRCDIR}
63 make -j${JOBS} libsimulator
65 cmake ${COMMON_OPTIONS} -DPCB=9XRPRO ${SRCDIR}
66 make -j${JOBS} libsimulator
68 cmake ${COMMON_OPTIONS} -DPCB=X7 ${SRCDIR}
69 make -j${JOBS} libsimulator
71 cmake ${COMMON_OPTIONS} -DPCB=X9D ${SRCDIR}
72 make -j${JOBS} libsimulator
74 cmake ${COMMON_OPTIONS} -DPCB=X9D+ ${SRCDIR}
75 make -j${JOBS} libsimulator
77 cmake ${COMMON_OPTIONS} -DPCB=XLITE ${SRCDIR}
78 make -j${JOBS} libsimulator
80 cmake ${COMMON_OPTIONS} -DPCB=X9E ${SRCDIR}
81 make -j${JOBS} libsimulator
83 cmake ${COMMON_OPTIONS} -DPCB=X10 ${SRCDIR}
84 make -j${JOBS} libsimulator
86 cmake ${COMMON_OPTIONS} -DPCB=X12S ${SRCDIR}
87 make -j${JOBS} libsimulator
89 make -j${JOBS} package
91 if [ "$(uname)" = "Darwin" ]; then
92 cp *.dmg ${OUTDIR}
93 else
94 cp *.deb ${OUTDIR}