2020-07-09 07:27:20 -07:00
|
|
|
#!/bin/bash
|
2020-07-03 08:03:50 -07:00
|
|
|
|
|
|
|
# This script would compile firmware, dev console and win32 simulator into a single bundle file
|
|
|
|
# This script depends on Cygwin tools: zip
|
|
|
|
|
|
|
|
SCRIPT_NAME="build_current_bundle"
|
|
|
|
ROOT_FOLDER=$(pwd)
|
|
|
|
echo "$SCRIPT_NAME Entering ROOT_FOLDER=$ROOT_FOLDER"
|
|
|
|
|
|
|
|
echo "$SCRIPT_NAME.sh: Hello rusEfi build full bundle"
|
|
|
|
date "+%a %D %T.%2S"
|
|
|
|
|
2020-07-06 15:46:26 -07:00
|
|
|
export BUNDLE_NAME="default"
|
|
|
|
|
2020-07-03 08:03:50 -07:00
|
|
|
cd firmware/bootloader
|
2020-07-09 07:27:20 -07:00
|
|
|
bash clean_bootloader.sh
|
|
|
|
bash compile_bootloader_discovery407.sh
|
2020-07-03 08:03:50 -07:00
|
|
|
[ -e bootloader_generated.hxx ] || { echo "FAILED TO COMPILE BOOTLOADER"; exit 1; }
|
|
|
|
pwd
|
|
|
|
cd ../..
|
|
|
|
# At root folder here
|
|
|
|
|
|
|
|
cd firmware
|
|
|
|
date "+%a %D %T.%2S"
|
|
|
|
|
|
|
|
echo "$SCRIPT_NAME: will be Erasing chip"
|
2020-07-04 16:59:02 -07:00
|
|
|
[ -e flash_erase407.sh ] || { echo "NOT FOUND flash_erase.sh"; exit 1; }
|
2020-07-03 08:03:50 -07:00
|
|
|
echo "$SCRIPT_NAME: Erasing chip"
|
2020-07-09 07:27:20 -07:00
|
|
|
bash flash_erase407.sh
|
2020-07-03 08:03:50 -07:00
|
|
|
|
|
|
|
echo "$SCRIPT_NAME: Building firmware"
|
2020-07-09 07:27:20 -07:00
|
|
|
bash clean.sh
|
2020-07-03 08:03:50 -07:00
|
|
|
|
2020-07-09 07:27:20 -07:00
|
|
|
bash update_version.sh
|
2020-07-03 08:03:50 -07:00
|
|
|
|
2020-07-09 07:27:20 -07:00
|
|
|
bash clean_compile_two_versions.sh
|
2020-07-06 15:46:26 -07:00
|
|
|
#[ -e deliver/rusefi_no_asserts.hex ] || { echo "Just to confirm - FAILED to compile no_asserts"; exit 1; }
|
2020-07-03 08:03:50 -07:00
|
|
|
|
2020-07-04 17:11:55 -07:00
|
|
|
[ -e deliver/rusefi.hex ] || { echo "Just to confirm - FAILED to compile default DEBUG"; exit 1; }
|
2020-07-03 08:03:50 -07:00
|
|
|
|
|
|
|
echo "$SCRIPT_NAME: Building DFU"
|
|
|
|
if uname | grep "NT"; then
|
|
|
|
chmod u+x ../misc/encedo_hex2dfu/hex2dfu.exe
|
2020-07-06 15:46:26 -07:00
|
|
|
# ../misc/encedo_hex2dfu/hex2dfu.exe -i deliver/rusefi_no_asserts.hex -o deliver/rusefi_no_asserts.dfu
|
2020-07-03 08:03:50 -07:00
|
|
|
../misc/encedo_hex2dfu/hex2dfu.exe -i deliver/rusefi.hex -o deliver/rusefi.dfu
|
|
|
|
else
|
|
|
|
chmod u+x ../misc/encedo_hex2dfu/hex2dfu.bin
|
2020-07-06 15:46:26 -07:00
|
|
|
# ../misc/encedo_hex2dfu/hex2dfu.bin -i deliver/rusefi_no_asserts.hex -o deliver/rusefi_no_asserts.dfu
|
2020-07-03 08:03:50 -07:00
|
|
|
../misc/encedo_hex2dfu/hex2dfu.bin -i deliver/rusefi.hex -o deliver/rusefi.dfu
|
|
|
|
fi
|
|
|
|
|
2020-07-05 20:54:43 -07:00
|
|
|
echo "${SCRIPT_NAME} ls -l deliver"
|
2020-07-03 08:03:50 -07:00
|
|
|
ls -l deliver
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
# At root folder here
|
|
|
|
|
2020-07-09 07:27:20 -07:00
|
|
|
bash misc/jenkins/build_java_console.sh
|
2020-07-08 08:10:24 -07:00
|
|
|
[ -e java_console_binary/rusefi_console.jar ] || { echo "rusefi_console.jar build FAILED"; exit 1; }
|
2020-07-03 08:03:50 -07:00
|
|
|
|
2020-07-09 07:27:20 -07:00
|
|
|
bash misc/jenkins/build_simulator.sh
|
2020-07-08 08:10:24 -07:00
|
|
|
[ -e simulator/build/rusefi_simulator.exe ] || { echo "rusefi_simulator.exe build FAILED"; exit 1; }
|
2020-07-03 08:03:50 -07:00
|
|
|
|
|
|
|
STM_ARCH="stm32f407"
|
|
|
|
TIMESTAMP=$(date "+%Y%m%d_%H%M%S")
|
|
|
|
|
|
|
|
FOLDER="snapshot_${TIMESTAMP}_${STM_ARCH}_rusefi"
|
|
|
|
echo "$SCRIPT_NAME: folder variable1=$FOLDER"
|
|
|
|
export FOLDER="temp/$FOLDER"
|
|
|
|
echo "$SCRIPT_NAME: folder variable3=$FOLDER"
|
|
|
|
|
|
|
|
pwd
|
|
|
|
export BUNDLE_FULL_NAME="rusefi_bundle"
|
2020-07-09 07:27:20 -07:00
|
|
|
bash misc/jenkins/build_working_folder.sh
|
2020-07-03 08:03:50 -07:00
|
|
|
[ $? -eq 0 ] || { echo "$SCRIPT_NAME: ERROR: invoking build_working_folder.sh"; exit 1; }
|
|
|
|
|
|
|
|
|
|
|
|
echo "$SCRIPT_NAME: Going back to root folder"
|
|
|
|
cd "$ROOT_FOLDER"
|
|
|
|
pwd
|
|
|
|
|
|
|
|
echo "TIMESTAMP $(date "+%a %D %T.%2S")"
|
|
|
|
pwd
|
|
|
|
echo "exiting $SCRIPT_NAME"
|