1MONOVERSION=`cat ../mono_version` 2MONO_MAJOR=`echo $MONOVERSION | cut -d'.' -f1` 3MONO_MINOR=`echo $MONOVERSION | cut -d'.' -f2` 4TARGET="Release" 5BASE=../.. 6REMOVE_WORKDIR=true 7DATE="" 8COMMIT="" 9 10function help { 11 echo "$0 [-d] [-n] [-l]" 12 echo 13 echo -e "-d\tuse Debug configuration" 14 echo -e "-n\tcreate a nightly build with date and commit SHA" 15 echo -e "-l\tdo not remove workdir after building" 16} 17 18function is_dep_available { 19 if ! command -v $1 >/dev/null 2>&1 20 then 21 echo "$1 is missing. Install it to continue." 22 return 1 23 fi 24 return 0 25} 26 27while getopts ":dnl" opt 28do 29 case $opt in 30 d) 31 TARGET="Debug" 32 ;; 33 n) 34 DATE="+`date +%Y%m%d`" 35 COMMIT="git`git rev-parse --short=9 HEAD`" 36 ;; 37 l) 38 REMOVE_WORKDIR=false 39 ;; 40 \?) 41 echo "Invalid option: -$OPTARG" 42 help 43 exit 1 44 ;; 45 esac 46done 47 48VERSION=`cat ../version` 49VERSION="$VERSION$DATE$COMMIT" 50