-
Notifications
You must be signed in to change notification settings - Fork 85
/
Make_Release.bat
83 lines (69 loc) · 3.83 KB
/
Make_Release.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
@echo off
:: Adjust this to 7-Zip executable
set ZIP="C:\Program Files\7-Zip\7z.exe"
:: Check that 7-Zip exists
if not exist %ZIP% (
echo 7-Zip not installed or wrong path set!
echo You might need to modify "ZIP" variable in this bat file.
GOTO :ERROR
)
:: Navigate to the folder where the batch is located
cd %~dp0
:: Compile all profiles
echo Compiling...
start /w Building_script.bat 12
IF %ERRORLEVEL% NEQ 0 echo Build error! && GOTO :ERROR
echo OK
echo.
:: Copy files
md Release 2>nul
cd Release
del *.zip *.bin *.list 2>nul >nul
copy "..\BOARDS\KSGER\v1.5\STM32F103\SSD1306.bin" "KSGER_v1_5_OLED.bin" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\KSGER\v1.5\STM32F103\SSD1306.list" "KSGER_v1_5_OLED.list" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\KSGER\v1.5\STM32F103\ST7565.bin" "KSGER_v1_5_LCD_ST7565.bin" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\KSGER\v1.5\STM32F103\ST7565.list" "KSGER_v1_5_LCD_ST7565.list" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\KSGER\v2\STM32F101\SSD1306.bin" "KSGER_v2_OLED.bin" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\KSGER\v2\STM32F101\SSD1306.list" "KSGER_v2_OLED.list" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\KSGER\v3\STM32F101\SSD1306.bin" "KSGER_v3_OLED.bin" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\KSGER\v3\STM32F101\SSD1306.list" "KSGER_v3_OLED.list" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\KSGER\v3\STM32F101\ST7565.bin" "KSGER_v3_LCD_ST7565.bin" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\KSGER\v3\STM32F101\ST7565.list" "KSGER_v3_LCD_ST7565.list" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\Quicko\STM32F072\SSD1306.bin" "Quicko_STM32F072_OLED.bin" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\Quicko\STM32F072\SSD1306.list" "Quicko_STM32F072_OLED.list" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\Quicko\STM32F072\ST7565.bin" "Quicko_STM32F072_LCD_ST7565.bin" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\Quicko\STM32F072\ST7565.list" "Quicko_STM32F072_LCD_ST7565.list" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\Quicko\STM32F103\SSD1306.bin" "Quicko_STM32F103_OLED.bin" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\Quicko\STM32F103\SSD1306.list" "Quicko_STM32F103_OLED.list" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\Quicko\STM32F103\ST7565.bin" "Quicko_STM32F103_LCD_ST7565.bin" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\Quicko\STM32F103\ST7565.list" "Quicko_STM32F103_LCD_ST7565.list" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\Quecoo\T12-958_v2\STM32F103\SSD1306.bin" "Quecoo_T12-958_v2_OLED.bin" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\Quecoo\T12-958_v2\STM32F103\SSD1306.list" "Quecoo_T12-958_v2_OLED.list" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\Quecoo\T12-958_v2\STM32F103\ST7565.bin" "Quecoo_T12-958_v2_LCD_ST7565.bin" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
copy "..\BOARDS\Quecoo\T12-958_v2\STM32F103\ST7565.list" "Quecoo_T12-958_v2_LCD_ST7565.list" >nul && IF %ERRORLEVEL% NEQ 0 GOTO :NO_FILES
echo Creating zip files...
echo.
:: Create zips
for %%f in (*.bin) do (
set FILE=%%~nf
call :ZIP
)
goto :DONE
:ZIP
echo %FILE%
%ZIP% a -mx=9 -tzip %FILE%.zip %FILE%.* -y >nul
::%ZIP% a -mx=9 -tzip FLASH_TEST_%FILE%.zip %FILE%.bin -y >nul
IF %ERRORLEVEL% NEQ 0 echo Unknown 7-ZIP Error! && GOTO :ERROR
exit /B
:DONE
echo.
echo OK
echo Files placed in "Release" folder
TIMEOUT 3 >NUL
GOTO :END
:NO_FILES
echo Missing bin files!
echo First run Building_script.bat and select "Compile all"
:ERROR
pause
:END