diff --git a/build.sh b/build.sh index ed6e31e3ee..5200ed5155 100755 --- a/build.sh +++ b/build.sh @@ -32,6 +32,8 @@ # 16 Jan 2019, 3d-gussner, Build_2, Added development check to modify 'Configuration.h' to prevent unwanted LCD messages that Firmware is uknown # 17 Jan 2019, 3d-gussner, Build_3, Check for OS Windows or Linux and use the right build enviroment # 10 Feb 2019, ropaha, Pull Request, Select variant from list while using build.sh +# 10 Feb 2019, ropaha, change FW_DEV_VERSION automatically depending on FW_VERSION RC/BETA/ALPHA +# 10 Feb 2019, 3d-gussner, 1st tests with english only BUILD_ENV="1.0.1" SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )" @@ -62,8 +64,13 @@ else VARIANT=$1 fi -# NOT IMPLEMENTED YET. Second argument defines if it is an english only version. Format EN_ONLY -EN_ONLY=$2 +# NOT IMPLEMENTED YET. Second argument defines if it is an english only version. Known values EN_ONLY / / ALL +if [ -z "$2" ] ; then + echo "Which lang-build do you want?" +else + LANGUAGES=$2 +fi + # Find firmware version in Configuration.h file and use it to generate the hex filename FW=$(grep --max-count=1 "\bFW_VERSION\b" Firmware/Configuration.h | sed -e's/ */ /g'|cut -d '"' -f2|sed 's/\.//g') # Find build version in Configuration.h file and use it to generate the hex filename @@ -72,15 +79,6 @@ BUILD=$(grep --max-count=1 "\bFW_COMMIT_NR\b" Firmware/Configuration.h | sed -e' MOTHERBOARD=$(grep --max-count=1 "\bMOTHERBOARD\b" Firmware/variants/$VARIANT.h | sed -e's/ */ /g' |cut -d ' ' -f3) # Check development status DEV_CHECK=$(grep --max-count=1 "\bFW_VERSION\b" Firmware/Configuration.h | sed -e's/ */ /g'|cut -d '"' -f2|sed 's/\.//g'|cut -d '-' -f2) -if [ "$DEV_CHECK" == "$FW" ] ; then - DEV_STATUS="GOLD" -else - if [[ "$DEV_CHECK" == "RC1" || "$DEV_CHECK" == "RC2" ]] ; then - DEV_STATUS="RC" - else - DEV_STATUS="UNKNOWN" - fi -fi # List few useful data echo @@ -93,7 +91,7 @@ echo "DEV Status :" $DEV_STATUS echo "Motherboard:" $MOTHERBOARD echo "OS :" $OS echo "OS type :" $OSTYPE -echo $2 +echo "Languages :" $LANGUAGES #### Start prepare building @@ -155,9 +153,33 @@ BUILD_PATH="$( pwd -P )" if [ ! -f "$SCRIPT_PATH/Firmware/Configuration_prusa.h" ]; then cp -f $SCRIPT_PATH/Firmware/variants/$VARIANT.h $SCRIPT_PATH/Firmware/Configuration_prusa.h || exit 8 fi - #if [ ! -z "$EN_ONLY" ]; then +#Prepare Configuration.h to use the correct FW_DEV_VERSION to prevent LCD messages when connecting with OctoPrint +if [ "$DEV_CHECK" == "$FW" ] ; then + DEV_STATUS="GOLD" +else + if [[ "$DEV_CHECK" == "RC1" || "$DEV_CHECK" == "RC2" ]] ; then + DEV_STATUS="RC" + sed -i -- 's/#define FW_DEV_VERSION FW_VERSION_UNKNOWN/#define FW_DEV_VERSION FW_VERSION_RC/g' $SCRIPT_PATH/Firmware/Configuration.h + + else + DEV_STATUS="UNKNOWN" + fi +fi + +#Prepare english only or multilanguage version to be build +if [ ! -z "$LANGUAGES" ] ; then + echo + echo "Multi-language firmware will be build" + echo +else + echo + echo "English language firmware will be build" + echo +fi + + +#Set FW_DEV_VERSION to development status - #Set FW_DEV_VERSION to development status #Check if compiler flags are set to Prusa specific needs for the rambo board. if [ $OS == "Windows_NT" ]; then @@ -185,8 +207,9 @@ export ARDUINO=$BUILD_ENV_PATH echo $BUILD_ENV_PATH export BUILDER=$ARDUINO/arduino-builder -sleep 5 -#read -p "Press any Enter..." +echo +read -t 10 -p "Press any Enter..." +echo if [ $OS == "Windows_NT" ]; then echo "Start to build Prusa Firmware under Windows..." @@ -242,6 +265,7 @@ echo "" echo "Restore platform.txt" echo "" cp -f $BUILD_ENV_PATH/portable/packages/$RAMBO_PLATFORM_FILE.bck $BUILD_ENV_PATH/portable/packages/$RAMBO_PLATFORM_FILE +sed -i -- 's/#define FW_DEV_VERSION FW_VERSION_*/#define FW_DEV_VERSION FW_VERSION_UNKNOWN/g' $SCRIPT_PATH/Firmware/Configuration.h # Switch to hex path and list build files cd $SCRIPT_PATH